Skip to content

rust: copy std dll into /usr/bin#5789

Draft
ognevny wants to merge 1 commit intomsys2:masterfrom
ognevny:rust-std-bin
Draft

rust: copy std dll into /usr/bin#5789
ognevny wants to merge 1 commit intomsys2:masterfrom
ognevny:rust-std-bin

Conversation

@ognevny
Copy link
Copy Markdown
Collaborator

@ognevny ognevny commented Nov 11, 2025

fixes #5784

@ognevny ognevny mentioned this pull request Nov 11, 2025
1 task
rm "${pkgdir}/etc/target-spec-json-schema.json"

# workaround for https://github.com/msys2/MSYS2-packages/issues/5784
cp "${pkgdir}"/usr/lib/rustlib/x86_64-pc-cygwin/lib/std-*.dll -t "${pkgdir}/usr/bin"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a link?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that for windows-gnu it's a copied file, but didn't check rust sources

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes. It's a copied one.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a good idea to hardlink it, so as not to waste space.

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Mar 23, 2026

conflicting

@ognevny
Copy link
Copy Markdown
Collaborator Author

ognevny commented Mar 23, 2026

I know, I don't actually like this approach

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Mar 23, 2026

any response from upstream?

@ognevny
Copy link
Copy Markdown
Collaborator Author

ognevny commented Mar 23, 2026

I don't know. I didn't open any issue in rust repo, because -Cprefer-dynamic is not recommended to use

@500-internal-server-error
Copy link
Copy Markdown

Upstream doesn't guarantee anything outside $prefix/rustlib, so we should merge this.

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Mar 23, 2026

How many binaries linked against it?

@500-internal-server-error
Copy link
Copy Markdown

500-internal-server-error commented Mar 23, 2026

Not many I imagine, even the one case I hit it was only in the test suite, not the build. Still would be nice not to hit it, though.

@Berrysoft
Copy link
Copy Markdown
Contributor

Almost all rust binaries link std statically. It would be possible to link std dynamically if the std dll is in /usr/bin, but it would be massive for packagers, because every time the rust package updates, they need to update all binaries compiled by rust.

However, the proc macros use the std dll. cargo and rustc are responsible for their environments and the std dll doesn't have to be inside /usr/bin. Only some corner cases, like a test suite for some proc macro libs, might need the std dll in PATH.

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.

Wrong location for rust stdlib

4 participants