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

Couldn't copy error during build #293

Open
DrDinosaur opened this issue May 14, 2020 · 1 comment
Open

Couldn't copy error during build #293

DrDinosaur opened this issue May 14, 2020 · 1 comment

Comments

@DrDinosaur
Copy link

I am following this guide: https://github.com/johnthagen/min-sized-rust#optimize-libstd-with-xargo

I ran the following commands:

$ rustup toolchain install nightly
$ rustup override set nightly
$ rustup component add rust-src
$ cargo install xargo

When I run this command, I get an error.

xargo build --target x86_64-pc-windows-gnu --release
error: couldn't copy /home/drdinosaur/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o to /home/drdinosaur/.xargo/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o
caused by: No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` for a backtrace

I am attempting to compile to Windows from Linux. I'm not sure what the issue is from that. I'm still, new to Rust, I'm just trying to reduce my binary size through this method. Thanks.

@RalfJung
Copy link
Collaborator

Building for Windows needs some extra object files that it seems you do not have. You could try rustup target add x86_64-pc-windows-gnu.

But also... maybe try using std-aware cargo instead? xargo is not developed any more, just some (not all) of the existing use-cases are kept working on a best-effort basis.

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

No branches or pull requests

2 participants