-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
rustup: new, 1.27.1 #20989
base: master
Are you sure you want to change the base?
rustup: new, 1.27.1 #20989
Conversation
use ${MINGW_PREFIX} instead of hardcoding /usr
install -d "${pkgdir}/${MINGW_PREFIX}/lib/${_realname}/bin" | ||
install -Dm755 "target/release/rustup-init" "${pkgdir}/${MINGW_PREFIX}/bin/rustup.exe" | ||
for link in "${_binlinks[@]}"; do | ||
MSYS=winsymlinks:native ln "${pkgdir}/${MINGW_PREFIX}/bin/rustup.exe" "${pkgdir}/${MINGW_PREFIX}/bin/${link}.exe" |
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.
We can't do native symlinks in packages, as Windows does not support them by default.
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.
I'm aware, which is why this is a hard link - it's supported on a fresh install since Win8+. Without it, the package size bloats from 8mb (same as Arch, which uses symlinks) to 80mb (copying a multicall binary loses a lot of the benefits of it being a multicall binary).
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.
zst packages are compressed files, so hardlinks symlinks get erased into just being files...
maybe we can get away with a script instead?
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.
The underlying tar file being compressed knows whether the files in it are regular files, symlinks, or hardlinks. I imagine that's how pacman -Qip
can tell that the copied version is 80mb while the hardlinked version is 8mb, even though in both cases the zst file is 2mb.
Not sure what a script would do better than the tar file containing a hardlink, which is supported on all versions of Windows that the MSYS2 project currently supports (Win8+).
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.
We can't do native symlinks in packages, as Windows does not support them by default.
Can we precreate these symlinks, and upload them into Github?
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.
We could, but end users still won't be able to use them - tar
(and consequently pacman
) will simply fail extracting.
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.
unless you fork tar for msys2 which supports it, but then why not do it for upstream cygwin
It seems that symlinking issue will be resolved when this gets merged. |
I thought so initially but I'm bot sure if all the tools will handle symlinks properly. This largerly depnds on Cygwin and will require manual testing. |
Until then, would hard linking as this package does be an acceptable solution? It still gains the space savings and still avoids the requiring admin perms problem. |
I think you can try to create symlink in post-install, if it fails then create *.sh and *.cmd. |
Supersedes #20923
Forgot to do the work in a separate branch, updating master on my fork caused merge conflicts :)