-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?

  • You can't; `0.7.3` is not [semver compatible](https://doc.rust-lang.org/cargo/reference/resolver.html#semver-compatibility) with `0.6.7`, and so `neon-runtime` would complain about an incompatible version. You can only update it together with `neon-runtime`, once `neon-runtime` was updated to `libloading v0.7.x`. – Finomnis Jun 01 '23 at 13:31

1 Answers1

0

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

IcyTv
  • 405
  • 4
  • 12