Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

how to specify conditional rustflags in cargo config file

I need to add "-C link-arg /STACK:4000000" but only for windows builds. I could not follow the cargo book and could not find any sample config.toml files.
pm100's user avatar
  • 50k
0 votes
0 answers
36 views

How to build a Cargo.lock file for a package within a workspace

When I cargo publish from the package directory in my workspace, I get: error: Source directory was modified by build.rs during cargo publish. Build scripts should not modify anything outside of ...
carver's user avatar
  • 2,329
0 votes
0 answers
17 views

Rust LibP2P transaction

I’m working on a project that I plan to make open-source in the future. It’s built using Rust and LibP2P to create an environment where smartphones can connect peer-to-peer to form a decentralized ...
Winrhy's user avatar
  • 1
0 votes
1 answer
53 views

how to solve cargo build-bpf / anchor build error on wsl ubuntu latest version

error: failed to parse lock file at: /home/totdking/SolanaUbuntu/token_raffle/Cargo.lock Caused by: lock file version 4 requires -Znext-lockfile-bump This error was gotten while i tried to run the ...
totdking's user avatar
0 votes
0 answers
40 views

Duplicate lang item in crate `std` (which `once_cell` depends on): `panic_impl` [closed]

I have no duplicate crates, all versions point to the same revision of polkadot, yet my dapp won't build due to the error in title. I'm pasting Cargo.lock right here, with a link to a full PR of what ...
Jan Jindra Jindráček's user avatar
-1 votes
1 answer
62 views

cargo build not using the right rustc version

This is a noob question but I have just pulled https://github.com/succinctlabs/rsp/ and try to build it but it fails $ cargo build Compiling rsp v0.1.0 (/Users/clementwalter/Documents/rsp/bin/host) ...
ClementWalter's user avatar
-1 votes
1 answer
49 views

How to run Single File Programs in Rust?

I'm trying using Rust in OI (Olympics in Informatics), which only allows submitting Single File Programs. In C++, we can easily use g++ path/to/file.cpp -oout.exe; ./out.exe. But I haven't found a ...
typed-sigterm's user avatar
0 votes
0 answers
23 views

Return an HTTP error response in rust tokio tungstenite

I'm trying to build a websocket server using rust tokio tungstenite. When the user connects, I want them to specify a roomID as a request query parameter. If this roomID parameter does not exist, I ...
Ethan Crabb's user avatar
0 votes
1 answer
51 views

Rust idomatic way to decrementing the value from a map and remove the key when value is 0

Noob to Rust and trying to figure out the idomatic way to decrement the value from a hashmap and remove the corresponding key when the value after decrementing reaches 0. I am doing it like this but ...
nunam's user avatar
  • 37
0 votes
0 answers
28 views

Cargo build using incorrect linker

I'm running into an issue trying to cross compile a simple "hello world". For my use case, I need to build compile a simple application for both x86_64-apple-darwin and aarch64-apple-darwin ...
Podo's user avatar
  • 709
-1 votes
1 answer
89 views

How do I remove the target wasm32-wasi and add the new wasm32-wasip1

When I try to rustup update, I get error: component 'rust-std' for target 'wasm32-wasi' is unavailable for download for channel 'nightly' error: Sometimes not all components are available in any ...
Evan Carroll's user avatar
  • 82.8k
0 votes
1 answer
44 views

Use a different cargo profile for CI

So I recently discovered this neat trick for optimizing compilation times: [profile.dev.package."*"] opt-level = 3 This will make all dependencies optimized to maximum, which improves ...
Haf's user avatar
  • 527
3 votes
1 answer
57 views

How can I debug why a dependency is in my Cargo.lock?

I have mysterious appearance of quinn dependency in Cargo.lock in project which includes request dependency, while I expect it to be not present due to disabled features. It is very easy to reproduce ...
mstyura's user avatar
  • 113
0 votes
1 answer
69 views

How to properly upload files using Rocket?

Looking for some variants how to upload file and meta-data in one request, I find out that I can use multipart/form-data content-type. In rust rocket documentation, I found example where TempFile was ...
Grimlock's user avatar
0 votes
1 answer
43 views

How to link a Rust program with a full path to a static library?

I am using Rust in a Meson based build-system where I build a static library that I need to link to a Rust crate built with Cargo. Right-now I use this environment variable in my Cargo invocation: '...
Devilish Spirits's user avatar
0 votes
0 answers
6 views

How do I stop the following Cargo Build Error

Im getting the following error and was wondering how one is able to fix it enter error: invalid table header duplicate key package in document root --> Cargo.toml:21:1 | 21 | [package] | ^ | PS C:\...
Thewsthews's user avatar
2 votes
1 answer
65 views

Why does Rust include dev-only features as part of a release build?

I've made a simplified example of my question in this github repo: https://github.com/JackSpagnoli/rust_features I have a library "auth" handling api authentication, which in prod I would ...
JackSpagnoli's user avatar
1 vote
0 answers
45 views

