Skip to content

make: refactor info targets & cleanup buildtest#7589

Merged
kYc0o merged 3 commits intoRIOT-OS:masterfrom
kaspar030:fix_deps
Sep 14, 2017
Merged

make: refactor info targets & cleanup buildtest#7589
kYc0o merged 3 commits intoRIOT-OS:masterfrom
kaspar030:fix_deps

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 commented Sep 8, 2017

Previously, our build system mixed local targets (corresponding to one board, e.g., make all) and global targets (corresponding to all boards, e.g., make info-boards-supported).

Half of the build defines was set for $BOARD, and the dependencies were only parsed for one board.
This had several side effects, most notable:

  • make info-boards-supported could not take dependencies into account
  • make buildtest needed to reset most variables to sane values, which looked ugly

This PR essentially cuts the build parsing in two modes: a "build for one board" mode, which is the default, and a "global targets" mode, which is selected automatically if one of the "global" targets is in $(MAKECOMMANDGOALS).

The latter case now re-parses the dependencies for every board. That means if e.g., a driver has FEATURES_REQUIRED += xxx, that dependency gets properly handled for e.g., info-boards-supported. As a nice side effect, this is now almost twice as fast.

I took the liberty to remove a lot of now unnecessary cruft from buildtest.

Unfortunately all board Makefile.features now must include the CPU's Makefile.features, but the CPU is not known, thus it's name must be hard-coded in the include path. I consider this a minor uglyness compared to the vast cleanup this PR offers.

@kaspar030 kaspar030 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: build system Area: Build system labels Sep 8, 2017
@kaspar030 kaspar030 added this to the Release 2017.10 milestone Sep 8, 2017
@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 8, 2017
Copy link
Copy Markdown
Contributor

@haukepetersen haukepetersen left a comment

Choose a reason for hiding this comment

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

Awesome! On a first quick look the changes look valid to me, though I have not run any tests yet, so a further review is to be done...

@@ -1,6 +1,5 @@
# import list of provided features
-include $(RIOTBOARD)/$(BOARD)/Makefile.features
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wondering: with the boards Makefile.features now including the CPUs Makefile.features, shouldn't we force the existence of a Makefile.features for every board (-> removing the minus sign in this line)? As there might be features provided by a CPU that are not looked at in case a board does not provide a Makefile.features...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Had a brief look and saw some indentation issues.

Makefile.include Outdated
endif

ifeq (none,$(BOARD))
include $(RIOTMAKE)/info-global.inc.mk
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

indentation missing here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed


# include multislot support
include $(RIOTMAKE)/multislot.mk
endif # BOARD=none
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The indentation above seems off (not related to this PR though)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, it is. But I didn't want to indent the whole file (or most of it), so I intentionally didn't indent the "BOARD!=none" case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok

FEATURES_OPTIONAL_GLOBAL := $(FEATURES_OPTIONAL)
DISABLE_MODULE_GLOBAL := $(DISABLE_MODULE_GLOBAL)

define board_missing_features
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

indentation is off in this function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks fine here, all tabs. anything specific?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Before it was not indented this way. That's why I pointed this out. I don't know what's the best practice here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed it to two spaces

@miri64
Copy link
Copy Markdown
Member

miri64 commented Sep 13, 2017

Fixes #7033

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Tested with tests/driver_at86rf2xx and test/unittests. info-buildsizes does not put out the build sizes, just the boards, info-files misses all the non-Make files, info-features-missing has no output for tests/unittests.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Sep 13, 2017

(otherwise I'm fine with the changes and would approve, if pointed out errors are fixed).

@kaspar030
Copy link
Copy Markdown
Contributor Author

info-buildsizes does not put out the build sizes, just the boards

fixed.

info-files misses all the non-Make files, info-features-missing has no output for tests/unittests.

Both is also true for master...

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Alright then you get my ACK. @aabadie what about you?

Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Well, there are still indentation issues but that's fine.

ACK

@miri64
Copy link
Copy Markdown
Member

miri64 commented Sep 13, 2017

Well, there are still indentation issues but that's fine.

As far as I can see it, all your comments are addressed.

@kaspar030 please squash.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Sep 13, 2017

As far as I can see it, all your comments are addressed.

Yes, but I saw it in other places...

@kaspar030
Copy link
Copy Markdown
Contributor Author

@kYc0o found something not working on OS X (the color makefile parsing was moved before assignment of the OS variable, which broke OS X's special handling).

The fix is simple, but I think it needs a re-ack.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Sep 13, 2017

The fix is simple, but I think it needs a re-ack.

In theory I would ACK, but can't test that. @kYc0o?

@kYc0o
Copy link
Copy Markdown
Contributor

kYc0o commented Sep 14, 2017

@kaspar030 can you squash?

@kaspar030
Copy link
Copy Markdown
Contributor Author

squashed.

Copy link
Copy Markdown
Contributor

@kYc0o kYc0o left a comment

Choose a reason for hiding this comment

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

ACK. But I hope a PR fixing the feature check for all targets comes soon :)

@kYc0o
Copy link
Copy Markdown
Contributor

kYc0o commented Sep 14, 2017

Go!

@kYc0o kYc0o merged commit 46c132d into RIOT-OS:master Sep 14, 2017
@kaspar030 kaspar030 deleted the fix_deps branch September 14, 2017 11:41
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 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.

5 participants