-
Notifications
You must be signed in to change notification settings - Fork 6
Readiness: Baseline Makefile.toml sync from patina-readiness-tool #62
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
base: main
Are you sure you want to change the base?
Readiness: Baseline Makefile.toml sync from patina-readiness-tool #62
Conversation
fe65ac7 to
3bf0c2f
Compare
| description = "Builds the Windows aarch64 DXE Readiness Validation binary." | ||
| condition = { platforms = ["windows"]} | ||
| command = "cargo" | ||
| args = [ "build", "-p", "dxe_readiness_validator", "@@split(AARCH64_STD_WINDOWS_TARGET, )", "${@}", ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this possible? Cross compilation support when it comes to target triples where there is an "STD" that relies on the operating system (e.g. a target triple with an OS) is not exactly supported from my understanding.
e.g. I can't really compile an aarch64-unknown-linux target on a aarch64-pic-windows-msvc target).
Seems like you should just not specify a target and let the compiler auto pick the host target.
Just have a generic build-validation-host-binary
If you need to set some feature flags or something based off the target tripple then you could not specify the target, then have a duckscript use the CARGO_MAKE_RUST_TARGET_TRIPLE to set feature flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then CI would just compile a different target of the binary based off the host its being run on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is that, without explicitly specifying the target triple, the host binaries are produced under target/debug/... instead of target/<triple>/debug. This is usually not a problem for a normal development workflow, but if we want to release all flavors of host binaries (x64 and aarch64) using a workflow like .github/workflows/publish-binaries.yml, I am not sure how to identify each flavor when copying the artifacts.
cp target/x86_64-pc-windows-msvc/debug/dxe_readiness_validator.exe artifacts/validator/dxe_readiness_validator.exe
cp target/x86_64-pc-windows-msvc/debug/dxe_readiness_validator.pdb artifacts/validator/dxe_readiness_validator.pdb
cp target/aarch64-pc-windows-msvc/debug/dxe_readiness_validator.exe artifacts/validator/dxe_readiness_validator.exe
cp target/aarch64-pc-windows-msvc/debug/dxe_readiness_validator.pdb artifacts/validator/dxe_readiness_validator.pdb
So the patina-readiness-tool repo already has an explicit way of specifying the target triple for consistency(across platforms/arch), and unfortunately the makefile.toml in patina-devops is out of sync. This is being addressed in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I see two routes -
- Have a duckscript call that calls either
rustc -vVorcargo metadata(see below) to grab the target triple, then set the triple so that it goes in the folder
output = exec cargo metadata --format-version 1 --no-deps --manifest-path ${repo}/Cargo.toml
if not eq ${output.code} 0
echo "Error running cargo metadata on ${repo}"
exit 1
end
metadata = json_parse --collection ${output.stdout}
- do the copying based off the image in the github workflow. e.g. if the workflow is running on windows-x86 image then copy it to the right target triple folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a big fan of duck script 😄 and as mentioned before this is mainly to address below
- To make it consistent for the publish binaries workflow to package the artifacts
- Sync back what we already have in the patina-readiness-tool repo as a baseline.
Signed-off-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
3bf0c2f to
11e19dd
Compare
The Patina Readiness Tool repo comprises multiple binaries with varying degrees of customization to the build and linker flags based on the target and platform. Most of the up-to-date
Makefile.tomlfiles are already in the repo. This is a one-time baseline sync from that repo back topatina-devops.