1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

61 Commits

Author SHA1 Message Date
Marian Buschsieweke
ca15b1e1f8
tools/mspdebug: fix make debug and make debugserver
The semantics of `make debug` and `make debugserver` have changed in
the years since the MSP430 integration. This brings the implementation
back into line with the current semantics

- `make debug` now starts both mspdebug and GDB, no need to
  run `make debugserver` prior to `make debug` anymore
- `make debug` no longer flashes the target to not waste flash erase
  cycles
- GDB mutliarch support is added
- support for selecting a debug adapter by its serial is added
2023-05-24 17:00:38 +02:00
Kees Bakker
83902ccce0 makefiles/docker.inc.mk: add support for podman
If podman is used for a docker build then use "--userns keep-id" instead
of "--user $(id -u)".
2022-09-29 20:59:42 +02:00
Kees Bakker
234a6df95a makefiles/docker.inc.mk: use registry docker.io explicitly
When using podman instead of docker the registry is not set by default.
Docker has a builtin registry default "docker.io". Podman does not have a
default. By specifying the registry explicitly both tools can be used.
2022-09-28 22:49:07 +02:00
23b393e784
docker: don't export KCONFIG_ADD_CONFIG variable 2022-04-25 11:18:17 +02:00
Francisco Molina
8b532e8fb6 makefiles/docker.ink.mk: do not always pass CFLAGS to docker 2022-03-17 10:10:45 +01:00
Francisco Molina
be7b8179d0 makefiles/docker.inc.mk: add DOCKER_ENV_VARS_ALWAYS
This adds a list of variables that should always be passed to docker
since they are commonly set in Makefile/Makefile.include and therefore
can not be checked for their origin.
2022-02-10 13:27:01 +01:00
6371051bc3
Merge pull request #17545 from fjmolinas/pr_iotlab_node_docker_riotci_build
Makefile.include: pass IOTLAB_NODE to docker
2022-01-27 20:20:03 +01:00
Francisco Molina
d2b9b4ce8c 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.
2022-01-27 14:56:00 +01:00
chrysn
210ad505aa makefiles: Reuse some of Rust's ~/.cargo in Docker container
Without passing this through, any crate downloads would go to the
container's image's scratch space, to be re-downloaded for each build,
and with new time stamps that cause compilation to start anew as well.
2022-01-14 14:59:04 +01:00
Francisco Molina
69d82777e2 makefiles/docker.inc.mk: pass TEST_KCONFIG 2021-12-14 20:23:55 +01:00
chrysn
2219a7a2e3 docker: pass CONTINUE_ON_EXPECTED_ERRORS into container 2021-10-01 15:46:45 +02:00
Martine Lenders
ea8e632eda
Merge pull request #16765 from benpicco/RIOT_VERSION_CODE
build system: add machine-readable RIOT_VERSION_CODE macro
2021-09-22 12:47:35 +02:00
Benjamin Valentin
7ef2594327 core/include/kernel_defines.h: add RIOT_VERSION_NUM macro 2021-09-21 17:43:29 +02:00
Dylan Laduranty
c6b6c71a42 makefiles/docker.inc.mk: pass PARTICLE_MONOFIRMWARE to docker env vars
This will allow the generation of the bin-checksummed file needed by dfu-util flashtool and thus allow to flash the all particle-based board with RUN_IN_DOCKER=1
2021-09-15 15:45:05 +02:00
Francisco Molina
c636a6501c
makefiles/docker.inc.mk: use version_is_greater_or_equal for jobs check 2021-01-18 14:38:47 +01:00
f2a719ba3c
docker: pass number of jobs from MAKEFLAGS to the container 2021-01-18 13:41:35 +01:00
Leandro Lanzieri
81cb769cad
makefiles: avoid building archives when compiling 2020-09-04 15:01:10 +02:00
c5079270c9 docker: Add picolibc build flag 2020-08-24 08:26:16 -07:00
Cenk Gündoğan
7aa499d5f1 make: use $(MAKE) instead of direct make call 2020-07-03 12:03:06 +02:00
36a80a14be
Merge pull request #13678 from fjmolinas/pr_docker_run_make
makefiles/docker.inc.mk: add and use generic docker_run_make
2020-05-05 16:46:10 +02:00
Francisco Molina
7c528c7ecd
makefiles/docker.inc.mk: add and use generic docker_run_make
DOCKER_MAKE_ARGS only hold additional make args like '-j'
2020-05-05 14:41:13 +02:00
Marian Buschsieweke
ba7815163c
Makefile*: Allow multiple external board dirs
- Add the new EXTERNAL_BOARD_DIRS variable that can contain a space separated
  list of folders containing external boards
