2,489 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
105
views
How to link Fortran with Rust?
In particular in the scientific context, there is a lot of code
written in Fortran and it would be useful to link this code to Rust.
There is the library fortranc that is a cargo build script.
Fortran ...
Best practices
1
vote
3
replies
77
views
including a python script with my rust CLI program
I want my rust CLI program rust-program to run a Python interpreter on a packaged Python script.py .
What is a good method for this? I need to
have rust code determine the filesystem path to script....
Advice
0
votes
3
replies
69
views
Rust LLVM unit test coverage includes the test code itself
I wrote some Rust code and also wrote some test code in the tests submodule.
Then I run `cargo llvm-cov --open` to test. But it keeps saying that my code below has branch coverage completion.
#[test]
...
3
votes
2
answers
102
views
How to specify -fPIC and -fPIE options when building Rust binaries
In GCC we can specify -fPIC option for shared library and -fPIE for executable to create code that can be executed at any memory address. How do I achieve the same in Rust using Cargo?
-1
votes
0
answers
40
views
How to force a crate dependency to use latest commit of another repo
My project has a dependency of jsonref, which has indirect dependency of ring crate. Unfortunately the ring crate version which is getting downloaded and compiled doesn't include the latest commits of ...
1
vote
1
answer
105
views
Rust cargo doesn't throw error for invalid search paths present in build.rs
I have a build.rs file in my project which contains code of library search paths and library linking. However, if I specify library search paths that doesn't exist in build.rs, it doesn't throw any ...
0
votes
1
answer
69
views
Why does `cargo build` fail to run custom build command for `stdint v1.0.0`?
I'm trying to compile a keypad driver written in Rust by using cargo build, but I get a strange error message I can't find any information about:
╭─jacek@epica /import/valen/autoradio/libkeypad
╰─➤ ...
3
votes
1
answer
86
views
Use cargo check in its own directory avoiding blocking cargo run
I set up the VS Code settings.json with the following configuration:
{
"rust-analyzer.checkOnSave": true,
"rust-analyzer.runnables.extraEnv": {
"RUST_BACKTRACE&...
-5
votes
1
answer
91
views
How do I create some folders and then a file (in this case main.c)?
//Create folders and main.c
let folders = format!("{}/src/main.c", name);
match fs::create_dir_all(&folders) {
Err(why) => {
println!("Failed to ...
0
votes
0
answers
49
views
How does cargo and/or link.exe interact together to find a static lib on Windows?
I have a project that fails to build.
PS C:\Users\me\Data\personal\rust\sdl-learn> cargo build
Compiling sdl-learn v0.1.0 (C:\Users\me\Data\personal\rust\sdl-learn)
error: linking with `link.exe`...
5
votes
2
answers
126
views
Actix Web server fails to restart on the same port when on WSL
I'm developing a simple Actix Web backend in Rust and running it on WSL (Windows Subsystem for Linux).
The server runs fine the first time, but when I use cargo watch -x run to auto-restart it on code ...
0
votes
2
answers
120
views
How to resolve 'cargo add' caused error: failed to select version for the requirement 'hdf5-sys = ^0.3.2' on linux?
I installed rust yesterday and I am in need of the numeric crate for my project. But when I ran 'cargo add numeric' in the terminal i got this error:
Updating crates.io index
error: failed to select a ...
0
votes
1
answer
96
views
Cargo ignores custom, HTTP registry
I have a .cargo/config.toml file that configures a custom, HTTP git-based registry (hosted on Bitbucket) to replace crates.io:
[source]
[source.artifactory]
registry = "http://bitbucket/scm/<...
1
vote
1
answer
99
views
Rust cortex-m-rt / RTIC firmware builds an empty ELF (0x00010000 start, ~150 bytes) — memory.x not applied for STM32H7
What’s the correct way to ensure cortex-m-rt (or RTIC) uses my custom
memory.x so the ELF is linked to 0x08000000 instead of the default
0x00010000?
Context
I’m writing embedded Rust firmware for an ...
0
votes
0
answers
41
views
CircleCI fails `cargo test` for cross-compiled Rust project
I have a Rust project created with cargo that I'm trying to cross compile (see "targets" in rust-toolchain.toml below) with the following dir structure:
.
├── .circleci
│ └── config.yaml
├─...