Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Moved CI infos to Makefile.ci #12406

Merged
merged 2 commits into from
Oct 15, 2019
Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Oct 9, 2019

Contribution description

  • Decluttered the Makefiles by moving the BOARD_INSUFFICIENT_MEMORY lists from each Makefile to a Makefile.ci
  • Optimized the list for use of tools:
    • One entry per line reduces the number of merge conflicts
    • One entry per line allows alphabetical sorting e.g. via Vim's sort command
  • Sorted all lists alphabetically

Testing procedure

  • Check the diffs
  • Let the CI do its thing

Issues/PRs references

#11128, #9965

@maribu maribu added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation 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 Oct 9, 2019
@maribu maribu added the Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation label Oct 9, 2019
@maribu
Copy link
Member Author

maribu commented Oct 9, 2019

If this PR gets swiftly merged, I might be able to do the same cleanup for the Makefiles in tests today ;-)

@benpicco
Copy link
Contributor

benpicco commented Oct 9, 2019

I like the idea!
But instead of having include Makefile.ci in each Makefile, how about adding -include Makefile.ci to Makefile.include

@miri64
Copy link
Member

miri64 commented Oct 9, 2019

I'm not sure, what this is trying to accomplish... The clutter is just moved to a different spot. Also: the lists are not just about CI, but especially for BLACKLIST/WHITELIST to warn a user, that the app might not be applicable for the board they are using. So the name might be misplaced.

@miri64
Copy link
Member

miri64 commented Oct 9, 2019

If this PR gets swiftly merged, I might be able to do the same cleanup for the Makefiles in tests today ;-)

A big build system change like this shouldn't be merged right before feature freeze oO.

@benpicco
Copy link
Contributor

benpicco commented Oct 9, 2019

I'm not sure, what this is trying to accomplish... The clutter is just moved to a different spot.

Well the clutter is removed from the main Makefile which is actually read by humans, especially the examples.

With the clutter contained to one file, it can clutter that file up as much as it likes - a 100 line Makefile would be atrocious to read, but when it's contained to one file that only does that, the list can take up as much space as it wants, making merging easier.

@maribu
Copy link
Member Author

maribu commented Oct 9, 2019

A big build system change like this shouldn't be merged right before feature freeze oO.

This PR only moves lists from one file to another and sorts their content. As the order of the entries in the list is of no semantic meaning, this PR doesn't change any semantics. But I wouldn't mind waiting a bit either.

I'm not sure, what this is trying to accomplish...

This is a huge reduction of the pain at least I constantly have with those CI lists. Whenever a PR needs to touch one of the lists, the PR is constantly affected by merge conflicts. By having one line per board, this is significantly reduced.

Also with Makefile.ci consisting of at most three lists with one entry at a line, modifying BOARD_INSUFFICIENT_MEMORY with a script is much easier to do. Didn't you once had to add arduino-leonardo to these lists and experienced the pain of working with theses lists yourself?

@cladmi
Copy link
Contributor

cladmi commented Oct 9, 2019

For the definition change at least, all values are still the same here.

I used this to print the variables for all values, then sorted to be able to compare and the sorted values are the same as the reference commit.

for app in $(make info-applications); do make --no-print-directory -C ${app} info-debug-variable-APPLICATION info-debug-variable-BOARD_WHITELIST info-debug-variable-BOARD_BLACKLIST info-debug-variable-BOARD_INSUFFICIENT_MEMORY; done | awk '{ delete a; for (i=1; i<=NF; i++) a[$i]++; n=asorti(a, b); for (i=1; i<=n; i++) printf b[i]" "; print "" }'

https://stackoverflow.com/questions/8802734/sorting-and-removing-duplicate-words-in-a-line/25823667#25823667

BOARD_BLACKLIST and BOARD_WHITELIST are not related to CI.
They are currently compensating for a lack of required features and thus do not belong to a Makefile.ci.

A big build system change like this shouldn't be merged right before feature freeze oO.

This PR only moves lists from one file to another and sorts their content. As the order of the entries in the list is of no semantic meaning, this PR doesn't change any semantics. But I wouldn't mind waiting a bit either.

This is a conceptual change that these definitions must be moved to another entity to define them.

The line based definition and re-ordering is not and could go before.

When doing such a change, it is also good to add some static checks to prevent having the old pattern re-appearing again. Many existing PRs do not follow this scheme and will be merged without being updated.

@miri64
Copy link
Member

miri64 commented Oct 9, 2019

A big build system change like this shouldn't be merged right before feature freeze oO.

Big in the sense of lines touched ;-). I know that the impact shouldn't be that high.

@miri64
Copy link
Member

miri64 commented Oct 9, 2019

Also: the lists are not just about CI, but especially for BLACKLIST/WHITELIST to warn a user, that the app might not be applicable for the board they are using. So the name might be misplaced.

What about this point though?

@maribu
Copy link
Member Author

maribu commented Oct 9, 2019

Also: the lists are not just about CI, but especially for BLACKLIST/WHITELIST to warn a user, that the app might not be applicable for the board they are using. So the name might be misplaced.

What about this point though?

How about renaming Makefile.ci to no longer indicate a strong connection to the CI? Something like Makefile.boardlists?

@maribu
Copy link
Member Author

maribu commented Oct 9, 2019

Big in the sense of lines touched ;-)

True. So lets wait with merging then. I could also the time add a second commit to apply the approach to tests in this PR, once the discussion reached an agreement.

@benpicco
Copy link
Contributor

benpicco commented Oct 9, 2019

BOARD_BLACKLIST and BOARD_WHITELIST are not related to CI.
They are currently compensating for a lack of required features and thus do not belong to a Makefile.ci.

They could go to Makefile.local then.