- Introduce $(BOARDDIR) as shortcut for $(BOARDSDIR)/$(BOARD)
- Map the existing BOARDSDIR to the new approach
    - If BOARDSDIR is provided by the user, it will be added to
      EXTERNAL_BOARD_DIRS for backward compatibility. (And a warning is issued
      to encourage users migrating to EXTRA_BOARDS.)
    - BOARDSDIR is updated after the board is found to "$(BOARDDIR)/..".
        - Useful for `include $(BOARDSDIR)/common/external_common/Makefile.dep`
        - Provides backward compatibility
2020-04-29 18:32:39 +02:00
Gaëtan Harter
c26710ac7e
makefiles/docker: handle mounting 'BOARDSDIR'
Handle setting 'BOARDSDIR' when building in docker.
2019-12-16 15:35:04 +01:00
Lars Eggert
cae814c1cb make: docker: Delegate bind mounts to the containers
At least on Docker for Mac, this brings a huge boost in build performance, see
https://docs.docker.com/docker-for-mac/osxfs-caching/:

Before: `real	6m23.003s`
After:  `real	1m57.923s`
2019-09-24 12:04:43 +02:00
Gaëtan Harter
49a78bad0d
makefiles/docker.inc.mk: use 'docker_volume' function
Use 'docker_volume' function for mounting.

When mounting 'localtime' this will only use the 'ro' option and
ignore 'DOCKER_VOLUME_OPTIONS'.
2019-09-16 11:16:14 +02:00
Gaëtan Harter
e5032a611b
makefiles/docker.inc.mk: add a 'docker_volume' function
Refactor the '--volume' mounting handling.
This prepares for using a global 'DOCKER_VOLUME_OPTIONS'.
2019-09-16 11:16:14 +02:00
Gaëtan Harter
d832d78756
makefiles/docker.inc.mk: always use quotes around -e and -v options
Harmonize the '--volumes' and '--env' commands before factorizing them.
Remove extra 'space'.
2019-09-16 11:15:20 +02:00
benpicco
65b7102608
Merge pull request #10195 from jcarrano/thin-archives
Makefile.base: use thin static archives.
2019-09-15 13:04:25 +02:00
Gaëtan Harter
971b1acdb2
makefiles/docker.inc.mk: add PROGRAMMER to the exported variables
Depending on the PROGRAMMER used, the file used for flashing may be
different, like openocd/jlink, so the file being generated when
compiling should be different.

Because of this, when building in docker, the build system needs to know
for which programmer you are building for.

This manifested for 'nordic_softdevice' applications when using 'openocd'
but is not limited to this case.
2019-09-12 12:38:31 +02:00
Juan Carrano
d9132eec90 Makefile.include: add rule to verify thin archives.
This adds a new target "archive-check".

Thin archives should be created with relative paths so that archives created
in a build container are useful in the host. This check ensures there are no
absolute paths inside thin archives.
2019-09-10 11:21:42 +02:00
Gaëtan Harter
e1357c1499
makefiles/docker.inc.mk: allow disabling color in docker
When compiling with CC_NOCOLOR=1, color were still used when
printing during compilation with `BUILD_IN_DOCKER=1`.
2019-08-22 11:20:58 +02:00
Gaëtan Harter
89a92c551f
makefiles/docker.inc.mk: allow adding docker make arguments
Allow defining make arguments when called in docker.

It would be the same as adding to `DOCKER_OVERRIDE_CMDLINE` but have a
consistent naming.
2019-08-19 17:00:08 +02:00
Gaëtan Harter
8b90a51524
makefiles/docker.inc.mk: allow adding to docker ENV and OVERRIDE args
This allows passing other arguments as environment variables in
DOCKER_ENVIRONMENT_CMDLINE and as command line override in
DOCKER_OVERRIDE_CMDLINE without using the automatic detection.

This will allow passing USEMODULE to docker as its value is usually set
in an application Makefile so has its origin changed.
2019-08-19 16:59:46 +02:00
Gaëtan Harter
e83966c80f
makefiles/docker.inc.mk: allow setting DOCKER_ENV_VARS from environment
This allows setting other variables that should be exported to the
docker build.

As for other variables, they must still be unmodified before parsing
`docker.inc.mk` to be exported.
2019-08-19 16:46:22 +02:00
Gaëtan Harter
7d10da832a
makefiles/buildtest: always execute 'buildtest' loop on host machine
This remove executing buildtest `for` loop in docker.

When building completely in docker, 'buildtest' would hide issues when
the host toolchain would be used when doing `make all` directly.
It has the consequence that it now starts a container for each
compilation which is slower.

The previous behavior can be reproduced by using

    BUILD_IN_DOCKER=1 make buildtest-indocker

