-
Notifications
You must be signed in to change notification settings - Fork 377
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
Resolve symlinks for cargo and xargo home. #947
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
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>
bors r- |
Canceled. |
canonicalization is only needed on xargo when envvar is set (and exists) |
Yeah, I planned on converting this to a draft before my internet died. This still fails right now if the path exists but it's a broken symlink. |
f6cc573
to
b72e31e
Compare
I think this is ready: it fails if the symlink exists but is broken, but that's a feature I believe, and will error with the following warning: Error:
0: couldn't create directory "/home/ahuszagh/Desktop/cross/path/to/registry/.xargo"
1: File exists (os error 17) |
6ee7570
to
64448bd
Compare
64448bd
to
d03bc90
Compare
d03bc90
to
5361e2b
Compare
This is a cool change, it also makes it more clear in verbose build that you're actually running a binary mounted from your host system, since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! overall a huge improvement in ux
I feel like we should make some path shims though, to easily descern between what's on the host and what is in the image, that can be done separately though.
Some small things left
5361e2b
to
1b331db
Compare
test_host is failing due to |
We might need a better strategy. Let me think... |
f30fdf7
to
63829b5
Compare
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. We always canonicalize the paths on the host, after creating them, to ensure that any symlinks are resolved. Say we have `/path/to/home`, and `/path/to` is a symlink but `/path/to/home` doesn't exist yet. Trying to canonicalize `/path/to/home/.xargo` will fail, and will still be a symlink if we maybe canonicalize before. First creating the directories and canonicalizing them on the host should always work. Change the mount points from `/cargo`, `/xargo`, and `/rust` to the same paths as on the host, which avoids unnecessary recompilation when `cargo` and `cross` are intermittently used.
63829b5
to
a43ef0d
Compare
Ok I've changed this to use the host target triple (only for the unittest), so the toolchain will always be installed. |
bors r=Emilgardis |
Build succeeded: |
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. We always canonicalize the paths on the host, after creating them, to ensure that any symlinks are resolved.
Say we have
/path/to/home
, and/path/to
is a symlink but/path/to/home
doesn't exist yet. Trying to canonicalize/path/to/home/.xargo
will fail, and will still be a symlink if we maybe canonicalize before. First creating the directories and canonicalizing them on the host should always work.Change the mount points from
/cargo
,/xargo
, and/rust
to the same paths as on the host, which avoids unnecessary recompilation whencargo
andcross
are intermittently used.Closes #280.
Closes #373.
Closes #551.