@maribu
Copy link
Member Author

maribu commented Oct 9, 2019

I think the name Makefile.local is already used to allow developers to add configurations locally to their system that is not intended to be upstreamed. But I'm not sure if I remember this correctly. I think @cladmi is heavily using the features of locally extending the build system to directly select the correct programmer by the value in the BOARD variable on his testing rig, right?

smlng
smlng previously requested changes Oct 11, 2019
Copy link
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

at least for the BOARDS_WHITELIST and BOARDS_BLACKLIST there is IMHO a better way to improve by using features, see #12423 as an RFC example.

@maribu
Copy link
Member Author

maribu commented Oct 11, 2019

at least for the BOARDS_WHITELIST and BOARDS_BLACKLIST there is IMHO a better way to improve by using features, see #12423 as an RFC example.

I agree that using features is generally a better idea than using the black and the whitelist. Even if some of the features would have to be maintained for every board individually, this would be already hugely less pain - the boards are pretty static while the applications are moving targets. But I honestly don't think that this could be done in a single PR, but rather quite a bunch.

I'd say moving those lists out of the main Makefile and having the lists alphabetically sorted and one board per line is a simple and swift way to significantly lessen the pain those lists cause. And this in no way conflicts with any approaches that reduce the number of cases those lists have to be used. I think it is the opposite: Once the lists are easier to manage with scripts (due to having one board in a row and in "lists-only-files"), it will less effort to clean up those list when features can be used instead.

@smlng
Copy link
Member

smlng commented Oct 11, 2019

@maribu I somewhat agree for the BOARDS_INSUFFICIENT_MEMORY list, that moving this into a separate file makes it easier to update the list (also allows to copy this to other apps and tests where the same applies).

For black and white list I would prefer to use the feature mechanism as proposed in #12423.

@maribu
Copy link
Member Author

maribu commented Oct 11, 2019

For black and white list I would prefer to use the feature mechanism as proposed in #12423.

Did you notice that I 100% agree on that? ;-)

I only think that until this goal is reached, having those lists separated out, sorted, and formatted one board a line is beneficial.

@smlng
Copy link
Member

smlng commented Oct 11, 2019

Did you notice that I 100% agree on that? ;-)

I did ... my suggestion would be to move in parallel, i.e. moving BOARDS_INSUFFICIENT_MEMORY in a separate Makefile (your PR here) and remove black/whitelists by using features (either extend #12423 or add PRs per feature). Instead of moving the latter too and changing it later again.

@maribu
Copy link
Member Author

maribu commented Oct 11, 2019

I did ... my suggestion would be to move in parallel, i.e. moving BOARDS_INSUFFICIENT_MEMORY in a separate Makefile (your PR here) and remove black/whitelists by using features (either extend #12423 or add PRs per feature). Instead of moving the latter too and changing it later again.

OK. Let's do this. @miri64: This way also the name Makefile.ci becomes reasonable, right?

@kaspar030: #9081 is not concerned about BOARD_INSUFFICIENT_MEMORY, so that way the order in which #9081 and this PR are merged no longer matters, right?

Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

The blacklists will become much smaller with #9081, to a point where maintaining them will be a non-issue.

I don't like adding another file, with another include and another place to look for configuration.

I suggest moving the "insufficient memory" list to the bottom (right before the include of Makefile.base), with one line per board, alphabetically sorted. It would reduce the maintanance effort.

BOARD_INSUFFICIENT_MEMORY = \
  foo \
  bar \
  #

@maribu
Copy link
Member Author

maribu commented Oct 11, 2019

Another way of reducing those lists and the maintenance burden could be to list CPU_INSUFFICIENT_MEMORY instead of BOARD_INSUFFICIENT_MEMORY

Nice idea. However, board specific bootloaders are not taking into account. As a result the board with the biggest bootloader will force the decision upon other boards. Also, board specific stuff like number of network interfaces used can increase requirements for some board.

Now having written this, I don't think anymore that this will work :-/

@maribu
Copy link
Member Author

maribu commented Oct 11, 2019

@smlng: Check has been added as requested. It works as expected on my machine, hopefully also on others :-)

@maribu
Copy link
Member Author

maribu commented Oct 11, 2019

Aha: The check also works on travis: https://travis-ci.org/RIOT-OS/RIOT/builds/596637735?utm_source=github_status&utm_medium=notification

I'll rebase to also apply the change for examples/suit_update

@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 11, 2019
@maribu
Copy link
Member Author

maribu commented Oct 12, 2019

I believe the issue Murdock points out is a bug in the CI:

/bin/sh: 1: examples/suit_update: Permission denied

Can someone help? I triggered Murdock now three times. In the first run, every test failed with /bin/sh: 1: ./.murdock: not found. The last two runs showed the message above (1 fail, all other tests pass). I think something about this PR triggers bugs in the CI...

@miri64
Copy link
Member

miri64 commented Oct 12, 2019

For me, bugging ci@riot-labs.de works most of the time ;-).

@maribu
Copy link
Member Author

maribu commented Oct 14, 2019

May I squash?

Copy link
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

tested the sanity check it works for all below examples for now. Other changes look good too, if Murdock is happy, this should be good to go.

Please squash.

- Decluttered Makefile by moving BOARD_INSUFFICIENT_MEMORY lists from Makefile
  to Makefile.ci
- Optimized the list for use of tools:
    - One entry per line reduces the number of merge conflicts
    - One entry per line allows alphabetical sorting e.g. via Vim's sort command
- Sorted all lists alphabetically
Enforce BOARD_INSUFFICIENT_MEMORY is not managed in the Makefile in the examples
@maribu
Copy link
Member Author

maribu commented Oct 15, 2019

@smlng: All green :-)

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 CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants