Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow #[link(kind = "dylib")] without a name #131966

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisDenton
Copy link
Member

@ChrisDenton ChrisDenton commented Oct 20, 2024

This PR allows #[link(kind = "dylib")] without a library name (see the dllimport RFC for how this affects extern {} blocks).

This will need a lang fcp but I wanted to investigate how feasible this is. I want a bare kind to act the same as any other #[link] for the purposes of applying (or not) dllimport so the kind gets added to the same NativeLib array. However, this then means they need to be filtered out from normal queries. To facilitate this I've added a wrapper type for the NativeLib container and a separate query for is_dllimport.

try-job: x86_64-msvc
try-job: x86_64-mingw

@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 20, 2024
@rust-log-analyzer

This comment has been minimized.

@ChrisDenton
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 20, 2024
Allow #[link(kind = "dylib")] without a name

This PR allows `#[link(kind = "dylib")]` without a library name (see the [dllimport RFC](https://rust-lang.github.io/rfcs/1717-dllimport.html) for how this affects `extern {}` blocks).

This will need a lang fcp but I wanted to investigate how feasible this is. I want a bare `kind` to act the same as any other `#[link]` for the purposes of applying (or not) dllimport so it gets added to the same array. However, this then means they need to be filtered out from normal queries. To facilitate this I've added a wrapper type for the `NativeLib` container and a separate query for `is_dllimport`.

try-job: x86_64-msvc
try-job: x86_64-mingw
@bors
Copy link
Contributor

bors commented Oct 20, 2024

⌛ Trying commit 701594c with merge d23d8b4...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 20, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2024
@ChrisDenton
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 20, 2024
Allow #[link(kind = "dylib")] without a name

This PR allows `#[link(kind = "dylib")]` without a library name (see the [dllimport RFC](https://rust-lang.github.io/rfcs/1717-dllimport.html) for how this affects `extern {}` blocks).

This will need a lang fcp but I wanted to investigate how feasible this is. I want a bare `kind` to act the same as any other `#[link]` for the purposes of applying (or not) dllimport so it gets added to the same array. However, this then means they need to be filtered out from normal queries. To facilitate this I've added a wrapper type for the `NativeLib` container and a separate query for `is_dllimport`.

try-job: x86_64-msvc
try-job: x86_64-mingw
@bors
Copy link
Contributor

bors commented Oct 20, 2024

⌛ Trying commit a1ec55a with merge 3aa983c...

@bors
Copy link
Contributor

bors commented Oct 20, 2024

☀️ Try build successful - checks-actions
Build commit: 3aa983c (3aa983cbdb8aa22ab6c3542102d2bb4eb95b87ac)

@workingjubilee workingjubilee added the O-windows Operating system: Windows label Oct 21, 2024
@petrochenkov
Copy link
Contributor

Does this need a compiler review yet?
(I didn't look in detail yet, but I'm not generally happy about this changing the invariant of native libs having a name.)

@ChrisDenton
Copy link
Member Author

Lang haven't yet considered this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
O-windows Operating system: Windows S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants