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

xargo doesn't work with cranelift #304

Open
jyn514 opened this issue Nov 1, 2020 · 7 comments
Open

xargo doesn't work with cranelift #304

jyn514 opened this issue Nov 1, 2020 · 7 comments

Comments

@jyn514
Copy link

jyn514 commented Nov 1, 2020

$  cat config.toml
[rust]
codegen-backends = ["cranelift"]
$ x.py test --stage 0 src/tools/miri
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/joshua/rustc/build/bootstrap/debug/rustc - --crate-name ___ --print=file-names -Cdebug-assertions=off --sysroot /home/joshua/.cache/miri/HOST -Z force-unstable-if-unmarked --target x86_64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
  --- stderr
  error: failed to find a `codegen-backends` folder in the sysroot candidates:
  * /home/joshua/rustc/build/x86_64-unknown-linux-gnu
  * /home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu
  * /home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage0-sysroot

error: `"/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--release" "--manifest-path" "/tmp/xargo.z0UAkyvzwjGN/Cargo.toml" "--target" "x86_64-unknown-linux-gnu" "-p" "std"` failed with exit code: Some(101)
   0: error_chain::backtrace::imp::InternalBacktrace::new
   1: <error_chain::State as core::default::Default>::default
   2: <std::process::Command as xargo::extensions::CommandExt>::run
   3: xargo::sysroot::build
   4: xargo::sysroot::update
   5: xargo::main_inner
   6: std::sys_common::backtrace::__rust_begin_short_backtrace
   7: std::rt::lang_start::{{closure}}
   8: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/4708ac76ee6ec7e278a00f49a40b5bfbcdfd6168/library/core/src/ops/function.rs:259:13
      std::panicking::try::do_call
             at /rustc/4708ac76ee6ec7e278a00f49a40b5bfbcdfd6168/library/std/src/panicking.rs:381:40
      std::panicking::try
             at /rustc/4708ac76ee6ec7e278a00f49a40b5bfbcdfd6168/library/std/src/panicking.rs:345:19
      std::panic::catch_unwind
             at /rustc/4708ac76ee6ec7e278a00f49a40b5bfbcdfd6168/library/std/src/panic.rs:382:14
      std::rt::lang_start_internal
             at /rustc/4708ac76ee6ec7e278a00f49a40b5bfbcdfd6168/library/std/src/rt.rs:51:25
   9: main
  10: __libc_start_main
  11: _start

fatal error: failed to run xargo
$ fd codegen-backends /home/joshua/rustc/build/x86_64-unknown-linux-gnu
/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
$ ls /home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
librustc_codegen_cranelift-1.49.0-dev.so
@jyn514
Copy link
Author

jyn514 commented Nov 1, 2020

Maybe this is actually an x.py bug, since the folder is in stage1 and not stage0-sysroot? Not sure where to report it.

@RalfJung
Copy link
Collaborator

RalfJung commented Nov 1, 2020

Can you reproduce this with xargo directly, independent of Miri or x.py? If no, this is likely the wrong repository.

The rust repository might be a better fit also because to me this looks first like a cranelift issue.^^ xargo does not even interact much directly with rustc (just a bit via rustc_version), it mostly calls cargo in special ways.

@jyn514
Copy link
Author

jyn514 commented Nov 1, 2020

I'm not sure where I would start trying to reproduce this.

cc @bjorn3 - do you know what's going wrong here?

@bjorn3
Copy link

bjorn3 commented Nov 1, 2020

Does it work with --stage 1?

@bjorn3
Copy link

bjorn3 commented Nov 3, 2020

I think I now what happens. Tools require Rustc instead of Assemble. This means that CodegenBackend is never built and thus rustc fails when trying to load cg_clif.

@jyn514
Copy link
Author

jyn514 commented Nov 3, 2020

... is this why you can't run tools in-tree?

https://zulip-archive.rust-lang.org/257328clippy/19387Runclippyintree.html

@bjorn3
Copy link

bjorn3 commented Nov 3, 2020

I am not quite sure that has the same reason, but it could be.

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

3 participants