英文:
How can i change the version of a sub dependancy of a crate?
问题
我正在尝试使用wasm32-unknown-unknown
构建一些库,但我遇到了以下错误:
error[E0433]: failed to resolve: use of undeclared crate or module `imp`
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/libloading-0.6.7/src/lib.rs:66:20
我可以使用wasm32-unknown-emscripten
构建,但wasm-pack
不支持它。
所以假设我有以下树结构:
neon_empty
└── neon v0.10.1
├── neon-macros v0.10.1 (proc-macro)
│ ├── quote v1.0.28
│ │ └── proc-macro2 v1.0.59
│ │ └── unicode-ident v1.0.9
│ ├── syn v1.0.109
│ │ ├── proc-macro2 v1.0.59 (*)
│ │ ├── quote v1.0.28 (*)
│ │ └── unicode-ident v1.0.9
│ └── syn-mid v0.5.3
│ ├── proc-macro2 v1.0.59 (*)
│ ├── quote v1.0.28 (*)
│ └── syn v1.0.109 (*)
├── neon-runtime v0.10.1
│ ├── cfg-if v1.0.0
│ ├── libloading v0.6.7 <- 我想将此更改为0.7.3
│ │ └── winapi v0.3.9
│ └── smallvec v1.10.0
├── semver v0.9.0
│ └── semver-parser v0.7.0
└── smallvec v1.10.0
[build-dependencies]
└── neon-build v0.10.1
我该如何做?
英文:
I'm trying to build some libraries using the wasm32-unknown-unknown and I get
error[E0433]: failed to resolve: use of undeclared crate or module `imp`
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/libloading-0.6.7/src/lib.rs:66:20
I can build using the wasm32-unknown-emscripten but it is not supported by wasm-pack.
So lets say that I have the following tree:
neon_empty
└── neon v0.10.1
├── neon-macros v0.10.1 (proc-macro)
│ ├── quote v1.0.28
│ │ └── proc-macro2 v1.0.59
│ │ └── unicode-ident v1.0.9
│ ├── syn v1.0.109
│ │ ├── proc-macro2 v1.0.59 (*)
│ │ ├── quote v1.0.28 (*)
│ │ └── unicode-ident v1.0.9
│ └── syn-mid v0.5.3
│ ├── proc-macro2 v1.0.59 (*)
│ ├── quote v1.0.28 (*)
│ └── syn v1.0.109 (*)
├── neon-runtime v0.10.1
│ ├── cfg-if v1.0.0
│ ├── libloading v0.6.7 <- I want to change this to 0.7.3
│ │ └── winapi v0.3.9
│ └── smallvec v1.10.0
├── semver v0.9.0
│ └── semver-parser v0.7.0
└── smallvec v1.10.0
[build-dependencies]
└── neon-build v0.10.1
How can I do it?
答案1
得分: 1
你需要分叉neon-runtime
,更改libloading
版本,然后在你的Cargo.toml
文件中打补丁:
[patch.crates-io]
neon-runtime = { path = ".." }
# 或者
neon-runtime = { git = ".." }
这是因为(正如@Finomnis指出的)0.6.x和0.7.x不兼容语义版本。
英文:
You'll have to fork neon-runtime
, change the libloading
version and then patch it in your Cargo.toml
file:
[patch.crates-io]
neon-runtime = { path = ".." }
# Or
neon-runtime = { git = ".." }
This is because (as @Finomnis pointed out) 0.6.x and 0.7.x are not semver-compatible
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论