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

docker: don't export KCONFIG_ADD_CONFIG variable #17993

Merged

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Apr 24, 2022

Contribution description

When using TEST_KCONFIG=1 along with BUILD_IN_DOCKER=1 to build some test applications, the builds fails with this kind of error (here with tests/shell):

make: *** No rule to make target '/work/riot/RIOT/tests/test_utils.config', needed by '/data/riotbuild/riotbase/tests/shell/bin/native/generated/out.config'

This PR fixes the problem by using the docker path to tests_utils.config when using BUILD_IN_DOCKER=1.

I don't know if that's the better fix but that works.

Testing procedure

Run TEST_KCONFIG=1 BUILD_IN_DOCKER=1 make -C tests/shell --no-print-directory

On master, you would get this:

TEST_KCONFIG=1 BUILD_IN_DOCKER=1 make -C tests/shell --no-print-directory 
=== [ATTENTION] Testing Kconfig dependency modelling ===
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -v '/home/aabadie/.cargo/registry:/data/riotbuild/.cargo/registry:delegated' -v '/home/aabadie/.cargo/git:/data/riotbuild/.cargo/git:delegated' -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'      -e 'TEST_KCONFIG=1' -e 'DISABLE_MODULE=' -e 'DEFAULT_MODULE=test_utils_interactive_sync test_utils_print_stack_usage' -e 'FEATURES_REQUIRED=' -e 'FEATURES_BLACKLIST=' -e 'FEATURES_OPTIONAL=' -e 'USEMODULE=app_metadata ps shell shell_commands' -e 'USEPKG=' -e 'KCONFIG_ADD_CONFIG=/work/riot/RIOT/tests/test_utils.config'  -w '/data/riotbuild/riotbase/tests/shell/' 'riot/riotbuild:latest' make     
=== [ATTENTION] Testing Kconfig dependency modelling ===
make: *** No rule to make target '/work/riot/RIOT/tests/test_utils.config', needed by '/data/riotbuild/riotbase/tests/shell/bin/native/generated/out.config'.  Stop.
make: *** [/work/riot/RIOT/makefiles/docker.inc.mk:350: ..in-docker-container] Error 2

With this PR, it builds fine:

TEST_KCONFIG=1 BUILD_IN_DOCKER=1 make -C tests/shell --no-print-directory 
=== [ATTENTION] Testing Kconfig dependency modelling ===
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -v '/home/aabadie/.cargo/registry:/data/riotbuild/.cargo/registry:delegated' -v '/home/aabadie/.cargo/git:/data/riotbuild/.cargo/git:delegated' -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'      -e 'TEST_KCONFIG=1' -e 'DISABLE_MODULE=' -e 'DEFAULT_MODULE=test_utils_interactive_sync test_utils_print_stack_usage' -e 'FEATURES_REQUIRED=' -e 'FEATURES_BLACKLIST=' -e 'FEATURES_OPTIONAL=' -e 'USEMODULE=app_metadata ps shell shell_commands' -e 'USEPKG=' -e 'KCONFIG_ADD_CONFIG=/data/riotbuild/riotbase/tests/test_utils.config'  -w '/data/riotbuild/riotbase/tests/shell/' 'riot/riotbuild:latest' make     
=== [ATTENTION] Testing Kconfig dependency modelling ===
Building application "tests_shell" for "native" with MCU "native".

"make" -C /data/riotbuild/riotbase/boards/common/init
"make" -C /data/riotbuild/riotbase/boards/native
"make" -C /data/riotbuild/riotbase/boards/native/drivers
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/core/lib
"make" -C /data/riotbuild/riotbase/cpu/native
"make" -C /data/riotbuild/riotbase/cpu/native/periph
"make" -C /data/riotbuild/riotbase/cpu/native/stdio_native
"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/app_metadata
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/ps
"make" -C /data/riotbuild/riotbase/sys/shell
"make" -C /data/riotbuild/riotbase/sys/shell/commands
"make" -C /data/riotbuild/riotbase/sys/test_utils/interactive_sync
"make" -C /data/riotbuild/riotbase/sys/test_utils/print_stack_usage
   text	   data	    bss	    dec	    hex	filename
  25189	   5370	  47764	  78323	  131f3	/data/riotbuild/riotbase/tests/shell/bin/native/tests_shell.elf

Issues/PRs references

Found in #17992 when trying to build some cpp test application for esp32 with both TEST_KCONFIG and BUILD_IN_DOCKER enabled (I don't have the esp32 toolchain installed on my machine).

@aabadie aabadie added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Apr 24, 2022
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Apr 24, 2022
@aabadie aabadie added the Area: Kconfig Area: Kconfig integration label Apr 24, 2022
@fjmolinas
Copy link
Contributor

Well, this is another thing that wasn't caught in #17396, exporting this variable always prevents the usual remapping from RIOTBASE->DOCKER_RIOTBASE to take place. I think the first way of addressing it is simply removing it from the list of exports https://github.com/fjmolinas/RIOT/blob/be7b8179d0a10680fda5d87b4a10697391a02777/makefiles/docker.inc.mk#L90.

To properly fix it we would need to capture those KCONFIG_ADD_CONFIG and overwrite the path definitions for all mapping inside RIOT, and the same for those outside of RIOT. I don't have time to take a look at this now, so unless someone else wants to do that, I would simply remove it from the list of exports.

But I'm also getting another issue:

/data/riotbuild/riotbase/dist/tools/fixdep/fixdep: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /data/riotbuild/riotbase/dist/tools/fixdep/fixdep)

@aabadie
Copy link
Contributor Author

aabadie commented Apr 25, 2022

I'm also getting another issue

Do you have this issue when removing TEST_KCONFIG from the exported variables ?

@fjmolinas
Copy link
Contributor

I'm also getting another issue

Do you have this issue when removing TEST_KCONFIG from the exported variables ?

Yes but I think its unrelated to this PR

@aabadie aabadie force-pushed the pr/tests/kconfig_with_build_in_docker branch from 6aeac57 to 6e69943 Compare April 25, 2022 08:40
@github-actions github-actions bot added Area: build system Area: Build system and removed Area: Kconfig Area: Kconfig integration labels Apr 25, 2022
@aabadie
Copy link
Contributor Author

aabadie commented Apr 25, 2022

Thanks @fjmolinas ! Dropping KCONFIG_ADD_CONFIG from the always exported vars also fixes the issue. I don't have the libc version error with this change.

@aabadie aabadie changed the title tests: fix test_utils.config path when using BUILD_IN_DOCKER docker: don't export KCONFIG_ADD_CONFIG variable Apr 25, 2022
@aabadie
Copy link
Contributor Author

aabadie commented Apr 25, 2022

I pushed that change in replacement of the previous version and updated the PR title.

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

ACK

@aabadie aabadie force-pushed the pr/tests/kconfig_with_build_in_docker branch from 6e69943 to 23b393e Compare April 25, 2022 09:18
@github-actions github-actions bot removed the Area: tests Area: tests and testing framework label Apr 25, 2022
@fjmolinas fjmolinas enabled auto-merge April 25, 2022 09:57
@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 26, 2022
@fjmolinas fjmolinas merged commit ea400a4 into RIOT-OS:master Apr 26, 2022
@aabadie aabadie deleted the pr/tests/kconfig_with_build_in_docker branch April 27, 2022 07:31
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 2022
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: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants