Skip to content

Commit

Permalink
Makefile.include: pass IOTLAB_NODE to docker
Browse files Browse the repository at this point in the history
By default if IoT-LAB Cli Tools V3 is used then BINFILE is used to
flash on IoT-LAB. But BINFILE is not built by default when RIOT_CI_BUILD
is set as a ci optimization.

But since before IOTLAB_NODE was not passed to docker when building it
did not know that it should BUILD BINFILE as well, which led to failures
if doing:

$ IOTLAB_NODE=iotlab-m3.grenoble.iot-lab.info BOARD=iotlab-m3 \
  RIOT_CI_BUILD=1 BUILD_IN_DOCKER=1 make -C examples/hello-world/ flash

But if IOTLAB_NODE is passed at is checks for IoT-LAB cli Tools also
happen in the docker container which leads to a make error since those
are not present in docker.

Therefore add BINFILE to BUILD_FILES if RIOT_CI_BUILD is set, but unset
IOTLAB_NODE once INSIDE_DOCKER.
  • Loading branch information
fjmolinas committed Jan 27, 2022
1 parent f22ba30 commit d2b9b4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test-on-iotlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ jobs:
env:
IOTLAB_NODE: auto
BUILD_IN_DOCKER: 1
# Force .bin files generation because these files are used to flash on IoT-LAB and
# because compile_and_test_for_board forces RIOT_CI_BUILD which skip .bin
# files generation
DOCKER_ENVIRONMENT_CMDLINE: -e BUILD_FILES=\$$\(BINFILE\)
COMPILE_AND_TEST_FOR_BOARD: ./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py
COMPILE_AND_TEST_ARGS: --with-test-only --jobs=2 --report-xml
# Exclude applications that are expected to fail or cannot run on iotlab
Expand Down
11 changes: 11 additions & 0 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,17 @@ ifneq (,$(IOTLAB_NODE))
PROGRAMMER ?= iotlab
# iotlab uses ELFFILE by default for flashing boards.
FLASHFILE ?= $(ELFFILE)
# RIOT_CI_BUILD disables the build of BINFILE which is required for flashing
# on IoT-LAB
ifeq (1,$(RIOT_CI_BUILD))
BUILD_FILES += $(BINFILE)
endif
# Disable IOTLAB_NODE if inside Docker to avoid including the
# iotlab.single.inc.mk file which is useless there: it's only useful for
# flashing and this is done outside of Docker.
ifeq (1,$(INSIDE_DOCKER))
IOTLAB_NODE :=
endif
endif

# Add standard include directories
Expand Down
1 change: 1 addition & 0 deletions makefiles/docker.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export DOCKER_ENV_VARS += \
ELFFILE \
HEXFILE \
FLASHFILE \
IOTLAB_NODE \
LINK \
LINKFLAGPREFIX \
LINKFLAGS \
Expand Down

0 comments on commit d2b9b4c

Please sign in to comment.