build: stage packages outside temp dirs#144
build: stage packages outside temp dirs#144MikkoParkkola wants to merge 1 commit intotrailofbits:mainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Stages Linux packaging outputs into a persistent dist/ directory before cleaning up temporary build directories, so release artifacts survive cleanup while intermediates are removed.
Changes:
- Add a
dist/staging directory and copy packaged artifacts frompackage-build/into it. - Remove
package-build/after packaging completes. - Clean the musl target build artifacts after packaging.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| mkdir -p dist | ||
| find package-build -maxdepth 1 -type f -name 'mquire-*' -exec cp -f {} dist/ \; |
There was a problem hiding this comment.
just package now creates a top-level dist/ directory and leaves packaged artifacts there, but dist/ is not currently ignored (see .gitignore only ignores /target and /package-build). This will consistently dirty the working tree and increases the risk of accidentally committing release artifacts. Consider adding /dist (or /dist/*) to .gitignore, or writing artifacts under an already-ignored build output directory.
| mkdir -p dist | |
| find package-build -maxdepth 1 -type f -name 'mquire-*' -exec cp -f {} dist/ \; | |
| mkdir -p target/dist | |
| find package-build -maxdepth 1 -type f -name 'mquire-*' -exec cp -f {} target/dist/ \; |
| cmake -S package -B package-build -DMQUIRE_REPOSITORY_PATH="$(pwd)" | ||
| cmake --build package-build --target package | ||
| mkdir -p dist | ||
| find package-build -maxdepth 1 -type f -name 'mquire-*' -exec cp -f {} dist/ \; |
There was a problem hiding this comment.
The find ... -exec cp ... \; form spawns a separate cp process for each matched artifact. If multiple packages are produced (e.g., TGZ + RPM + DEB), consider batching with -exec ... + (or an equivalent approach) to reduce process overhead.
| find package-build -maxdepth 1 -type f -name 'mquire-*' -exec cp -f {} dist/ \; | |
| find package-build -maxdepth 1 -type f -name 'mquire-*' -exec cp -f -t dist/ {} + |
|
|
|
Hello @MikkoParkkola, I'm not sure I understand the reason the packaging code path is being changed this way. I'm going to close this PR for now, but feel free to open an issue with a blueprint for the change you'd like to propose so it can be further discussed Thanks! |
Summary
dist/before cleanuppackage-build/output after packagingNotes
Validation
just --listgit diff --check