-
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
makefiles/buildtest: always execute 'buildtest' loop on host machine #11857
Conversation
Does build time increase in a significant way because docker is started per compilation? |
It does indeed increase I will do a measure on my machine. However, if not changing it because of execution time, I would see it as a "disable test as it takes more time". |
The time increase is indeed significant. It changes from 10 to 20 minutes for Should it be split in two different targets? So |
There is something I don't quite understand here, why should building in |
It MUST not use the host toolchain. That is why when testing building with However, the Lines 460 to 467 in 950b83e
But some applications, are currently handled in a way that the build system still executes targets outside of this handling:
Consequence on
|
BOARD=$${board} RIOT_CI_BUILD=1 RIOT_VERSION_OVERRIDE=buildtest \ | |
$(MAKE) clean all -j $(NPROC) $(BUILDTEST_MAKE_REDIRECT); \ |
is executed from inside the container, so without BUILD_IN_DOCKER=1
.
Because of this, it never uses the handling in Makefile.include
directly on your machine.
And this hides the issues you would have when doing BUILD_IN_DOCKER=1 make all
and that I would like to have visible.
@cladmi Ok now I understand the issue correctly.
+1 for this approach, all tough I would rename it to |
Murdock is not using the It is only during release, or developers on their machine that would run Good for |
PR needs squashing. |
The testing prodecures from the first post are still valid and get the same output. The new
|
cad1233
to
75ea03c
Compare
I rebased now that #11083 was merged and updated the testing procedure in the PR description to use |
Verified test procedure. master: BUILDTEST_MAKE_REDIRECT= BUILD_IN_DOCKER=1 BOARDS='native samr21-xpro' make --no-print-directory -C examples/default buildtest
PR: BUILDTEST_MAKE_REDIRECT= BUILD_IN_DOCKER=1 BOARDS='native samr21-xpro' make --no-print-directory -C examples/default buildtest
master:BOARDS="iotlab-m3 samr21-xpro" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/riotboot buildtest
PR:BOARDS="iotlab-m3 samr21-xpro" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/riotboot buildtest
PR:BOARDS="iotlab-m3 samr21-xpro" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/riotboot buildtest-indocker
|
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.
I agree with the changes this PR introduces, it exposes issues when building in docker while allowing to keep the same behavior as before when using the buildtest-target
. I was able to reproduce the test procedure correctly for the case that exposed the issue in #11842. ACK, please squash.
Add a 'buildtest-indocker' that forces executing 'buildtest' for loop completely inside the container. It prevents starting one container per compilation wich is slower but it could hide errors where the host toolchain would be used It is currently equivalent to `buildtest` but will change when the `buidtest` handling will be move outside of `BUILD_IN_DOCKER`. Display an error when executed without BUILD_IN_DOCKER=1.
This remove executing buildtest `for` loop in docker. When building completely in docker, 'buildtest' would hide issues when the host toolchain would be used when doing `make all` directly. It has the consequence that it now starts a container for each compilation which is slower. The previous behavior can be reproduced by using BUILD_IN_DOCKER=1 make buildtest-indocker A side effect is also that now `BUILDTEST_MAKE_REDIRECT` would work when doing `buildtest` with docker.
75ea03c
to
7d10da8
Compare
I squashed the commits and commit message. |
All green, GO! |
Thank you for the review! :) |
Contribution description
This remove executing buildtest
for
loop in docker.When building completely in docker, 'buildtest' would hide issues when
the host toolchain would be used when doing
make all
directly.A side effect is also that now
BUILDTEST_MAKE_REDIRECT
would work whendoing
buildtest
with docker.This also now removes passing
BOARDS
as it was added and needed onlyfor 'buildtest', and should work without the specific handling. #11385
The side effect is that now one
docker
instance should be started per compilation but makes it more consistent with doingBUILD_IN_DOCKER=1 BOARD=board_name make
for each board.Testing procedure
I locally used
DOCKER="sudo docker"
but did not include it in the tests commands displayed below.Normal buildtest uses
Running
buildtest
withBUILD_IN_DOCKER=1
still works.BOARDS
can still be limited:When setting
BUILDTEST_MAKE_REDIRECT=
in the environment it will be taken into accountBUILDTEST_MAKE_REDIRECT= BUILD_IN_DOCKER=1 BOARDS='native samr21-xpro' make --no-print-directory -C examples/default buildtest
In master it was showing the
docker
command first to runbuildtest
nowall
is run withdocker
for each board.Master:
BUILDTEST_MAKE_REDIRECT= BUILD_IN_DOCKER=1 BOARDS='native samr21-xpro' make --no-print-directory -C examples/hello-world/ buildtest
Removes errors hiding
Use a PATH where you do not have
arm-none-eabi-gcc
It now correctly fails with
buildtest
withBUILD_IN_DOCKER=1
as the host toolchain is used by that application.BOARDS="iotlab-m3 samr21-xpro" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/riotboot buildtest
When it was hiding the error and correctly compiling in
master
DOCKER="sudo docker" BOARDS="iotlab-m3 samr21-xpro" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/riotboot buildtest
and also hiding the error and correctly compiling in with
buildtest-indocker
.
``` BOARDS="iotlab-m3 samr21-xpro" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/riotboot buildtest-indocker make: Entering directory '/home/harter/work/git/RIOT/tests/riotboot' Launching build container using image "riot/riotbuild:latest". mkdir -p /home/harter/work/git/RIOT/build sudo docker run --rm -t -u "$(id -u)" \ -v '/usr/share/zoneinfo/Europe/Berlin:/etc/localtime:ro' -v '/home/harter/work/git/RIOT:/data/riotbuild/riotbase' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles' -v /home/harter/.gitcache:/data/riotbuild/gitcache -e GIT_CACHE_DIR=/data/riotbuild/gitcache \ -e 'BOARDS=iotlab-m3 samr21-xpro' \ -w '/data/riotbuild/riotbase/tests/riotboot/' \ 'riot/riotbuild:latest' make buildtest-indocker Building for iotlab-m3 ... success. Building for samr21-xpro ... success. make: Leaving directory '/home/harter/work/git/RIOT/tests/riotboot' ```BOARDS="iotlab-m3 samr21-xpro" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/riotboot buildtest-indocker
mcuboot is now working since https://github.com//pull/11083
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 BUILDTEST_MAKE_REDIRECT='>/dev/null' make -C tests/mcuboot/ buildtest
When it was hiding the error and correctly compiling in
master
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin BUILD_IN_DOCKER=1 make -C tests/mcuboot/ buildtest
Issues/PRs references
Found that
BUILD_IN_DOCKER=1 make buildtest
was hiding expected errors during 2019.07-RC1 testing RIOT-OS/Release-Specs#128 (comment)Fixes #11842