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

Add -- for files in try_expand (like in #514) #911

Merged
merged 2 commits into from Dec 18, 2023

Conversation

pashokitsme
Copy link
Contributor

Hi!

This PR is very similar with #514 (issue: #513), but for try_expand

I've faced with that issue when i tried to cross-compile macos -> win crate with buildscript that uses embed-resource via cargo-xwin.
For more context: rust-cross/cargo-xwin#86

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

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

LGTM

.find_map(AsmFileExt::from_path)
.is_some();

if compiler.family == (ToolFamily::Msvc { clang_cl: true }) && !is_asm {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry but I do wonder why !is_asm is needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't 100% sure its needed. But since !is_asm is added in PR #747 (continuation of #514?), so i added it here too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

#747 uses is_assembler_msvc instead of just. is_assembler though:

let msvc = target.contains("msvc");
let is_assembler_msvc = msvc && asm_ext == Some(AsmFileExt::DotAsm);

So it will add -- as long as the target is not msvc, not sure which version is better.

IMO if compiler.family is msvc clang-ci then it's probably a MSVC target.

@NobodyXu NobodyXu merged commit 802399f into rust-lang:main Dec 18, 2023
17 checks passed
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.

None yet

2 participants