fix(build): expose elf-binaries from build, not release#306
Closed
ada-x64 wants to merge 2 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Moves the “expose ELF binaries” side-effect from release into BuildMixin._stage_release so that ./z build produces a complete, artifact-ready output tree (useful for CI workflows that upload artifacts between build and release).
Changes:
- Removes the
elf-binaries/copy step fromReleaseMixin.release(). - Adds the
elf-binaries/copy step toBuildMixin._stage_release()after staging/validation completes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.nanvix/src/release.py |
Drops ELF exposure logic so release only archives the already-staged bundle. |
.nanvix/src/build.py |
Adds ELF exposure logic to _stage_release() so build output includes visible .elf binaries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
65e9c4d to
dea16da
Compare
c99185c to
e266b36
Compare
Closes #277. ZScript.release() packages release_dir() into dist_dir(); with staging moved into build (#304) the override added nothing beyond a tar --transform call for the <asset_prefix>/ top-level directory. Drop ReleaseMixin and override release_targets() to keep the <asset_prefix>.tar.gz archive name (default would be <manifest.name>-<asset_prefix>.tar.gz, breaking downstream CI globs). Three follow-on cleanups in _stage_release: - Stage into release_dir()/<asset_prefix>/ so the archive extracts into that directory. - make_initrd(..., test=True), so the transient initrd writes to test_out() instead of bin_out(); _stage_release re-copies it into the bundle as python3.initrd. - bin/python3 is now a shutil.copy2 of python3.12; the archive packagers skip symlinks. Verified via 'just lc': all phases pass; tarball has the same 44,421 entries and <asset_prefix>/ extraction root as main. Per-file content differs only in absolute-path embeddings (pyc co_filename, console script shebangs, dist-info RECORD sha256, nanvix_rootfs.img) — all worktree-path artifacts already present between main and #304.
Moves the `elf-binaries/` side-effect copy into `_stage_release` so that build's output tree is complete on its own. CI workflows that upload artifacts between `build` and `release` will now find the ELF files.
e266b36 to
88354a1
Compare
Comment on lines
+160
to
+164
| """Name the release archive ``<asset_prefix>.tar.gz``. | ||
|
|
||
| ``release_dir()`` contains a single ``<asset_prefix>/`` subdir | ||
| staged by :meth:`BuildMixin._stage_release`; archive it as-is. | ||
| """ |
Comment on lines
802
to
+813
| log.success("release: staging complete") | ||
|
|
||
| # Expose ELF binaries in a visible directory so that CI artifact | ||
| # upload globs (e.g. **/*.elf) can find them — hidden directories | ||
| # like .nanvix/ are excluded by actions/upload-artifact by default. | ||
| elf_out = repo_root() / "elf-binaries" | ||
| if elf_out.exists(): | ||
| shutil.rmtree(elf_out) | ||
| elf_out.mkdir() | ||
| for elf in (sysroot / "bin").glob("*.elf"): | ||
| shutil.copy2(elf, elf_out) | ||
|
|
Contributor
Author
|
Closing to recreate with linear stack ordering. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #304.
Stacked on top of #305.
Moves the
elf-binaries/side-effect copy fromreleaseintoBuildMixin._stage_release, so build's output tree is complete onits own. CI workflows that upload artifacts between
buildandreleasewill now find the ELF files.