Skip to content

fix(sys): link to iphlpapi unconditionally#643

Merged
ehuss merged 1 commit intoalexcrichton:mainfrom
weihanglo:fix
Mar 30, 2026
Merged

fix(sys): link to iphlpapi unconditionally#643
ehuss merged 1 commit intoalexcrichton:mainfrom
weihanglo:fix

Conversation

@weihanglo
Copy link
Copy Markdown
Contributor

@weihanglo weihanglo commented Mar 28, 2026

Upstream has done that so we follow:

  1. windows: reduce/stop loading DLLs at runtime curl/curl#17413 preloads iphlpapi conditioned on HAVE_IF_NAMETOINDEX
  2. curl/curl@b17ef873 HAVE_IF_NAMETOINDEX is defined unconditionally

See rust-lang/rust#154482 which failed without and succeeded with link to iphlpai dll.

This also bumps curl-sys to 0.4.87 to help unblock rust-lang/rust#154482, (of course, if curl-rust maintainers can help release 🙏🏾)

Upstream has done that so we follow:

1. curl/curl#17413 preloads `iphlpapi` uncondiioned on `HAVE_IF_NAMETOINDEX`
2. curl/curl@b17ef873 `HAVE_IF_NAMETOINDEX` is defined unconditionally
@weihanglo
Copy link
Copy Markdown
Contributor Author

cc @ehuss

@ehuss
Copy link
Copy Markdown
Collaborator

ehuss commented Mar 29, 2026

Do you know how to reproduce this? I'm curious why this didn't fail in any other CI builds.

@weihanglo
Copy link
Copy Markdown
Contributor Author

I thought it was something related to gc-section, but I was wrong. It passed 🥲 #644

@weihanglo
Copy link
Copy Markdown
Contributor Author

cargo with all-static under release profile also failed to reproduce

weihanglo/cargo#89

I am still trying to figure out anything special in rust-lang/rust CI

@weihanglo
Copy link
Copy Markdown
Contributor Author

weihanglo/cargo#89 is now failing when raw-dylib is in use.

I still need to double check whether bootstrap builds Cargo with raw-dylib though

@weihanglo
Copy link
Copy Markdown
Contributor Author

If I understand correctly, raw-dylib is very likely the culprit.

Copy link
Copy Markdown
Collaborator

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks! It's a little strange, but I think I gather this is due to behavior in the windows-sys and windows-link crates, and those crates no longer including everything with the windows_raw_dylib cfg.

@ehuss ehuss merged commit 10faafd into alexcrichton:main Mar 30, 2026
13 checks passed
@weihanglo weihanglo deleted the fix branch March 30, 2026 14:50
weihanglo added a commit to weihanglo/cargo that referenced this pull request Mar 30, 2026
See

* alexcrichton/curl-rust#643
* rust-lang/rust#154482 (comment)

This will unblock cargo submodule update in rust-lang/rust
github-merge-queue Bot pushed a commit to rust-lang/cargo that referenced this pull request Mar 30, 2026
### What does this PR try to resolve?

See

* alexcrichton/curl-rust#643
* rust-lang/rust#154482 (comment)

This will unblock cargo submodule update in rust-lang/rust
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

Successfully merging this pull request may close these issues.

2 participants