Skip to content

rustc: Append platform exe suffix to output files #15869

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

Merged
merged 1 commit into from
Jul 22, 2014

Conversation

alexcrichton
Copy link
Member

Closes #15828

@lilyball
Copy link
Contributor

How does this behave if the -o flag is provided? Also, is this the correct fix? It seems odd to me that you'd have to add logic like this to get filename printing to work, when it manages to generate the correct filename during compilation.

Looking at driver/mod.rs, it looks like printing the filename calls filename_for_input() with &t_outputs.with_extension("") as the output filename. Is the removal of the extension there not perhaps the real culprit?

@alexcrichton
Copy link
Member Author

How does this behave if the -o flag is provided?

This method is not called if -o is provided

Also, is this the correct fix? It seems odd to me that you'd have to add logic like this to get filename printing to work, when it manages to generate the correct filename during compilation.

The windows linker we use translates -o foo to "oh, you mean -o foo.exe", which is why we produce .exe files. This is moving that logic into the compiler.

Is the removal of the extension there not perhaps the real culprit?

Nah that part is just chopping off the extension so the right one can be added later.

bors added a commit that referenced this pull request Jul 22, 2014
@bors bors closed this Jul 22, 2014
@bors bors merged commit 6ebbc6c into rust-lang:master Jul 22, 2014
@liigo
Copy link
Contributor

liigo commented Jul 23, 2014

Q: How does this behave if the -o flag is provided?
A: This method is not called if -o is provided

This is not true. rustc -o hello2.xxx hello.rs will create file hello2.xxx,
but rustc -o hello2.xxx --print-file-name hello.rs prints hello2.exe.
@alexcrichton

@alexcrichton alexcrichton deleted the issue-15828 branch July 23, 2014 15:18
@alexcrichton
Copy link
Member Author

Could you open a bug on that? In general -o mixed with different names causes all sorts of weirdness.

@liigo
Copy link
Contributor

liigo commented Jul 24, 2014

#15935 if i didn't misunderstand.

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.

rustc --print-file-name doesn't print ".exe" on Windows
4 participants