Open yarrow opened 9 months ago
Hi @yarrow, thanks for the report. I believe this is a fundamental limitation to using code that links against the compiler via #![feature(rustc_private)]
. It's the same reason I can't yet produce Flowistry binaries for ARM -- GitHub does not offer ARM runners. I don't believe there's any way to cross-compile rustc_private code at the moment, but I will update this thread if that changes.
Thanks! I've checked, and Flowistry does work if I create a .cargo/config.toml
file in a project where I want to use it, with:
[build]
target = "x86_64-apple-darwin"
(overriding the global target = "aarch64-apple-darwin"
in my ~/.cargo/config.toml
Wait sorry -- are you trying to use x86-compiled Flowistry? Or are you trying to use ARM-compiled Flowistry on x86-targeted code?
I just tried cross-compiling Flowistry on my laptop and still got an error:
$ rustup toolchain install nightly-2023-08-25 -c rust-src rustc-dev llvm-tools-preview miri --target x86_64-apple-darwin
<works fine>
$ cargo build --release --target x86_64-apple-darwin
<snip>
error[E0463]: can't find crate for `rustc_driver`
--> /Users/will/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indexical-0.3.1/src/impls/rustc.rs:1:1
|
1 | extern crate rustc_driver;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
Flowistry works in Rosetta mode if I compile my project for x86 and use x86-compiled Flowistry with the x86-compiled rustc.
(I usually use the x86 rustc in Rosetta mode with an aarch64-apple-darwin target — I want to use a Tier 1 compiler but produce binaries that run faster on my machine.)
Likely this is because I'm running an x86_64 compiler but asking it to build for Apple silicon. (I've been reluctant to use a Tier 2 compiler since no CI tests are run, so my
rustc
is x86_64 running under Rosetta; on the other hand, some other projects run better when compiled for Apple silicon. This is the first time I've run into a problem with the setup.)