Hi, I've cross posted this from the Rust Subreddit as well. I am new to Rust overall, so trying to cast a large net to see if what I'm looking for is even possible.
I've recently been trying to get a Rust Program on Github to compile on my local machine, its a Onion Vanity Address generator (for TOR Addresses). I've been able to get pretty far using the documentation that was provided, but it appears that I'm getting stuck at a certain point. I have experience with other languages, but not Rust.
Caused by:
process didn't exit successfully: `/home/ayka/tor-v3-vanity/target/release/build/tor-v3-vanity-0ee4631e169c1030/build-script-build` (exit status: 1)
--- stdout
cargo:rustc-link-search=native=/usr/local/cuda/lib64/
--- stderr
[PTX] Unable to build a PTX crate!
[PTX] warning: unused manifest key: build
[PTX] warning: unused manifest key: build
[PTX] Compiling tor-v3-vanity-core v0.1.0 (/home/ayka/tor-v3-vanity/core)
[PTX] error: crate `rustacuda_core` required to be available in rlib format, but was not found in this form
[PTX]
[PTX] error: crate `byteorder` required to be available in rlib format, but was not found in this form
[PTX]
[PTX] error: crate `ed25519_compact` required to be available in rlib format, but was not found in this form
[PTX]
[PTX] error: could not compile `tor-v3-vanity-core` due to 3 previous errors
[PTX]
Now I've been trying and trying to figure out how I can force Cargo to build those three dependencies as a .rlib, but I haven't been able to figure it out. There is mention of a workaround in the build.rs code that comes with the program:
// Workaround for "crate required to be available in rlib format" bug
std::env::set_var("CARGO_BUILD_PIPELINING", "false");
but it would appear that workaround no longer actually works.
I've tried also building this w/o the +nightly, but then get a separate error:
[PTX] Unable to build a PTX crate!
[PTX] warning: unused manifest key: build
[PTX] warning: unused manifest key: build
[PTX] Compiling tor-v3-vanity-core v0.1.0 (/home/ayka/tor-v3-vanity/core)
[PTX] error: the option `Z` is only accepted on the nightly compiler
[PTX]
[PTX] error: could not compile `tor-v3-vanity-core`
[PTX]
I was able to find some examples where this was caused by that ``CARGO_BUILD_PIPELINE but I removed that from the build.rs and tried again to the same error. I've tried compiling this now on both Windows Native, as well as Ubuntu on WSL.
Does anyone have any pointers as to how I may resolve this? Is there a way for me to force these three crates to build as .rlibs?
CARGO_BUILD_PIPELINING is no longer read by cargo. It now always enables build pipelining.
The crates should be build as .rlib. Build pipelining just also builds them as .rmeta which is faster and allows compilation of dependent crates to start earlier.
Could you try looking for a .last-build-command file somewhere in target/release/build and then run the command in this file with the PTX_CRATE_BUILDING env var set to 1, the RUSTC_LOG env var set to rustc_metadata and -v as extra argument?
I've searched both Target Directories (for both the Windows and the Ubuntu-WSL builds, and I cant find a file that has *.last-build-command.
I have however swapped in the two ENV Variables and retried the cargo +nightly -v install --path . and this is the output from the Windows based compiler:
In the last one, I had errors saying it was unable to access the rustacuda_derive package, so in looking into it a little I've now appended the Cargo.toml file that came with the code to include:
I am now getting a single error when attempting to build.
error: couldn't read /dev/null: The system cannot find the path specified. (os error 3)
--> src/main.rs:129:44
|
129 | let module_data = CString::new(include_str!(env!("KERNEL_PTX_PATH"))).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro include_str (in Nightly builds, run with -Z macro-backtrace for more info)
error: failed to compile tor-v3-vanity v0.1.0 (C:\Windows\System32\tor-v3-vanity), intermediate artifacts can be found at C:\Windows\System32\tor-v3-vanity\target
to my Cargo.toml file, and that seems to have cleared up the previous three errors in lib.rs, as it now appears to be able to find the function from Rustacuda_derive.
However I have one single error remaining now:
error: couldn't read /dev/null: The system cannot find the path specified. (os error 3)
--> src/main.rs:129:44
|
129 | let module_data = CString::new(include_str!(env!("KERNEL_PTX_PATH"))).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro 'include_str' (in Nightly builds, run with -Z macro-backtrace for more info)
error: failed to compile 'tor-v3-vanity v0.1.0 (C:\Windows\System32\tor-v3-vanity)', intermediate artifacts can be found at 'C:\Windows\System32\tor-v3-vanity\target'
Caused by:
could not compile 'tor-v3-vanity' due to previous error
Well, unfortunately it executes with an error, even trying it on a full Debian Live Boot (which is reporting a graphics card in nvidia-smi.)
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidImage', src/main.rs:130:65 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'thread '<unnamed>main' panicked at '' panicked at 'called `Result::unwrap()` on an `Err` value: RecvErrorcalled `Result::unwrap()` on an `Err` value: RecvError', ', src/main.rssrc/main.rs::273296::4032