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.
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.
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.
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.
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.
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.
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.
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
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
The 'build' directory should be created before starting docker.
If not it will be created as root.
Also add mapping for the directory in docker.
Currently create the directory in the target until there is a directory
creation target.
When building from a worktree, the common git directory was not mounted
in docker.
This lead to the version not being set and issues with git-cache in
ubuntu bionic that could not execute the 'git hash-object' command.
Not all users register their user in the docker group and should not run the
whole make process as root to use docker.
They can now overwrite DOCKER with `DOCKER="sudo docker"`.
Creating files as a user is correctly handled as `id -u` is still run as the
original user.