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

buildtest uses wrong build directory #9742

Open
cladmi opened this issue Aug 8, 2018 · 3 comments
Open

buildtest uses wrong build directory #9742

cladmi opened this issue Aug 8, 2018 · 3 comments
Assignees
Labels
Area: build system Area: Build system Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@cladmi
Copy link
Contributor

cladmi commented Aug 8, 2018

Description

When building using buildtest the build is not using the BOARD bin/$(BOARD) directory but the default BOARD defined in the application Makefile BOARD ?= native.

This also has consequences on dist/tools/compile_test/compile_test.py which is using buildtest.

EDIT: This only happens when setting variables on the command line as then the MAKEOVERRIDES from here are done even if these variables are not set.

MAKEOVERRIDES += $(foreach v,$(__DIRECTORY_VARIABLES),$(v)=$($(v)))

I think a solution is to only override variables which were set from the command line (by checking origin) before changing there value.

A better fix would be to never override but require variables to have been set absolute if set from the command line, (and maybe also environment) but it changes the behavior.

Steps to reproduce the issue

I am using #9741 to make it more visible during compilation but can be done without.

When building for iotlab-m3 the output is saved in bin/native.

$ git clean -xdff examples/hello-world

$ BOARDS=iotlab-m3 make -C examples/hello-world/ buildtest 'BUILDTEST_MAKE_REDIRECT='
...
Building application "hello-world" for "iotlab-m3" with MCU "stm32f1".

   text    data     bss     dec     hex filename
   8480     140    2740   11360    2c60 /home/harter/work/git/RIOT/examples/hello-world/bin/native/hello-world.elf

$ find examples/hello-world/bin/
examples/hello-world/bin/
examples/hello-world/bin/native
examples/hello-world/bin/native/hello-world.hex
examples/hello-world/bin/native/hello-world.elf
examples/hello-world/bin/native/hello-world.map

When running some compilations with buildtest I also sometime had strange issues with packages with native but was correct when build alone.
I think it is related to an issue with the package clean which was shown with this path collision.

Expected results

Building in bin/iotlab-m3

Actual results

Build in bin/native.

Versions

Ubuntu 16.04

@cladmi cladmi added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: build system Area: Build system labels Aug 8, 2018
@cladmi
Copy link
Contributor Author

cladmi commented Oct 24, 2018

More information on this one, the issue is only present when providing variable configuration from the command line.

@cladmi
Copy link
Contributor Author

cladmi commented Nov 19, 2018

What I should address is that directories are overridden only if necessary in this line:

MAKEOVERRIDES += $(foreach v,$(__DIRECTORY_VARIABLES),$(v)=$($(v)))

To not have different behavior when setting a variable on the command line.

@cladmi
Copy link
Contributor Author

cladmi commented Nov 19, 2018

@MrKevinWeiss this is the tracking issue of #9831

@fjmolinas fjmolinas self-assigned this Apr 25, 2020
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 22, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
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 Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

No branches or pull requests

6 participants