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

Return .efi extension for EFI executable #104158

Merged
merged 1 commit into from
Nov 14, 2022
Merged

Conversation

Ayush1325
Copy link
Contributor

Originally part of #100316

Signed-off-by: Ayush Singh ayushsingh1325@gmail.com

Originally part of rust-lang#100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
@rustbot
Copy link
Collaborator

rustbot commented Nov 8, 2022

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2022
Copy link
Contributor

@dvdhrm dvdhrm left a comment

Choose a reason for hiding this comment

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

The uefi targets already contain exe_suffix = ".efi", so this syncs up nicely. Looks good!

format!("{}.efi", name)
} else {
name.to_string()
}
Copy link
Member

@bjorn3 bjorn3 Nov 9, 2022

Choose a reason for hiding this comment

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

An option would be to use the output of rustc --print file-names --crate-name {name} --crate-type bin, but that might be a cyclic dependency if this function is used to find the path to the rustc executable. See for example https://github.com/bjorn3/rustc_codegen_cranelift/blob/0b37af8c6168f11221ba74115eb3c5725fd13c3c/build_system/rustc_info.rs#L46-L74

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I see, this function is used with a lot of binaries instead of crates, so I don't think rustc --print file-names --crate-name {name} --crate-type bin can be used at all places where exe is currently being used.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, if the binary name contains a -, it won't work. Cargo uses ____ as crate name once and then replaces the ____ in the output with the binary name every time. That should work I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

This feels a bit awkward regarding cyclic dependencies, doesn't it? Even if you fetch a stage from an external source, this stage will not reflect the last build, so this function will be out-of-sync with the source it builds. Not necessarily a big issue, but maybe requires a bit more investigation. Not sure it is worth blocking this change on it?

Copy link
Member

Choose a reason for hiding this comment

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

Ideally you should ask the rustc binary that actually does the compilation for the artifact of which you want the filename. I do agree that it isn't worth blocking this change on.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 13, 2022

📌 Commit 758868c has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 13, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 14, 2022
…earth

Rollup of 9 pull requests

Successful merges:

 - rust-lang#103709 (ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0)
 - rust-lang#103744 (Upgrade cc for working is_flag_supported on cross-compiles)
 - rust-lang#104105 (llvm: dwo only emitted when object code emitted)
 - rust-lang#104158 (Return .efi extension for EFI executable)
 - rust-lang#104181 (Add a few known-bug tests)
 - rust-lang#104266 (Regression test for coercion of mut-ref to dyn-star)
 - rust-lang#104300 (Document `Path::parent` behavior around relative paths)
 - rust-lang#104304 (Enable profiler in dist-s390x-linux)
 - rust-lang#104362 (Add `delay_span_bug` to `AttrWrapper::take_for_recovery`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7c67cb2 into rust-lang:master Nov 14, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 14, 2022
@Ayush1325 Ayush1325 deleted the executable branch November 14, 2022 11:16
@workingjubilee workingjubilee added the O-UEFI UEFI label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-UEFI UEFI S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants