Skip to content

fix(build): expose elf-binaries from build, not release#306

Closed
ada-x64 wants to merge 2 commits into
mainfrom
fix/304/release-to-standard-location
Closed

fix(build): expose elf-binaries from build, not release#306
ada-x64 wants to merge 2 commits into
mainfrom
fix/304/release-to-standard-location

Conversation

@ada-x64

@ada-x64 ada-x64 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Closes #304.

Stacked on top of #305.

Moves the elf-binaries/ side-effect copy from release into
BuildMixin._stage_release, so build's output tree is complete on
its own. CI workflows that upload artifacts between build and
release will now find the ELF files.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from ReleaseMixin.release().
  • Adds the elf-binaries/ copy step to BuildMixin._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.

Comment thread .nanvix/src/build.py
@ada-x64 ada-x64 marked this pull request as ready for review June 25, 2026 19:18
@ada-x64 ada-x64 requested a review from ppenna as a code owner June 25, 2026 19:18
@ppenna ppenna force-pushed the fix/303/minimize-release branch from 65e9c4d to dea16da Compare June 26, 2026 14:55
Base automatically changed from fix/303/minimize-release to main June 26, 2026 17:48
@ada-x64 ada-x64 force-pushed the fix/304/release-to-standard-location branch from c99185c to e266b36 Compare June 26, 2026 17:55
ada-x64 added 2 commits June 26, 2026 13:07
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.
Copilot AI review requested due to automatic review settings June 26, 2026 18:15
@ada-x64 ada-x64 force-pushed the fix/304/release-to-standard-location branch from e266b36 to 88354a1 Compare June 26, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread .nanvix/src/lib.py
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 thread .nanvix/src/build.py
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)

@ada-x64

ada-x64 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing to recreate with linear stack ordering.

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.

Release to standard location

3 participants