Skip to content

Conversation

@cladmi
Copy link
Contributor

@cladmi cladmi commented Sep 6, 2018

Contribution description

The variable was not given to docker before and as it is setting
'RIOT_VERSION_OVERRIDE=buildtest' it helps testing in docker more
consistently.

Testing procedure

Compile any example in docker with RIOT_CI_BUILD=1

make BUILD_IN_DOCKER=1 DOCKER="sudo docker" -C examples/hello-world RIOT_CI_BUILD=1

In master you get a verbose output with nothing after the docker make command:

make: Entering directory '/home/harter/work/git/RIOT/examples/hello-world'
Launching build container using image "riot/riotbuild:latest".
sudo docker run --rm -t -u "$(id -u)" \
    -v '/home/harter/work/git/RIOT:/data/riotbuild/riotbase' \
    -v '/home/harter/work/git/RIOT/cpu:/data/riotbuild/riotcpu' \
    -v '/home/harter/work/git/RIOT/boards:/data/riotbuild/riotboard' \
    -v '/home/harter/work/git/RIOT/makefiles:/data/riotbuild/riotmake' \
    -v '/home/harter/work/git/RIOT:/data/riotbuild/riotproject' \
    -v /etc/localtime:/etc/localtime:ro \
    -e 'RIOTBASE=/data/riotbuild/riotbase' \
    -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' \
    -e 'RIOTCPU=/data/riotbuild/riotcpu' \
    -e 'RIOTBOARD=/data/riotbuild/riotboard' \
    -e 'RIOTMAKE=/data/riotbuild/riotmake' \
    -e 'RIOTPROJECT=/data/riotbuild/riotproject' \
     \
    -w '/data/riotbuild/riotproject/examples/hello-world/' \
    'riot/riotbuild:latest' make  
Building application "hello-world" for "native" with MCU "native".

"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotboard/native
"make" -C /data/riotbuild/riotboard/native/drivers
"make" -C /data/riotbuild/riotcpu/native
"make" -C /data/riotbuild/riotcpu/native/periph
"make" -C /data/riotbuild/riotcpu/native/vfs
   text	   data	    bss	    dec	    hex	filename
  20641	    372	  47684	  68697	  10c59	/data/riotbuild/riotproject/examples/hello-world/bin/native/hello-world.elf
make: Leaving directory '/home/harter/work/git/RIOT/examples/hello-world'

And also the version is not overridden by buildtest:

grep 'define RIOT_VERSION' examples/hello-world/bin/native/riotbuild/riotbuild.h
#define RIOT_VERSION "2018.10-devel-734-gf0cf15-4af85705df7a-HEAD"

With this PR you get the more quiet output with make 'RIOT_CI_BUILD=1' docker command:

make: Entering directory '/home/harter/work/git/RIOT/examples/hello-world'
Launching build container using image "riot/riotbuild:latest".
sudo docker run --rm -t -u "$(id -u)" \
    -v '/home/harter/work/git/RIOT:/data/riotbuild/riotbase' \
    -v '/home/harter/work/git/RIOT/cpu:/data/riotbuild/riotcpu' \
    -v '/home/harter/work/git/RIOT/boards:/data/riotbuild/riotboard' \
    -v '/home/harter/work/git/RIOT/makefiles:/data/riotbuild/riotmake' \
    -v '/home/harter/work/git/RIOT:/data/riotbuild/riotproject' \
    -v /etc/localtime:/etc/localtime:ro \
    -e 'RIOTBASE=/data/riotbuild/riotbase' \
    -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' \
    -e 'RIOTCPU=/data/riotbuild/riotcpu' \
    -e 'RIOTBOARD=/data/riotbuild/riotboard' \
    -e 'RIOTMAKE=/data/riotbuild/riotmake' \
    -e 'RIOTPROJECT=/data/riotbuild/riotproject' \
    -e 'RIOT_CI_BUILD=1' \
    -w '/data/riotbuild/riotproject/examples/hello-world/' \
    'riot/riotbuild:latest' make  'RIOT_CI_BUILD=1'
Building application "hello-world" for "native" with MCU "native".

   text	   data	    bss	    dec	    hex	filename
  20609	    372	  47684	  68665	  10c39	/data/riotbuild/riotproject/examples/hello-world/bin/native/hello-world.elf
make: Leaving directory '/home/harter/work/git/RIOT/examples/hello-world'

And the version is correctly overridden:

grep 'define RIOT_VERSION' examples/hello-world/bin/native/riotbuild/riotbuild.h
#define RIOT_VERSION "buildtest"

Issues/PRs references

Found while working on our docker integration:

#9645
#9646

The variable was not given to docker before and as it is setting
'RIOT_VERSION_OVERRIDE=buildtest' it helps testing in docker more
consistently.
@cladmi cladmi added Area: build system Area: Build system Area: toolchain Area: toolchains; everything related to compilation, libc, linking, … CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 6, 2018
@cladmi cladmi requested a review from jnohlgard September 6, 2018 15:17
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.

untested ACK.

@kaspar030 kaspar030 merged commit 8d1d509 into RIOT-OS:master Sep 6, 2018
@cladmi cladmi deleted the pr/docker/add_riot_ci_build branch September 7, 2018 14:16
@jia200x jia200x added this to the Release 2018.10 milestone Oct 4, 2018
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: toolchain Area: toolchains; everything related to compilation, libc, linking, … 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.

3 participants