From d2b9b4ce8c3d5c27b95ef1276c4bc201ff8165eb Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Thu, 27 Jan 2022 14:56:00 +0100 Subject: [PATCH] Makefile.include: pass IOTLAB_NODE to docker 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. --- .github/workflows/test-on-iotlab.yml | 4 ---- Makefile.include | 11 +++++++++++ makefiles/docker.inc.mk | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-on-iotlab.yml b/.github/workflows/test-on-iotlab.yml index fc5f90cc93..f45d159001 100644 --- a/.github/workflows/test-on-iotlab.yml +++ b/.github/workflows/test-on-iotlab.yml @@ -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 diff --git a/Makefile.include b/Makefile.include index a91c125ecc..97810cece7 100644 --- a/Makefile.include +++ b/Makefile.include @@ -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 diff --git a/makefiles/docker.inc.mk b/makefiles/docker.inc.mk index cfa6cc7c4e..c32a244993 100644 --- a/makefiles/docker.inc.mk +++ b/makefiles/docker.inc.mk @@ -47,6 +47,7 @@ export DOCKER_ENV_VARS += \ ELFFILE \ HEXFILE \ FLASHFILE \ + IOTLAB_NODE \ LINK \ LINKFLAGPREFIX \ LINKFLAGS \