A side effect is also that now `BUILDTEST_MAKE_REDIRECT` would work when
doing `buildtest` with docker.
2019-08-14 17:02:34 +02:00
Gaëtan Harter
a048001e96
makefiles/buildtest: add a buildtest-indocker
Add a 'buildtest-indocker' that forces executing 'buildtest' for loop
completely inside the container.
It prevents starting one container per compilation wich is slower but
it could hide errors where the host toolchain would be used

It is currently equivalent to `buildtest` but will change when the
`buidtest` handling will be move outside of `BUILD_IN_DOCKER`.

Display an error when executed without BUILD_IN_DOCKER=1.
2019-08-14 17:02:35 +02:00
ca12999e2d makefiles/docker: export BOARDS
This enables "BUILD_IN_DOCKER=1 BOARDS='foo bar' make buildtest".
Without this line, when executed with BUILD_IN_DOCKER, "make buildtest"
would always build all boards.
2019-04-12 09:19:17 +02:00
Kevin "Bear Puncher" Weiss
e33e7bf159
Merge pull request #9646 from cladmi/pr/make/docker/fix_relative_build_directory
makefiles/docker.inc.mk: Use directories in RIOT when possible
2019-03-08 09:48:13 +01:00
Gaëtan Harter
1d268c4cdb
Makefile.include: introduce FLASHFILE
Introduce FLASHFILE variable to start migrating boards to use it.

This is the file that will be used for flashing.
Boards do not currently use it but will migrated in upcoming PRs.
2019-02-28 18:11:49 +01:00
cladmi
3a17ddc43c
makefiles/docker.inc.mk: add support for EXTERNAL_MODULE_DIRS
They are remapped to `$(DOCKER_BUILD_ROOT)/external` if they are not
inside RIOT (usually the case but not for `tests/external_modul_dirs`).

If they are inside 'riotproject' they are currently also remapped to
'external'.

The value of `EXTERNAL_MODULE_DIRS` is then enforced by configuring it on
the command line as the application should not try to set it anymore.

The remapping is done in `external/directory_name` so cannot handle
multiple external directories with the same name.
2019-02-28 15:13:35 +01:00
cladmi
8b54f87fc4
makefiles:docker.inc.mk: add a global documentation on directory mapping 2019-02-28 14:46:43 +01:00
cladmi
3c0ecebb2c
makefiles/docker.inc.mk: use more directories in RIOT
Use the directories from in RIOT if possible for RIOTCPU/RIOTBOARD/RIOTMAKE.
2019-02-28 14:46:43 +01:00
Gaëtan Harter
8687d53c82
makefiles/docker.inc.mk: use BUILD_DIR in RIOT if possible
Use BUILD_DIR from within the riot repository if it is inside.
2019-02-28 14:46:43 +01:00
Gaëtan Harter
a57f141cf6
makefiles/docker.inc.mk: use RIOTPROJECT in the RIOT if possible
Use RIOTPROJECT from within the riot repository if it is inside.

This means when it is the case to use:

 * Not mounting the directory to `riotproject`
 * Use `APPDIR` relative to inside RIOT

If it is not inside, do the same as before:

 * Mount the RIOTPROJECT to `riotproject`
 * Use `APPDIR` relative to RIOTPROJECT
2019-02-28 14:46:43 +01:00
cladmi
e59b77988d
makefiles/docker.inc.mk: add docker_volume_and_env
Add functions to get volume and env arguments for a given directory environment
variable.

It handles:

 * variables with multiple directories like EXTERNAL_MODULE_DIRS
 * relative path
 * if the 'directories' variable is empty, it will not be exported to docker
2019-02-28 14:46:43 +01:00
cladmi
8351b13cc3
makefiles/docker.inc.mk: add path_in_docker function
Return to which directory in the container this directory should be mapped.
2019-02-28 14:46:43 +01:00
cladmi
a462c4aeb9
makefiles/docker.inc.mk: change definition order
Update definition order for DOCKER_VOLUMES_AND_ENV.

* Localtime
* Mapping and env related to `RIOTBASE`
* Build directories
* Project
* CPU/BOARD/make
2019-02-28 14:46:43 +01:00
cladmi
e5871d9deb
makefiles/docker.inc.mk: use a variable for all volumes and environment 2019-02-28 14:46:27 +01:00
cladmi
378f9fd144
makefiles/docker.inc.mk: add DOCKER_APPDIR variable
Prepare for when it can have a different value.
2019-02-28 14:44:53 +01:00
cladmi
a0f25ed47b
makefiles/docker.inc.mk: add DOCKER_RIOTBASE variable
It represents the path of RIOTBASE inside the docker container.
2019-02-28 14:44:49 +01:00