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

Problems with basic setup when using XARGO_RUST_SRC #337

Closed
Shadlock0133 opened this issue May 20, 2022 · 3 comments
Closed

Problems with basic setup when using XARGO_RUST_SRC #337

Shadlock0133 opened this issue May 20, 2022 · 3 comments

Comments

@Shadlock0133
Copy link

Based on reddit post, I've tried setting up simple example with custom std.

I'm using nightly toolchain (2022-05-19), copied rust-src to local folder (cp -r $(rustc +nightly --print sysroot)/lib/rustlib/src/rust .), and setup new project next to it, With Xargo.toml:

[dependencies.std]
features = ["panic-unwind"]

and running XARGO_RUST_SRC=../rust/src xargo run --release results in

warning: dependency (std) specified without providing a local path, 
Git repository, or version to use. This will be considered an error 
in future versions
    Updating crates.io index
error: no matching package named `std` found
location searched: registry `crates-io`
required by package `sysroot v0.0.0 (C:\Users\SHADOW~1\AppData\Local\Temp\xargo.P69tPZMMepsy)`
error: `"cargo" "build" "--release" "--manifest-path" "C:\\Users\\SHADOW~1\\AppData\\Local\\Temp\\xargo.P69tPZMMepsy\\Cargo.toml" "--target" "x86_64-pc-windows-msvc" "-p" "std"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace

Adding path = "../rust/library/std" to Xargo.toml changes error message to

   Compiling compiler_builtins v0.1.71
   Compiling rustc-std-workspace-core v1.0.0
   Compiling libc v0.2.125
   Compiling core v0.0.0 (D:\Projects\custom-std\rust\library\core)
   Compiling cc v1.0.69
   Compiling rustc-std-workspace-alloc v1.0.0
   Compiling std v0.0.0 (D:\Projects\custom-std\rust\library\std)  
error[E0463]: can't find crate for `std`

For more information about this error, try `rustc --explain E0463`. 
error: could not compile `rustc-std-workspace-core` due to previous 
error
warning: build failed, waiting for other jobs to finish...
error: could not compile `rustc-std-workspace-alloc` due to previous error
error: `"cargo" "build" "--release" "--manifest-path" "C:\\Users\\SHADOW~1\\AppData\\Local\\Temp\\xargo.wsQ9hNCjPrzi\\Cargo.toml" "--target" "x86_64-pc-windows-msvc" "-p" "std"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
@RalfJung
Copy link
Collaborator

RalfJung commented May 21, 2022

Note that xargo is barely maintained, so it's unlikely someone will have time to look into this issue -- sorry.

@RalfJung
Copy link
Collaborator

That said, note that these days XARGO_RUST_SRC expects the path to the library subfolder of the Rust source tree. (That subfolder used to be called src when the xargo env var name was picked, but it has gotten renamed a few years ago.)

@Shadlock0133
Copy link
Author

XARGO_RUST_SRC expects the path to the library

That actually was the problem. It compiles and works now. Thanks.

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