Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
9ca070fa
Unverified
Commit
9ca070fa
authored
Jul 21, 2020
by
Victor Oliveira
Committed by
GitHub
Jul 21, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Ignore unused (but downloaded) libraries (#18728)
parent
e78f1237
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildroot/share/PlatformIO/scripts/common-features-dependencies.py
+31
-0
31 additions, 0 deletions
.../share/PlatformIO/scripts/common-features-dependencies.py
with
31 additions
and
0 deletions
buildroot/share/PlatformIO/scripts/common-features-dependencies.py
+
31
−
0
View file @
9ca070fa
...
...
@@ -36,6 +36,36 @@ def load_config():
else
:
FEATURE_DEPENDENCIES
[
key
[
0
].
upper
()][
'
lib_deps
'
]
+=
[
dep
]
def
get_all_known_libs
():
known_libs
=
[]
for
feature
in
FEATURE_DEPENDENCIES
:
if
not
'
lib_deps
'
in
FEATURE_DEPENDENCIES
[
feature
]:
continue
for
dep
in
FEATURE_DEPENDENCIES
[
feature
][
'
lib_deps
'
]:
name
,
_
,
_
=
PackageManager
.
parse_pkg_uri
(
dep
)
known_libs
.
append
(
name
)
return
known_libs
def
get_all_env_libs
():
env_libs
=
[]
lib_deps
=
env
.
GetProjectOption
(
"
lib_deps
"
)
for
dep
in
lib_deps
:
name
,
_
,
_
=
PackageManager
.
parse_pkg_uri
(
dep
)
env_libs
.
append
(
name
)
return
env_libs
# We need to ignore all non-used libs,
# so if a lib folder lay forgotten in .pio/lib_deps, it
# will not break compiling
def
force_ignore_unused_libs
():
env_libs
=
get_all_env_libs
()
known_libs
=
get_all_known_libs
()
diff
=
(
list
(
set
(
known_libs
)
-
set
(
env_libs
)))
lib_ignore
=
env
.
GetProjectOption
(
"
lib_ignore
"
)
+
diff
print
(
"
Ignoring libs:
"
,
lib_ignore
)
proj
=
env
.
GetProjectConfig
()
proj
.
set
(
"
env:
"
+
env
[
"
PIOENV
"
],
"
lib_ignore
"
,
lib_ignore
)
def
install_features_dependencies
():
load_config
()
for
feature
in
FEATURE_DEPENDENCIES
:
...
...
@@ -158,3 +188,4 @@ env.AddMethod(MarlinFeatureIsEnabled)
# install all dependencies for features enabled in Configuration.h
install_features_dependencies
()
force_ignore_unused_libs
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment