-
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
Open
500-internal-server-error
wants to merge
7
commits into
msys2:master
Choose a base branch
from
500-internal-server-error:add-rustup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
rustup: new, 1.27.1 #20989
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b0355e1
rustup: new, 1.27.1
500-internal-server-error d46dfad
rustup: Add other mingw_arch
500-internal-server-error e2f82bc
rustup: fix rustup-profile.sh
500-internal-server-error 4769c30
rustup: updpkgsums
500-internal-server-error 2d280db
rustup: add "mingw-w64" to pkgdesc
500-internal-server-error deef02a
rustup: inline append_path
500-internal-server-error 6f3437e
rustup: updpkgsums
500-internal-server-error File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
_realname=rustup | ||
pkgbase=mingw-w64-${_realname} | ||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") | ||
pkgver=1.27.1 | ||
pkgrel=1 | ||
pkgdesc="The Rust toolchain installer (mingw-w64)" | ||
arch=('x86_64') | ||
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') | ||
url="https://github.com/rust-lang/rustup" | ||
license=('spdx:Apache-2.0 AND MIT') | ||
msys2_references=( | ||
'archlinux: rustup' | ||
) | ||
depends=( | ||
"${MINGW_PACKAGE_PREFIX}-curl" | ||
"${MINGW_PACKAGE_PREFIX}-xz" | ||
"${MINGW_PACKAGE_PREFIX}-zstd" | ||
) | ||
makedepends=("${MINGW_PACKAGE_PREFIX}-rust") | ||
optdepends=( | ||
"${MINGW_PACKAGE_PREFIX}-gdb: rust-gdb script" | ||
"${MINGW_PACKAGE_PREFIX}-lldb: rust-lldb script" | ||
) | ||
provides=("${MINGW_PACKAGE_PREFIX}-rust") | ||
conflicts=("${MINGW_PACKAGE_PREFIX}-rust") | ||
install='post.install' | ||
options=("!lto") | ||
source=( | ||
"rustup-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz" | ||
"rustup-profile.sh" | ||
) | ||
sha256sums=('f5ba37f2ba68efec101198dca1585e6e7dd7640ca9c526441b729a79062d3b77' | ||
'c90eac939a9166240697ed5772f7b6f944d3b16bdaab7071dd9ac81ce5b07b1c') | ||
_binlinks=('cargo' 'rustc' 'rustdoc' 'rust-gdb' 'rust-lldb' 'rustfmt' 'cargo-fmt' 'cargo-clippy' 'clippy-driver' 'cargo-miri') | ||
|
||
build() { | ||
cd "${_realname}-${pkgver}" | ||
cargo build --release --features no-self-update --bin rustup-init | ||
} | ||
|
||
package() { | ||
cd "${_realname}-${pkgver}" | ||
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" | ||
done | ||
|
||
# Special treatment to allow for rust-analyzer to still allow the separate package version to be used. | ||
MSYS=winsymlinks:native ln "${pkgdir}/${MINGW_PREFIX}/bin/rustup.exe" "${pkgdir}/${MINGW_PREFIX}/lib/${_realname}/bin/rust-analyzer.exe" | ||
|
||
install -Dm644 "${srcdir}/rustup-profile.sh" "${pkgdir}/etc/profile.d/rustup.sh" | ||
|
||
# Generate completion files. | ||
mkdir -p "${pkgdir}/${MINGW_PREFIX}/share/bash-completion/completions" | ||
"${pkgdir}/${MINGW_PREFIX}/bin/rustup" completions bash > "${pkgdir}/${MINGW_PREFIX}/share/bash-completion/completions/rustup" | ||
"${pkgdir}/${MINGW_PREFIX}/bin/rustup" completions bash cargo > "${pkgdir}/${MINGW_PREFIX}/share/bash-completion/completions/cargo" | ||
mkdir -p "${pkgdir}/${MINGW_PREFIX}/share/fish/vendor_completions.d" | ||
"${pkgdir}/${MINGW_PREFIX}/bin/rustup" completions fish > "${pkgdir}/${MINGW_PREFIX}/share/fish/vendor_completions.d/rustup.fish" | ||
mkdir -p "${pkgdir}/${MINGW_PREFIX}/share/zsh/site-functions" | ||
"${pkgdir}/${MINGW_PREFIX}/bin/rustup" completions zsh > "${pkgdir}/${MINGW_PREFIX}/share/zsh/site-functions/_rustup" | ||
"${pkgdir}/${MINGW_PREFIX}/bin/rustup" completions zsh cargo > "${pkgdir}/${MINGW_PREFIX}/share/zsh/site-functions/_cargo" | ||
|
||
install -Dm644 LICENSE-MIT "${pkgdir}/${MINGW_PREFIX}/share/licenses/${pkgname}/LICENSE-MIT" | ||
install -Dm644 LICENSE-APACHE "${pkgdir}/${MINGW_PREFIX}/share/licenses/${pkgname}/LICENSE-APACHE" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
post_install() { | ||
echo "You may need to run rustup update stable" | ||
echo "and possibly also rustup self upgrade-data" | ||
} | ||
|
||
post_upgrade() { | ||
echo "You may need to run rustup self upgrade-data" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
append_path "${MINGW_PREFIX}/lib/rustup/bin" | ||
500-internal-server-error marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export PATH |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 consequentlypacman
) 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