Is there a way to customize target folder for Tauri build

By default, cargo tauri build build the target bundle at the root_project_direct/target folder. But is there a way to customize the path ?Since the project folder is in a temp folder on CI and being ...
J_yang's user avatar
  • 2,812
2 votes
1 answer
30 views

cargo_toml and embuild versions don't match

This is my cargo.toml file [package] name = "thingspeak-example" version = "0.1.0" authors = ["Sergio Gasquez <[email protected]>"] edition = "2021"...
Jutta Eilander's user avatar
0 votes
1 answer
98 views

How to use a different source for a cargo dependency under miri

My project depends on the bitvec crate (crate knowlege not required for question). This crate is unfortunately not very actively maintained and has a few issues under miri. A gracious soul has fixed ...
ChrisB's user avatar
  • 3,684
0 votes
1 answer
56 views

Cargo registry auth: Unable to login/publish to private cargo repo in JFrog Artifactory

I'm trying to publish a cargo pkg to federated cargo repository configured in Jfrog artifactory using cargo cli. I get a 401 when I try to publish via cargo publish command from my local machine `...
Hansraj Mathakar's user avatar
0 votes
0 answers
21 views

Loosen overly specific transitive dependency requirement in Cargo.toml [duplicate]

Consider the following dependency situation. My crate depends on two other crates, parser-foo and parser-bar, both of which depend on parser-core. The parser-core crate links to a native library, so ...
pintoch's user avatar
  • 2,458
0 votes
0 answers
24 views

Add target specific rustc flags when building "std"

I'm trying add a new target in rustc and I need to provide a separate search path to a directory which contains native artifacts (such as static libraries or crt*) that are needed for linking for the ...
Marius Melzer's user avatar
0 votes
1 answer
70 views

Why doesn't clippy report all pedantic warnings in a Cargo workspace? [duplicate]

I have a Rust workspace crate for Rust 1.82.0. The configuration for Clippy resides inside the Cargo.toml. The configuration section for Clippy looks as follows: [workspace.lints.rust] ...
Max Görner's user avatar
1 vote
0 answers
60 views

Dynamically changing underlying crate code depending on cargo features

