-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Podman Mounts Symlinks as Root #373
Comments
e.g. there should be an option to specify additional path mappings/mounts for docker. |
You can now use |
This doesn't reproduce anymore, but there are other issues: if there isn't various different binaries available, then it will fail. A simple example that works is: $ mkdir registry
$ export CARGO_HOME=$(realpath registry)/.cargo
$ export XARGO_HOME=$(realpath registry)/.xargo
$ ln -s ~/.cargo "${CARGO_HOME}"
$ ln -s ~/.xargo "${XARGO_HOME}"
$ git clone https://github.com/cross-rs/rust-cpp-hello-word
$ cd rust-cpp-hello-word
$ cargo build # works
$ cross build --target aarch64-unknown-linux-gnu # also just works There is, however, an unrelated issue with podman, which has permissions errors. Entering the container using the build command, we can see that they're mounted with root permissions. $ ls -la / | grep argo
drwxrwxr-x. 1 root root 164 Jul 3 22:57 cargo
drwxrwxr-x. 1 root root 6 Jun 2 03:36 xargo Meanwhile, in Docker, they're mounted as the current user: ls -la / | grep argo
drwxrwxr-x. 1 1000 1000 164 Jul 3 22:57 cargo
drwxrwxr-x. 1 1000 1000 6 Jun 2 03:36 xargo |
947: Resolve symlinks for cargo and xargo home. r=Emilgardis a=Alexhuszagh Resolve symlinks for the xargo and cargo home (as well as the Nix store) prior to mounting, since they are mounted at a fixed location anyway. This is because podman mounts symlinks as root by default. Closes #373. Doesn't interfere with #920 and #942, although #942 might need work to ensure non-canonical paths are mounted with normal permissions. Co-authored-by: Alex Huszagh <ahuszagh@gmail.com>
Maintainers Note: The originally title and post contents are below. This has been modified since the current issue is related, but different, as described here.
When using Podman, if we have a symlink to our bind mount, we a permissions error, saying it cannot access the data within the volume. This only happens with paths we do not canonicalize. Here, we create an example with symlinks for our
CARGO_HOME
andXARGO_HOME
. This probably also occurs for other bind mounts.If we run in Podman, these directories are owned by
root
, not by the current user.$ ls -la / | grep argo drwxrwxr-x. 1 root root 164 Jul 3 22:57 cargo drwxrwxr-x. 1 root root 6 Jun 2 03:36 xargo
Meanwhile, in Docker, they're mounted as the current user, and
cross
works fine:ls -la / | grep argo drwxrwxr-x. 1 1000 1000 164 Jul 3 22:57 cargo drwxrwxr-x. 1 1000 1000 6 Jun 2 03:36 xargo
cross fails with "failed to create directory - file exists"
Steps to reproduce:
(working directory (should be rather irrelevant) is equivalent to: https://github.com/zserik/crulz-rs/tree/754196bbbc4d99ed6634e83b8e3d2b7571ce7209)
It happens when either
$CARGO_HOME
,$CARGO_HOME/registry
,$CARGO_HOME/registry/cache
or$CARGO_HOME/registry/index
(or multiple of them) are symlinks.I tried to run (with the same target):
cross check
cross clippy
cross build
cross build --release
I got the following error:
The text was updated successfully, but these errors were encountered: