-
Notifications
You must be signed in to change notification settings - Fork 2k
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
make: introduce common BUILD_DIR #10038
Conversation
I like. But let's wait for build system experts' opinion. |
Makefile.include
Outdated
BINDIRBASE ?= $(APPDIR)/bin | ||
BINDIR ?= $(BINDIRBASE)/$(BOARD) | ||
PKGDIRBASE ?= $(BINDIRBASE)/pkg/$(BOARD) | ||
BUILDOUT_DIR ?= $(APPDIR)/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more a reminder to my self for when the discussion on this is close to an end, so don't see this as instruction to act immediately: build/
needs to be added to / replace with *bin
in .gitignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good point! Please, remember for all of us 😉
that's the purpose of this PR, in parts I already talked about this with @cladmi - because we need a place to store test output+results, e.g. from HIL and so on, to they can be found and accessed more easily. |
f19e6ec
to
d166d89
Compare
I was more thinking about a The fact that the current Also changing it is a Build System API change so would require proper announcement. |
I think waaaaaay back |
If we start change the name of the I would replace it by a check it is an absolute path if the user really wants to set it himself. I would rather say, you can over |
That is why I want to still keep a per application I would like to be able to build all applications without cleaning, but I would like to not have 120 times the 190M of the u8g2 package. |
To explain a bit more my thought. I see two parts to this PR. Rename The second part you propose, is preparing this directory to be common between applications, by having the per I would prefer introduce a I think we would benefit more by separating it as early as possible to be able to put directly common things in it. |
I was also thinking to include the build commit hash ( |
anyway thanks for your comments @cladmi, I guess you're right and I also like the idea to have Also for packages I wasn't aware (sure) that some might might be build in an app depend way, so maybe it makes sense to checkout/clone/download the package source to |
d166d89
to
7465e89
Compare
Makefile.include
Outdated
BINDIRBASE ?= $(APPDIR)/bin | ||
BINDIR ?= $(BINDIRBASE)/$(BOARD) | ||
PKGDIRBASE ?= $(BINDIRBASE)/pkg/$(BOARD) | ||
BINDIRBASE ?= $(BUILDOUT_DIR)/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in the main comments, I think the ones currently in bin
should not been moved for the moment.
It is an API change I would not merge in the last weeks of a release.
Adding a new directory that needs to start being handled for new commands is ok.
The internal organization of this directory will also need some thinking.
Also, there is still some work to make this correctly handled by docker
if it is set outside of RIOT. This could help #9646
No idea what the scan-build
does.
I would even add more hierarchy, why building in the 'source' part of the Choosing these directory hierarchy should also be a task on itself and I would like to discuss and propose some rough idea of a plan for review by the rest of the community. |
7465e89
to
0c63455
Compare
@cladmi I reduced this to simply introducing a |
@cladmi any comments, it should be non-intrusive now but I'd like to have it in place for #10095 One thing I was thinking about was to add the current commit hash ( [add] which could be handy for CI and testing |
b70c936
to
d625b57
Compare
This introduces a new environment variable for a common directory that holds all output of the build process, such as application or package binaries. This would also allow to easily redirect output to any other location, e.g. for out-of-source builds.
The 'build' directory should not be tracked by git.
The 'build' directory should be created before starting docker. If not it will be created as root. Also add mapping for the directory in docker. Currently create the directory in the target until there is a directory creation target.
6158d57
to
ed17986
Compare
@cladmi integrated your PR, rebased and squashed |
to recap after all those changes back and forth, this PR only introduces a new directory it does not change any existing directories or where things are build and so on. This is only a first step to prepare such things, but also to have a common directory to put test results, i.e. produces by robot framework see related PRs |
@cladmi ping? |
Changes look good to me. |
Let me just re-test quickly. Question, do you have any plans/doc for the internal organization of the directory? Because I see many different usages for this one, like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, the test from cladmi@cfb0889 still works. The directory is correctly ignored.
Until the internal organization is documented/specified, I will assume the filesystem organization is not an API and can change anytime.
Just re-running murdock with the last master. |
@cladmi: as of now my immediate use case is to store HIL test results of the RobotFramework and therefore I currently was thinking of the following structure: |
@smlng at least I would prefer |
I will open an issue/PR for discussing an organization inside. |
I noticed an issue, I forgot to grep for
I will do a PR to rename it. |
Contribution description
This introduces a new environment variable for a common directory
that holds all output of the build process, such as application or
package binaries. This would also allow to easily redirect output
to any other location, e.g. for out-of-source builds.
The 2nd commit adds abuild
directory with subdirsbuild/bin
andbuild/pkg
. In the (near) future we might add something likebuild/tests
to store test results.The 3rd commit adds the APPLICATION name as a subdirectory to the bin output folder, this is similar to the pkg subdirectory hierarchy and will also allow to build multiple application in one out-of-source build directory (in the future).Testing procedure
Everything should still build as usual.
However, as some directories changed (see above) it might break somethingIssues/PRs references