Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

500-internal-server-error

Supersedes #20923

Forgot to do the work in a separate branch, updating master on my fork caused merge conflicts :)

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"
Copy link
Member

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.

Copy link
Author

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).

Copy link
Contributor

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?

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+).

Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Contributor

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

@ArchGuyWu
Copy link
Contributor

It seems that symlinking issue will be resolved when this gets merged.

@mati865
Copy link
Collaborator

mati865 commented Aug 4, 2024

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.

@500-internal-server-error
Copy link
Author

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.

@ArchGuyWu
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants