Skip to content

dist/tools/buildsystem_sanity_check: add an export variable check#11484

Merged
jcarrano merged 1 commit intoRIOT-OS:masterfrom
cladmi:pr/dist/build_system_check/exported_variables
May 7, 2019
Merged

dist/tools/buildsystem_sanity_check: add an export variable check#11484
jcarrano merged 1 commit intoRIOT-OS:masterfrom
cladmi:pr/dist/build_system_check/exported_variables

Conversation

@cladmi
Copy link
Copy Markdown
Contributor

@cladmi cladmi commented May 3, 2019

Contribution description

Check that some variables are not exported in the build system.
This should track variables that managed to not be exported anymore so
that they do not reappear in a BSP.

It is not a whitelist but just a way to keep things cleaned in the
future.

Testing procedure

No error when running the script as will CI check in static-tests.
No error when running shellcheck on the script.

Applying this diff will report a lot of errors as they are still exported.

diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh
index e18ca6776..bd4071fd8 100755
--- a/dist/tools/buildsystem_sanity_check/check.sh
+++ b/dist/tools/buildsystem_sanity_check/check.sh
@@ -50,6 +50,8 @@ check_not_parsing_features() {
 UNEXPORTED_VARIABLES=()
 UNEXPORTED_VARIABLES+=('FLASHFILE')
 UNEXPORTED_VARIABLES+=('TERMPROG' 'TERMFLAGS')
+UNEXPORTED_VARIABLES+=('FFLAGS')
+UNEXPORTED_VARIABLES+=('PORT[ ?=]' 'PORT$')
 check_not_exporting_variables() {
     local patterns=()
     local pathspec=()

I used PORT here on purpose as it may need to be more complicated to not match PORT_LINUX too. Even if PORT_LINUX should not be exported anyway but another PORTSOMETHING may need to.

Issues/PRs references

Tracking: remove harmful use of export in make and immediate evaluation #10850
Useful for #10440

@cladmi cladmi added Area: tests Area: tests and testing framework Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 3, 2019
@cladmi cladmi added this to the Release 2019.07 milestone May 3, 2019
@cladmi cladmi requested a review from jcarrano May 3, 2019 11:59
@cladmi cladmi force-pushed the pr/dist/build_system_check/exported_variables branch from a2e0a98 to 4c7b9be Compare May 3, 2019 13:16
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented May 3, 2019

I pushed force a line cleanup that stayed in my repository. Putting a fixup would still break the static tests that I would like to show they are passing.

@jcarrano
Copy link
Copy Markdown
Contributor

jcarrano commented May 6, 2019

Squash and we're done.

Check that some variables are not exported in the build system.
This should track variables that managed to not be exported anymore so
that they do not reappear in a BSP.

It is not a whitelist but just a way to keep things cleaned in the
future.
@cladmi cladmi force-pushed the pr/dist/build_system_check/exported_variables branch from 0337f7a to 42b3cd5 Compare May 6, 2019 11:37
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented May 6, 2019

Squashed :)

Copy link
Copy Markdown
Contributor

@jcarrano jcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@jcarrano jcarrano merged commit 5fda4f4 into RIOT-OS:master May 7, 2019
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented May 7, 2019

Thanks for the review. Now we can start removing exported variables more easily :)

@cladmi cladmi deleted the pr/dist/build_system_check/exported_variables branch May 7, 2019 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants