Comments (16)
@canndrew I was worried that the RUST_SYSROOT
issue would be affecting anyone who tried Miri, but I think it still just affects non-rustup users. Based on rust-lang/rust#39578 I gather you're yet another NixOS user who can't use rustup (like me)?
I should probably try the build.rs
approach I mentioned since there are at least 4 NixOS users I can think of interested in building Miri now...
from miri.
@aochagavia: did you install rust via rustup
? That should set those env vars automatically.
from miri.
I compiled it manually with cargo debug
. Maybe we could document this under a "Contributing" subsection or something like that?
from miri.
We should actually remove those hacks and move to
let sysroot = std::process::Command::new("rustc")
.arg("--print")
.arg("sysroot")
.output()
.expect("rustc not found")
.stdout;
let sysroot = std::str::from_utf8(&sysroot).expect("sysroot is not utf8").trim();
let sysroot = &Path::new(&sysroot);
from miri.
This doesn't work for me. Even trying to compile run the program below results in an error because it cannot find std.dll
.
extern crate miri;
fn main() { }
from miri.
I played around on windows. Setting those env vars has zero effect for me. Instead the issue is
- rust-lang/rustup#876
- rust-lang/cargo#3394
- rust-lang/rustup#893
- and other related issues around
rustup
not settingPATH
anymore
Are you sure you didn't misdiagnose this in the main post and accidentally set the PATH
variable, too?
Even trying to compile the program below results in an error
I can compile this fine, but running also gives me the error about std.dll
from miri.
I can compile this fine, but running also gives me the error about std.dll
Oops... I meant run! It compiles fine.
from miri.
Setting those env vars has zero effect for me.
You are right. I just tested it again and it didn't work.
from miri.
I can't figure out the environment variables to run the tests either. I've installed rust master from git, rustc --print sysroot
gives me /home/shum/.local
. If I export RUST_SYSROOT=/home/shum/.local
then cargo test
still complains error[E0463]: can't find crate for `std`
.
from miri.
I set RUST_SYSROOT
to the result of rustc --print sysroot
before compiling Miri. I'd like to make this simpler, but I'm confused by the whole sysroot situation and it hasn't been a priority.
from miri.
Maybe we could use a build.rs script to run rustc --print sysroot
and save it somewhere the Miri build can include_str!()
it from rather than using a build-time environment variable?
from miri.
I set
RUST_SYSROOT
to the result ofrustc --print sysroot
before compiling Miri.
Yep, that works.
from miri.
I gather you're yet another NixOS user who can't use rustup (like me)?
Yep :)
Maybe we could use a build.rs script to run
rustc --print sysroot
and save it somewhere the Miri build caninclude_str!()
it from rather than using a build-time environment variable?
Seems unfortunate to have the path baked-in at compile time but I don't have a better suggestion.
from miri.
I suppose we could run rustc --print sysroot
at runtime. The important thing, I think, is that it uses the sysroot of the rustc that miri was built with.
from miri.
Initialization has moved quite a bit, is this still a problem?
from miri.
This issue actually asks two questions:
- How can miri find the necessary libraries it needs at run-time when not running in rustup? This is now taken care of by the
./miri
script; a./miri install
will install a Miri that has the rpath set appropriately. - How does miri find its "default" sysroot if there is no rustup during build? The answer is to set
RUST_SYSROOT
.
So, also based on the fact that nobody responded to my question from almost a year agi, I am going to close this.
from miri.
Related Issues (20)
- Cannot add new targets after installation of toolchain HOT 4
- Revamp "./miri test": parse --target ourselves, pass the rest to the test harness HOT 3
- Miri tests on Windows require admin for symlinks HOT 10
- miri-script: use a proper CLI arg parsing tool HOT 1
- macOS: support calling native functions
- Support more ways of using mmap
- Complete basic support for wasm32-wasip2 HOT 9
- Complete basic support for android HOT 3
- strerror based on ErrorKind is technically valid but surprising HOT 3
- Miri accepts an open-coded compare-exchange loop but rejects the equivalent code using fetch_update HOT 5
- Android: implement support for pthread synchronization primitives
- Android: make std thread APIs work
- Big `Vec::try_reserve` OOMs Miri (slowly) HOT 12
- Clearer error message for unsupported flags: print names of flags (if possible) HOT 1
- "local crate" detection does not work any more
- Stuck when running `cargo miri test` HOT 3
- ICE due to overflow when using a large timeout with futexes HOT 2
- Possible false positive of stacked borrow rules HOT 1
- simd_bitmask: support vectors larger than 64 elements
- Miri does not detect invalid uses of alchemy (std::ptr::from_raw_parts w/ invalid vtable pointer) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miri.