Enable supported release hardening options#7895
Conversation
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/86ec6a3f-e863-4120-80d2-0053630dd7cb Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/86ec6a3f-e863-4120-80d2-0053630dd7cb Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
|
@copilot please enable this CMake flag in the release pipeline, and where the option is defined in CMake, add a comment paragraph describing the various options, a summary of their effect, and a link to their documentation page, wherever it lives. |
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/037f8d1d-810e-4bf8-b065-39391094a066 Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Addressed in 66512af: the release and RPM reproduction CMake invocations now explicitly set |
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-in (default ON) CMake toggle to apply supported compiler/linker hardening flags to optimized “release” configurations, and ensures the release/repro pipelines explicitly enable it for reproducible packaging.
Changes:
- Adds
CCF_ENABLE_RELEASE_HARDENING(defaultON) and conditionally enables supported hardening compile/link options forRelease,RelWithDebInfo, andMinSizeRel. - Updates the release GitHub Actions workflow and RPM reproduction script to explicitly set
-DCCF_ENABLE_RELEASE_HARDENING=ONforReleasebuilds. - Improves RPM reproduction script robustness by enabling
pipefail.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
reproduce/reproduce_rpm.sh |
Enables pipefail and explicitly turns on release hardening during RPM reproduction builds. |
CMakeLists.txt |
Adds CCF_ENABLE_RELEASE_HARDENING and applies supported hardening flags via CMake feature checks for release configurations. |
.github/workflows/release.yml |
Explicitly enables release hardening in the release build and RPM packaging workflow. |
| cmake -GNinja -DCLIENT_PROTOCOLS_TEST=ON -DCCF_ENABLE_RELEASE_HARDENING=ON -DCMAKE_BUILD_TYPE=Release .. | ||
| ninja -v | tee build.log | ||
|
|
There was a problem hiding this comment.
Fixed in 9e6c768 by adding set -o pipefail before the ninja -v | tee build.log pipeline in the release build step.
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/781667e0-a79e-4c73-bfbe-ad212dcc3d1b Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.