I have a rust workspace which looks like the following: * program_a * libloragw - features = [ manufacturer_a ] * dependency_a * libloragw * program_b * libloragw - features = [ ...
Matt's user avatar
  • 57
0 votes
1 answer
94 views

Cargo failed to load source dependency, virtual manifest

I'm new to Rust/Cargo and been struggling to address an issue when compiling a new Yocto recipe for gst-plugins-rs, the Cargo.toml file can be found in this directory structure. ../gstreamer1.0-...
kengineer's user avatar
0 votes
1 answer
205 views

cargo build error : error: linking with `cc` failed: exit status: 1 on Macbook AIr M2

I am attempting to run and building my rust code, I built the sample rust project using cargo new sampleProject, and then attempted to run it using cargo run and cargo build, both of which are failing,...
Ayan Das's user avatar
0 votes
2 answers
70 views

Failed to resolve polars_core, arrow::legacy, Dataframe is polars-lazy = "0.44.2"

Despite the: reading of the polar_lazy 0.44.2 sucessful installation of cargo add polars-lazy the following code results in errors: error[E0433]: failed to resolve: could not find legacy in arrow ...
dark.vador's user avatar
1 vote
1 answer
47 views

Openvino library runtime conflict in cargo workspace

I think I have a linker conflict happening in my cargo workspace. Some context: My workspace consists of 3 crates: engine: Rust crate that calls a C++ application via ffi engine_rs: complete rust ...
Fabrício Dematte's user avatar
0 votes
0 answers
18 views

How do I convert a virtual manifest into a package manifest? [duplicate]

This is almost a duplicate of existing questions about the error message below, but not quite. I have a Cargo.toml that contains the line: wgpu = "22.1" and everything works just fine. But ...
Frank Yellin's user avatar
  • 11.1k
0 votes
1 answer
73 views

How to test web REST server [closed]

I'm currently writing a REST web server with Rust. I'm using "reqwest" to test the REST API. To get these tests running, I need to have an instance of the server running. If I launch it ...
Serge Weinstock's user avatar
0 votes
0 answers
69 views

How to I tell cargo to use a custom build target?

I am currently following this tutorial on making a simple rust OS. As the author instructs, I created a json file named x86_64-simple_os.json with the following contents: { "llvm-target":...
Duncan McPherson's user avatar
0 votes
0 answers
31 views

VFP register args linker errors while compiling a rust binary for ARMv7/Cortex-A9

I just recently started messing around with cross compilation and playing around with ARM in general, so I am pretty sure there is something I am missing here. I am trying to see if I can compile the ...
Reynevan's user avatar
  • 1,545
1 vote
2 answers
84 views

Rust version for dependencies

I am new to Rust. I try to build an example project using a dependency actix-web = "3.3.2" I must use Rust 1.59.0, as an older Yocto Linux version manages the build, which only has that ...
loczaj's user avatar
  • 51
0 votes
0 answers
61 views

'Cargo install cargo-php' giving - linking with `cc` failed: exit status: 1

Rustc --version rustc 1.78.0 (9b00956e5 2024-04-29) cargo --version cargo 1.78.0 (54d8815d0 2024-03-26) OS - On WSL - Ubuntu 22.4 I am running the command Cargo install cargo-php And it throws the ...
user2723464's user avatar
1 vote
1 answer
150 views

Unable to resolve wasm-bindgen dependency conflict

I'm using Tauri v2. I'm trying to add the amazing photon_rs crate for image manipulation. When I run cargo run I can see there's a version conflict with wasm-bindgen: Updating crates.io index error: ...
Jamis Charles's user avatar
0 votes
1 answer
50 views

Using rust features as a build flag

I'm trying to use the features of a Cargo.toml file to conditionally set a property at build time. I do this so that I can have some slight differences for the build intended for integration testing. #...
Freddie Hands's user avatar
1 vote
1 answer
82 views

Is it possible to enable a specific feature when another feature is disabled?

I have the following: comfy-table = { version = "7.1.1", default-features = false } [features] wasm = [] I want: when the wasm feature is not enabled the feature tty in comfy-table should ...
Raz Luvaton's user avatar
  • 3,740
0 votes
0 answers
50 views

can't find crate for `alloc` in rust [duplicate]

rustc 1.84.0-nightly (662180b34 2024-10-20) a minimal reproducible is here : minimal_reproducible https://github.com/Horc-zh/-minimal_reproducible I use the alloc crate in my lib.rs like this: lib.rs: ...
horc's user avatar
  • 1
-1 votes
1 answer
82 views

variable ownership in rust [duplicate]

I'm new rust language. I tried to understand the concept of ownership and borrow. let mut s = String::from("hello"); { s.push_str(" world"); let mut r1 = &mut s; ...
Abinaya Perumal's user avatar
0 votes
0 answers
46 views

Conditially enable code in Rust with feature flag by including dependency using git

I've tried importing a Rust library using a feature flag with git dependency. But that doesn't seem to enable the code using CFG annotations in the code but when using the regular library through ...
Marcus Cvjeticanin's user avatar
1 vote
0 answers
85 views

Can anything in Rust be turned into or from bytes?

I am creating a protocol simulation and research tool made with Rust as a library for Python through maturin and Pyo3. I´m relying on different crates that implement protocols in a secure way, but I ...
AthraelBB's user avatar
3 votes
1 answer
74 views

What are the semantics of an underspecified exact version pin in Cargo?

Consider an entry in the [dependencies] section of Cargo.toml file as follows: [dependencies] thingy = "=1.2" So, this is a comparison requirement, and it is an "equals" ...
acm's user avatar
  • 12.7k
0 votes
0 answers
20 views

Rust contract DispatchError

I have a RUST contract to stake and unstake coins. I am able to stake multiple times but I am able to unstake only once as soon as the contract is deployed then I am getting contract is trapped error ....
gauthami vijay's user avatar
1 vote
0 answers
48 views

Is there a way to specify a compiler flag for specific target-triple in Cargo.toml?

I'd like to pass a compiler flag for a specific target. For example, there are target-feature flags that are specific to a processor like target-feature="+popcnt". I want to pass this flag ...
A. K.'s user avatar
  • 37.8k
0 votes
1 answer
507 views

Error while installing jupyter notebook with pip: Preparing metadata (pyproject.toml) did not run successfully

error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Cargo, the Rust package manager, is not installed or is ...
JustCode's user avatar
0 votes
0 answers
49 views

usocket error: Error: EBADF error in Node.js when connect with Rust code

I am doing socket programming between Rust and Node.js and for that Node.js code is engine code and below is the Rust code. But when I try to run the Rust code I am getting error like Error: EBADF in ...
tuhin panda's user avatar
0 votes
0 answers
78 views

Unable to create Rust flamegraphs using Criteriion and Pprof on Mac

I am trying to set up criterion and pprof on a Rust library to generate flamegraphs. I was mainly following this guide https://www.jibbow.com/posts/criterion-flamegraphs/ I followed this example on ...
Arun's user avatar
  • 51
1 vote
0 answers
78 views

How to patch a Cargo git dependency that contains a workspace

I'm trying to automatically vendor sources for Cargo packages/crates for offline installation. For "crates-io" this is easily done with a replace-with = "vendored-sources" in the ....
Flamefire's user avatar
  • 5,777
0 votes
1 answer
63 views

RUST curl : Unable to connect to the remote server

I am new to rust . Trying make a simple backend with RUST. But I am getting this error again and again. Tried to solve this with the help of resources. this is my main.rs use actix_web::{web::Path, ...
Shorna's user avatar
  • 1

1
2 3 4 5
49