admin管理员组

文章数量:1333442

This is my cargo.toml file

[package]
name = "thingspeak-example"
version = "0.1.0"
authors = ["Sergio Gasquez <[email protected]>"]
edition = "2021"
resolver = "2"

[profile.release]
opt-level = "s"

[profile.dev]
debug = true    # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
pio = ["esp-idf-sys/pio"]

[dependencies]
esp-idf-hal = "=0.38"
esp-idf-sys = { version = "=0.31.10", features = ["binstart"] }
esp-idf-svc = { version = "=0.42.5", features = ["experimental", "alloc"] }
embedded-svc = "=0.22"
anyhow = "1.0"
toml-cfg = "0.1"
log = "0.4.17"
# serde_json = "1.0.85"
serde = "1.0.144"
shared-bus = "0.2.4"
shtcx = "0.10.0"
cargo_toml = { version = "0.19.0-beta.1" }

[build-dependencies]
embuild = "0.30"
anyhow = "1"

Every single time that i try to run it i get the following error:

Running `cargo build --bin=thingspeak-example --package=thingspeak-example --message-format=json --color=always`...
    Updating crates.io index
error: failed to select a version for the requirement `cargo_toml = "^0.12"`
candidate versions found which didn't match: 0.20.5, 0.20.4, 0.20.3, ...
location searched: crates.io index
required by package `embuild v0.30.4`
    ... which satisfies dependency `embuild = "^0.30.4"` of package `esp-idf-sys v0.31.10`
    ... which satisfies dependency `esp-idf-sys = "=0.31.10"` of package `thingspeak-example v0.1.0 (/home/jteiland/thingspeak-example)`
if you are looking for the prerelease package it needs to be specified explicitly
    cargo_toml = { version = "0.19.0-beta.1" }
Error: Cargo invocation failed.
        at t.Cargo.getCargoArtifacts (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:10993)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async Object.open (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:9296)
Caused by: Error: exit code: 101.
        at ChildProcess.<anonymous> (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:12660)
        at ChildProcess.emit (node:events:519:28)
        at maybeClose (node:internal/child_process:1105:16)
        at ChildProcess._handle.onexit (node:internal/child_process:305:5)

How can I resolve this to ensure I have the correct versions?

I have already tried to delete the file and generate it again. I also have started all over.

The code that I want want to make working is accessible here

This is my cargo.toml file

[package]
name = "thingspeak-example"
version = "0.1.0"
authors = ["Sergio Gasquez <[email protected]>"]
edition = "2021"
resolver = "2"

[profile.release]
opt-level = "s"

[profile.dev]
debug = true    # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
pio = ["esp-idf-sys/pio"]

[dependencies]
esp-idf-hal = "=0.38"
esp-idf-sys = { version = "=0.31.10", features = ["binstart"] }
esp-idf-svc = { version = "=0.42.5", features = ["experimental", "alloc"] }
embedded-svc = "=0.22"
anyhow = "1.0"
toml-cfg = "0.1"
log = "0.4.17"
# serde_json = "1.0.85"
serde = "1.0.144"
shared-bus = "0.2.4"
shtcx = "0.10.0"
cargo_toml = { version = "0.19.0-beta.1" }

[build-dependencies]
embuild = "0.30"
anyhow = "1"

Every single time that i try to run it i get the following error:

Running `cargo build --bin=thingspeak-example --package=thingspeak-example --message-format=json --color=always`...
    Updating crates.io index
error: failed to select a version for the requirement `cargo_toml = "^0.12"`
candidate versions found which didn't match: 0.20.5, 0.20.4, 0.20.3, ...
location searched: crates.io index
required by package `embuild v0.30.4`
    ... which satisfies dependency `embuild = "^0.30.4"` of package `esp-idf-sys v0.31.10`
    ... which satisfies dependency `esp-idf-sys = "=0.31.10"` of package `thingspeak-example v0.1.0 (/home/jteiland/thingspeak-example)`
if you are looking for the prerelease package it needs to be specified explicitly
    cargo_toml = { version = "0.19.0-beta.1" }
Error: Cargo invocation failed.
        at t.Cargo.getCargoArtifacts (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:10993)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async Object.open (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:9296)
Caused by: Error: exit code: 101.
        at ChildProcess.<anonymous> (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:12660)
        at ChildProcess.emit (node:events:519:28)
        at maybeClose (node:internal/child_process:1105:16)
        at ChildProcess._handle.onexit (node:internal/child_process:305:5)

How can I resolve this to ensure I have the correct versions?

I have already tried to delete the file and generate it again. I also have started all over.

The code that I want want to make working is accessible here

Share Improve this question edited Nov 21, 2024 at 15:33 Aemyl 2,1941 gold badge26 silver badges51 bronze badges asked Nov 20, 2024 at 13:15 Jutta EilanderJutta Eilander 212 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Welcome to dependency hell! First of all, please remove cargo_toml = { version = "0.19.0-beta.1" } from your Cargo.toml. You probably put it there in response to the suggestion from cargo but it is a solution in the wrong direction, because the requirement comes from crates you depend on, not your own Cargo.toml.

Versions of the cargo_toml crate before 0.14.0 have been removed, probably over security concerns. That makes all crates that depend on them fail. To make your project build again, update your dependencies so they include embuild 0.31.1 or higher. You will also need to update at least esp-idf-hal, esp-idf-sys and esp-idf-svc.

If you're stuck, you may want to see if the original author of the code can be of assistance. He will not be able to compile his own code either until the dependencies get updated.

本文标签: dockercargotoml and embuild versions don39t matchStack Overflow