Skip to content
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

windows_registry: add api which accepts just the target arch #1265

Closed
bjorn3 opened this issue Nov 3, 2024 · 2 comments · Fixed by #1285
Closed

windows_registry: add api which accepts just the target arch #1265

bjorn3 opened this issue Nov 3, 2024 · 2 comments · Fixed by #1285

Comments

@bjorn3
Copy link
Member

bjorn3 commented Nov 3, 2024

Currently rustc has to pass the actual value of the --target argument to cc::windows_registry::find_tool, making it one of the only places in rustc where the name of the target matters rather than the contents of the target. This also for example means that if you take the target spec of x86_64-pc-windows-msvc and put it in a file called aarch64-foo.json, rustc will incorrectly try to find a linker for aarch64. Or more realistically if you name it foo.json, rustc will not know which target to find a linker for even though the target spec itself contains the architecture to compile for.

@madsmtm
Copy link
Collaborator

madsmtm commented Nov 3, 2024

Perhaps we could also change it to take either just the arch, or a full target triple? And then deprecate the former?

@NobodyXu
Copy link
Collaborator

NobodyXu commented Nov 4, 2024

Maybe we should split that part into a separate crate?

I feel like it is not exactly part of cc, just put it in cc for convenience, and sometimes we might want to change its API.

If we are going to put it in a separate crate though, we probably want to do the same for other parts of cc-rs as well, which will also improve compile-time.

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 a pull request may close this issue.

3 participants