2,491 questions
3
votes
1
answer
75
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
85
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 ...
4
votes
2
answers
85
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
1
answer
76
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/<...
-5
votes
1
answer
100
views
Understanding Rust Import Inheritance [closed]
I have a small Rust project — it's a Hello World file that is using the following dependencies:
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { ...
1
vote
1
answer
98
views
How to conditionally (compile) import a group of modules based on a feature?
I always struggle a bit with the Rust/Cargo features
and conditional compile.
I have a number of Functions and a number of FunctionGroups.
Let's say I have Functions
F_A,
F_B,
F_C
and FunctionGroups
...
0
votes
1
answer
65
views
ImportError: DLL load failed while importing _rust: The specified module could not be found
I'm getting that error any time that the following is executed from a Python script:
from cryptography.hazmat.bindings._rust import <whatever>
I look at the file structure for my ...\site-...
2
votes
0
answers
155
views
When to make use of `default-features = false` on crate features? [closed]
Most bigger crates have quite a few features enabled by default. Why should I use default-features = false in my Cargo.toml and only enable the ones that I actually need?
For example, if I use the ...
0
votes
0
answers
136
views
How to make `cargo doc` docs output to `/docs` directory (for GH pages)?
GitHub will create a web page for your repository using the GitHub Pages feature, but only if a suitable webpage (i.e. index.html) is in either the root directory (/) or in /docs. When you build ...
0
votes
0
answers
43
views
Generate cargo test HTML report and export it to Polarion
Is it possible to generate an HTML cargo test report, which contains test case name (based on Polarion ID), status (passed/failed) and export the report to Polarion?
1
vote
1
answer
162
views
cargo error: failed to run custom build command for `alsa-sys v0.3.1`
I've got a rust project . When I try to build that project I get the following error -
error: failed to run custom build command for `alsa-sys v0.3.1`
Caused by:
process didn't exit successfully: `/...
0
votes
1
answer
205
views
WASM-pack build failed: getrandom version conflict with libsignal protocol crate
im suffering from getrandom version conflict issue, its been a week i havent find any solution can we discuss it?
currently im trying to build libsignal protocols /protocol crate using wasm-pack and ...
0
votes
0
answers
75
views
In IntelliJ, exclude some members from Rust workspace, based on current target?
I'm using IntelliJ and the Rust plugin. I'm on a MacBook and usually not cross-compiling, but sometimes I want to switch my target to iOS, so I can see the IDE analyze code marked with #[cfg(target_os ...
0
votes
2
answers
93
views
SqliteRow doesn't implement Debug
Using rust sqlx sqlx = { version = "0.8.6", features = ["sqlite", "runtime-tokio", "macros"] } .
I am using a SQLite Db for my application. After making a db ...
0
votes
0
answers
153
views
cargo bench throws "MallocStackLogging: can't turn off malloc stack logging because it was not enabled..." on Apple M4
I'm trying to run cargo bench on my new MacBook (Apple Silicon, macOS [Sequioa version 15.5]), but I get this error:
cargo(31826) MallocStackLogging: can't turn off malloc stack logging because it was ...
0
votes
0
answers
74
views
How can i found IPv4 address using domain on Rust [duplicate]
I am making a cli tool that based on hostname and host ip match control. I just head by with a problem that is there any library or rest-api that i can use in rust for domains ipv4 address ?
For ...
0
votes
0
answers
31
views
How exactly is `Cargo.toml` mangled when publishing to `crates.io`?
When publishing my crates to https://crates.io/, the toolchain at some point seems to be performing some mangling to my Cargo.toml. The mangled version of the manifest is published, while the original ...
0
votes
0
answers
188
views
How do I handle dependencies with different versions from the same repository?
I'm making changes in repo1 that has two dependencies in which I need to make a code change:
[workspace.dependencies]
solana-signature = { version = "2.2.1", default-features = false }
...
-1
votes
1
answer
75
views
How do I change a dependency and track changes to my GitHub project? [duplicate]
I'm making changes to a GitHub repo I cloned to my machine. I also need to make changes to the code of one of its dependencies (listed as solana-vote-interface = "2.2.3" in Cargo.toml under [...
0
votes
1
answer
67
views
Rust Kernel: Undefined refrence to 'core::panicking::panic_null_pointer_derefrence'
Im writing a kernel in Rust, but are having some problems with the panicking module.
I have written a build script that should build the boot image of the OS, but i seem to get an error while trying ...
1
vote
0
answers
206
views
Cargo says "Operation not permitted" when compiling on Arch Linux
I have dual-OS setup on my PC with an NTFS partition for Windows, an ext4 partition for Arch Linux and an exFAT partition for shared data.
The data partition is mounted on my Arch system like this (...
0
votes
0
answers
63
views
Rust code allowing mutiple mutable reference [duplicate]
Can you please help me why my Rust code is allowing mutiple mutable borrowers here. Rust document says we cannot have mutiple mut borrowers of a variable
fn main() {
let mut s1 = String::from(&...
0
votes
0
answers
66
views
ERROR: do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting
After upgrading to Rust v1.86.0 locally (currently poky master has v1.85.1),
the following error is observed:
ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed ...
1
vote
1
answer
414
views
How to build rust container using podman and behind a zscaler proxy
Podman builds started failing on the cargo buld step with certificate errors. It was working for a couple weeks but started failing all of a sudden.
The error returned from the build is :
Caused by:
...
1
vote
3
answers
2k
views
Why is the method source_file not found for proc_macro2::Span?
I initialized a new empty project via anchor init but I'm having trouble running anchor build. proc_macro2 compiles fine early in the sequence but when it comes to compiling anchor-syn. I'm trying to ...