You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compilation error with url 2.5.3 / idna 1.0.3 with Rust < 1.81 and edition 2021 (resolver 2) when sqlx-core < 0.8.3 is in the dependency graph #992
url 2.5.3 (and idna 1.0.3) conditionally raising MSRV to 1.81 when default features are off (from no_std support for the url crate #831). Conditionally raising MSRV to 1.81 is not a semver break, because raising MSRV isn't a semver break.
resolver = "2", which is implied by edition = "2021" performing feature resolution for proc macro dependencies separately from normal dependencies, so a normal dependency on url with default features enabled does not cause default features to be enabled for the proc macro case.
Original report follows:
Note that this crate implements the URL Standard not RFC 1738 or RFC 3986
Describe the bug
After update to v1.0.3 wich is picked up automatically since its a patch upgrade, our code no longer compiles the same.
rust versions tested:
rustc 1.80.1
rustc 1.81.0
Compiling idna v1.0.3
error[E0658]: use of unstable library feature 'error_in_core'
--> /home/krille/.cargo/registry/src/index.crates.io-6f17d22bba15001f/idna-1.0.3/src/lib.rs:78:6
|
78 | impl core::error::Error for Errors {}
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #103765 <https://github.com/rust-lang/rust/issues/103765> for more information
Reacted by Semen Loktionov, Andrew Sturza, Alfred.Liu, Marco Conte, Kevin Zimmerman, Kieran Shanley, Koji Tanaka, Yang Xiaowei, Luke Campbell, Fernando Mendez and 5 more
url 2.5.0 and url 2.5.2 depended on idna 0.5. url 2.5.1 depended on idna 1.0.
The introduction of no_std support to url in 2.5.3 and the introduction of core::error::Error to idna in 1.0.3 was intended not to change MSRV to 1.81 with default features but was expected to change MSRV to 1.81 for default-features = false users.
Do you somehow have url 2.5.1 in your dependency graph? Can you force Cargo to take url 2.5.3 in its place?
Oh sorry, I am currently forcing our software to take 2.5.0, since 2.5.3 does not compile. Updated the previous comment to show that the cargo tree command showed 2.5.3
So if you have url 2.5.3 without features and url 2.5.3 with the feature std, Cargo should unify those to one copy of url with the feature std. Are you sure the edited comment about cargo tree is correct?
Aside: This isn't specific to idna. If I use Rust 1.80.1 with:
As long as something in your dependency graph depends on url without setting default-features = false, something else setting default-features = false shouldn't matter.
@Twixes, GitHub autolinks a couple of your changesets referencing this issue. Do you have minimized steps to reproduce?
changed the title [-]Compilation error with url 2.5.3 / idna 1.0.3 with Rust < 1.81 and edition 2021 (resolver 2) when sqlx-core is in the dependency graph[/-][+]Compilation error with url 2.5.3 / idna 1.0.3 with Rust < 1.81 and edition 2021 (resolver 2) when sqlx-core < 0.8.3 is in the dependency graph[/+]on Jan 7, 2025
I edited the guidance at the top of this issue page to suggest updating SQLx to 0.8.3.
SQLx 0.8.3 was released only 4 days ago, so I'm leaving this issue open for a while so that people whose projects are affected are more likely to find it. Perhaps a couple of weeks is enough and then we can close this.
Activity
[-]Compilation error with update to 1.0.3[/-][+]Compilation error with update to idna 1.0.3[/+]valenting commentedon Nov 4, 2024
@TotalKrill
Is your crate depending on idna directly with default-features = false.
Or is the issue url failing to propagate the std feature to idna?
TotalKrill commentedon Nov 4, 2024
We are depending on url, not idna directly
TotalKrill commentedon Nov 4, 2024
@valenting seems i was wrong about 1.81.0, seems to work there...
hsivonen commentedon Nov 4, 2024
Are you depending on
urlwithdefault-features = false?I tried to repro on 1.80.1, and the following compiles:
rustup default 1.80 cargo new --bin testurl cd testurl cargo add url cargo buildTotalKrill commentedon Nov 4, 2024
we have a workspace, but we only depend on url like this:
url = "2.5.0"TotalKrill commentedon Nov 4, 2024
running
cargo tree -i url -f "{p} {f}"this is what our tree ends up including, with two different versions of URL included, probably by one of our other deps.
Edit: I meant version 2.5.3, 2.5.0 is the version that compiles
hsivonen commentedon Nov 4, 2024
url2.5.0 andurl2.5.2 depended onidna0.5.url2.5.1 depended onidna1.0.The introduction of
no_stdsupport tourlin 2.5.3 and the introduction ofcore::error::Errortoidnain 1.0.3 was intended not to change MSRV to 1.81 with default features but was expected to change MSRV to 1.81 fordefault-features = falseusers.Do you somehow have
url2.5.1 in your dependency graph? Can you force Cargo to takeurl2.5.3 in its place?TotalKrill commentedon Nov 4, 2024
Oh sorry, I am currently forcing our software to take 2.5.0, since 2.5.3 does not compile. Updated the previous comment to show that the cargo tree command showed 2.5.3
hsivonen commentedon Nov 4, 2024
So if you have
url2.5.3 without features andurl2.5.3 with the featurestd, Cargo should unify those to one copy ofurlwith the featurestd. Are you sure the edited comment aboutcargo treeis correct?Aside: This isn't specific to idna. If I use Rust 1.80.1 with:
...
idnacompiles and the compilation ofurlfails with a complaint aboutimpl core::error::Error for ParseError {}inurl.TotalKrill commentedon Nov 4, 2024
yep, my edited comment stands. But with what you say, something else might be changing to
default-features = falsehsivonen commentedon Nov 4, 2024
As long as something in your dependency graph depends on
urlwithout settingdefault-features = false, something else settingdefault-features = falseshouldn't matter.@Twixes, GitHub autolinks a couple of your changesets referencing this issue. Do you have minimized steps to reproduce?
valenting commentedon Nov 4, 2024
I think
cargo tree -e featuresmight explain if there's such a dependency conflict.25 remaining items
Update ureq to latest to address vulnerability in idna (#1848)
chore: update seaorm to latest (#4925)
Temporarily ignore RUSTSEC-2024-0421
Temporarily ignore RUSTSEC-2024-0421
Temporarily ignore RUSTSEC-2024-0421
[-]Compilation error with url 2.5.3 / idna 1.0.3 with Rust < 1.81 and edition 2021 (resolver 2) when sqlx-core is in the dependency graph[/-][+]Compilation error with url 2.5.3 / idna 1.0.3 with Rust < 1.81 and edition 2021 (resolver 2) when sqlx-core < 0.8.3 is in the dependency graph[/+]hsivonen commentedon Jan 7, 2025
I edited the guidance at the top of this issue page to suggest updating SQLx to 0.8.3.
SQLx 0.8.3 was released only 4 days ago, so I'm leaving this issue open for a while so that people whose projects are affected are more likely to find it. Perhaps a couple of weeks is enough and then we can close this.
hsivonen commentedon Feb 12, 2025
It's been more than a couple of weeks.
chore: update seaorm to latest (#4925)
build(deps): bump sqlx to 0.8.3
fix: ignore url >=2.5.3 in dependabot due to idna compatibility
chore: upgrade MSRV to Rust 1.81.0