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

Make cargo as relative symlink not absolute #6780

Merged
merged 2 commits into from Nov 16, 2018

Conversation

Projects
None yet
2 participants
@illicitonion
Contributor

illicitonion commented Nov 16, 2018

This makes the .cache/pants/rust directory more self-contained and copyable

I have been using this to copy things into / out of docker containers and network-restricted areas for debugging avoiding needing to re-initialise all of the rust stuff every time.

Make cargo as relative symlink not absolute
This makes the .cache/pants/rust directory more self-contained and copyable

@illicitonion illicitonion requested a review from jsirois Nov 16, 2018

@@ -48,7 +48,8 @@ function bootstrap_rust() {
"${RUSTUP}" toolchain install ${RUST_TOOLCHAIN}
"${RUSTUP}" component add --toolchain ${RUST_TOOLCHAIN} ${RUST_COMPONENTS[@]} >&2
ln -fs "$(RUSTUP_TOOLCHAIN="${RUST_TOOLCHAIN}" cargo_bin)" "${rust_toolchain_root}/${cargo_versioned}"
symlink_target="$(perl -e 'use File::Spec; print File::Spec->abs2rel(@ARGV) . "\n"' "$(RUSTUP_TOOLCHAIN="${RUST_TOOLCHAIN}" cargo_bin)" "${rust_toolchain_root}")"

This comment has been minimized.

@jsirois

jsirois Nov 16, 2018

Member

It seems a little wanton to add perl as a dep for developers for this even though perl is ~everywhere. Consider python -c 'import os, sys; print(os.path.relpath(*sys.argv[1:]))'.

@illicitonion illicitonion merged commit 76434bd into pantsbuild:master Nov 16, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@illicitonion illicitonion deleted the twitter:dwangerhall/relsymlink branch Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment