-
Notifications
You must be signed in to change notification settings - Fork 333
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
Add feature "disable_idna" #836
Conversation
So, I'm less and less convinced that this is a direction we want to pursue. |
☔ The latest upstream changes (presumably b33514a) made this pull request unmergeable. Please resolve the merge conflicts. |
Rather than adding all this to the url crate, instead I suggest patching out idna as suggested earlier.
This avoids adding any spec incompatible flag to this crate. |
I don't think patch works with published crates. If I can't get rid of the heavy IDNA dependency in my published project, that doesn't seems like a useful workaround. |
I've written an alternative to this for
Edit, after further experimenting: The big gotcha with the Windows APIs is that you can't control whether IDNA2003 or IDNA2008 is used – it's tied to the OS version:
Even on Windows 11 23H2 (which should apply IDNA2008+UTS46 rules), There are a lot of other failures, and canonical examples in the IDNA spec (used in I have a branch of |
With |
This has a fairly colorful history.
The
idna
dependency was first made optional in #728, and then reverted in #790. This PR introduces a feature flag to opt-in to ASCII-only domain support, as suggested in #790 (comment). It partially reverts #790.Unfortunately, this opt-in method is less robust than using a default-enabled feature and making
idna
optional (#728) becauseidna
is always built. It is trivial for future changes to accidentally linkidna
unconditionally, making thedisable_idna
feature a no-op.In my testing, using this feature flag saves around 235 KiB in the produced binary in release mode on Windows x86_64 builds. (Side note: Windows builds with VS are "always stripped", and debug symbols are provided in a separate pdb file. For everything else, the binary
Cargo.toml
can includestrip = "symbols"
in the release profile.) The feature was originally requested for WASM, and binary size deltas should be in the same ballpark with that arch.