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

Set link args in build script #50

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Set link args in build script #50

merged 1 commit into from
Dec 19, 2024

Conversation

crawfxrd
Copy link
Member

@crawfxrd crawfxrd commented Dec 15, 2024

While working on converting our UEFI images to a workspace I found that the cargo configuration file cannot be used. config.toml is a project-level configuration. It will only be read from the current directory and up, and not in:

  • package directories in a workspace
  • package directory when --manifest-path is used

Use build.rs instead, which will be executed before the package is built and only apply the flags for the specific package.

Ref: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure
Ref: https://doc.rust-lang.org/cargo/reference/build-scripts.html

Test

  • Build with --verbose added to cargo command and verify linker scripts are still applied.
  • file target/x86_64-unknown-uefi/release/system76_firmware_setup.efi still reports binary as EFI boot service driver.

@crawfxrd crawfxrd requested review from a team December 15, 2024 23:47
While working on converting our UEFI images to a workspace I found that
the cargo configuration file cannot be used. `config.toml` is a
*project*-level configuration. It will only be read from the current
directory and up, and not in:

- package directories in a workspace
- package directory when `--manifest-path` is used

Use `build.rs` instead, which will be executed before the package is
built and only apply the flags for the specific package.

Ref: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure
Ref: https://doc.rust-lang.org/cargo/reference/build-scripts.html
Signed-off-by: Tim Crawford <[email protected]>
@crawfxrd crawfxrd merged commit 67d63a7 into master Dec 19, 2024
1 check passed
@crawfxrd crawfxrd deleted the build-script branch December 19, 2024 18:15
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.

2 participants