makefiles/docker: fix mounting localtime on OSX#10568
makefiles/docker: fix mounting localtime on OSX#10568jcarrano merged 1 commit intoRIOT-OS:masterfrom
Conversation
|
Is this an alternative to #10564 ? (or a duplicate ?) |
|
its a duplicate in a way ... at least I was slower in opening the PR here. I worked on it today and found a solution, made a branch in RIOT and posted the solution in the respective issue at docker/for-mac but haven't opened the PR right away. Seems like @jthacker was quicker with the PR ... though I find my solution with the variable cleaner. Anyway, we can close this one I guess. |
makefiles/docker.inc.mk
Outdated
| DOCKER_VOLUMES_AND_ENV += $(if $(_is_git_worktree),-v $(GIT_WORKTREE_COMMONDIR):$(GIT_WORKTREE_COMMONDIR)) | ||
|
|
||
| # Resolve symlink of /etc/localtime to its real path | ||
| ETC_LOCALTIME := $(shell realpath /etc/localtime) |
There was a problem hiding this comment.
There is no need for immediate assignment here
| ETC_LOCALTIME := $(shell realpath /etc/localtime) | |
| ETC_LOCALTIME = $(shell realpath /etc/localtime) |
There was a problem hiding this comment.
I think here simply the $(realpath function can be used as it should resolve symlinks.
|
Question here, there were many PRs before, to not use |
|
@cladmi you're right, but the other problem is though So we need to distinguish between OS here, I'd say. |
|
To really solve this once and for all RIOT needs a proper system init, that is: check the OS and lookup all the tools and stuff and set ENV accordingly. |
|
Does make's inbuilt realpath work for this? Also, the question here is, did you have to install |
|
It does not break anything on linux, squash and let's move forward. |
|
Funny to see that except the variable, after reviews this PR is now proposing the same fix as in #10564. |
|
@aabadie it was mainly about the variable from the beginning, but still you're |
Mounting `/etc/localtime` directly does not work on macOS (anymore). However, by resolving the symlink to its real path docker can handle the mount.
|
[the variable] and documentation |
True, even the PR/commit title was nicer in the other one. Anyways, this is not a competition to see who gets his fix first, it is about getting fixes done, I'm sure @jthacker will be happy that the issue is solved, whoever authors the patch is secondary. |
jcarrano
left a comment
There was a problem hiding this comment.
I tested it does not break Linux. The only possible drawback of this is that now the (very approximate) location of the user is printed on the command line and therefore in build logs.
Copied solution from: RIOT-OS/RIOT#10568 Signed-off-by: Luke Mondy <[email protected]>
Copied solution from: RIOT-OS/RIOT#10568 Signed-off-by: Luke Mondy <[email protected]>
Copied solution from: RIOT-OS/RIOT#10568 Signed-off-by: Luke Mondy <[email protected]>
Copied solution from: RIOT-OS/RIOT#10568 Signed-off-by: Luke Mondy <[email protected]>
Copied solution from: RIOT-OS/RIOT#10568 Signed-off-by: Luke Mondy <[email protected]>
Contribution description
Mounting
/etc/localtimedirectly does not work on macOS (anymore).However, by resolving the symlink to its real path docker can handle
the mount on macOS again - should also work with Linux.
Testing procedure
Try to run
BUILD_IN_DOCKER=1 make -C tests/minimalon macOS, which will fail with one or the other error regarding either that/etcis not shared and hence not accessible by docker, or if you do add it to the list of shared folders, it will fail with mounting/etc/localtimeinto docker. With this PR it works again.Issues/PRs references
Fixes #10287.