fix user group setting for git-cache-rs, add documentation#266
Merged
Conversation
Contributor
Author
|
Instead of modifying the call, you can also set BUILD_IN_DOCKER=1 DOCKER_IMAGE=f610ef8e4bbd DOCKER_USER=$(id -u):$(id -g) BOARD=nrf52840dk make -C tests/sys/shell |
Contributor
I guess this would need a matching PR in RIOT so that the group is automatically set when BUILD_IN_DOCKER=1? |
Contributor
Author
Absolutely, but I come prepared RIOT-OS/RIOT#22212 :D |
mguetschow
reviewed
May 11, 2026
mguetschow
reviewed
May 11, 2026
Contributor
mguetschow
left a comment
There was a problem hiding this comment.
Great documentation, thanks a lot! Just some minor comments again.
git-cache-rsgit-cache-rs, add documentation
Contributor
Author
|
Thank you for the review :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the user group of the user in the Docker container is set to
0=root. This leads to issues when the Docker container commands are accessing outside files, such as the gitcache because the user groups mismatch andgit-cache-rswill refetch the files.Adding the ID to the docker call will lead to an error message about permissions of
create_user:The first reason for this is that the
chmodsettings inriotdocker-base/Dockerfiledid not allow users from other groups (riotbuild!=root) to execute the command.The second reason is that the user group did not exist yet.
The third reason is that
useraddcreated a system user, which is always in therootgroup AND it explicitly set the group to0=root.Perhaps @kaspar030 remembers why, but I don't see an advantage here.
Testing
To test this locally, you have to build
riotdocker-basefirst:Then you have to build
static-test-tools:Then you have to build
riotbuild:Then you can get the Image ID:
And build your favorite application:
You should see that it clones the repos and the directories in your
.gitcachefolder belong to therootgroup:Now delete the
RIOT/builddirectory and the archives in.gitcache.What we're really interested here is the docker call only, and we modify the
--usercommand to--user $(id -u):$(id -g):You should see now that
git-cache-rsre-fetches the archives and they belong to the correct group now: