Skip to content

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 <tcrawford@system76.com>
@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