Skip to content

Compile html5ever error due to duplicate dylib dependency match_token found #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Wyvern opened this issue Mar 26, 2025 · 4 comments
Open

Comments

@Wyvern
Copy link

Wyvern commented Mar 26, 2025

Compiling this package got error like below:

error[E0464]: multiple candidates for `dylib` dependency `match_token` found
  --> index.crates.io-1949cf8c6b5b557f/html5ever-0.30.0/src/tree_builder/rules.rs:26:5
   |
26 | use match_token::match_token;
   |     ^^^^^^^^^^^
   |
   = note: candidate #1: /opt/Rust/build-dir/debug/deps/libmatch_token-5d0c89fad2624480.dylib
   = note: candidate #2: /opt/Rust/build-dir/debug/deps/libmatch_token-e28b43c968873f22.dylib

Tried clean && rebuild, it doesn't work.
How to fix ?

@jdm
Copy link
Member

jdm commented Apr 4, 2025

I have never seen this error before, sorry. Is it possible you have multiple match_token copies in your Cargo.lock?

@Wyvern
Copy link
Author

Wyvern commented Apr 5, 2025

NO.
either delete/re-generate Cargo.lock or Clean and rebuild the project not work.

@Wyvern
Copy link
Author

Wyvern commented Apr 5, 2025

I guess it's related to different [host] and [target.'cfg(all)'] in config.toml build options.

[unstable]
target-applies-to-host = true
host-config = true
[host]
rustflags = [...]
[target.'cfg(all())']
rustflags = [...]

@simonwuelker
Copy link
Contributor

NO. either delete/re-generate Cargo.lock or Clean and rebuild the project not work.

Weird, I can't reproduce this with either of these steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants