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

30 Commits

Author SHA1 Message Date
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
cladmi
ed1798634b makefiles/docker.inc.mk: handle 'build' directory
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.
2019-01-07 21:16:36 +01:00
Juan I Carrano
d505b01d71
Merge pull request #10568 from smlng/pr/make/docker
makefiles/docker: fix mounting localtime on OSX
2018-12-07 15:52:17 +01:00
Sebastian Meiling
cae865e71e make/docker: adapt mount of localtime
Mounting `/etc/localtime` directly does not work on macOS (anymore).
However, by resolving the symlink to its real path docker can handle
the mount.
2018-12-07 14:00:19 +01:00
smlng
ae5608ab7f make: use abspath for worktree mount in docker 2018-12-05 20:28:12 +01:00
Gaëtan Harter
61a3e5d685
makefiles/docker.inc.mk: handle building in git worktree
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.
2018-10-30 19:21:12 +01:00
Gaëtan Harter
c60324744c
docker: Use system GIT_CACHE_DIR if available
If GIT_CACHE_DIR is a directory make it available to docker.
This will allow using the system git_cache also in the docker container.
2018-10-23 15:01:43 +02:00
Gaëtan Harter
eab9757d62
makefiles/docker.inc.mk: export RIOT_CI_BUILD to docker
The variable was not given to docker before and as it is setting
'RIOT_VERSION_OVERRIDE=buildtest' it helps testing in docker more
consistently.
2018-09-06 16:52:43 +02:00
Gaëtan Harter
e5c49aa486
makefiles/docker.inc.mk: allow overwriting 'docker' 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.
2018-07-26 14:30:39 +02:00
61f1b941ce make: replace curly braces with parenthesis 2018-03-22 20:43:15 +01:00
fd1b0bdea5 makefiles: docker: make docker call non-interactive
prevents "the input device is not a TTY"
2017-11-13 12:34:51 +01:00
Joakim Nohlgård
339a4da9dc Makefiles: move to new directory /makefiles 2017-04-04 15:11:54 +02:00