Skip to content

Remove def release()#707

Closed
ada-x64 wants to merge 1 commit into
nanvix/v3.12.3from
fix/release-override
Closed

Remove def release()#707
ada-x64 wants to merge 1 commit into
nanvix/v3.12.3from
fix/release-override

Conversation

@ada-x64

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

Copy link
Copy Markdown

Moves release builds to def build(), removes def release().

Removes redundant build.

Towards nanvix/zutils#191
STACKED ON #705
Future work: #710

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates Nanvix “release” packaging into the existing build workflow by removing the separate release() command and refactoring packaging to reuse the already-produced build artifacts.

Changes:

  • Update .nanvix/z.py so build() also runs packaging + verification logic (and remove release()).
  • Refactor .nanvix/package.py to stop doing an internal build and instead stage/install from existing artifacts, using nanvix_zutil.paths.
  • Adjust package.verify() API to no longer require repo_root.

Reviewed changes

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

File Description
.nanvix/z.py Moves release packaging/verification into build() and removes the dedicated release() command.
.nanvix/package.py Removes the redundant build step from package(), switches to paths.* helpers, and updates verify() signature.
Comments suppressed due to low confidence (2)

.nanvix/package.py:22

  • paths is imported twice, which is redundant and can confuse future edits.
import build as build_mod
import config
import lxml as lxml_mod
import ramfs as ramfs_mod
from nanvix_zutil import paths

.nanvix/package.py:78

  • package() accepts a release parameter but currently hard-codes release=True when calling build_mod.install(). This makes the function ignore its own API and can break when callers pass release=False (e.g., via z.py kwargs).
        platform=platform,
        process_mode=process_mode,
        memory_size=memory_size,
        install_prefix=install_prefix,
        release=True,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .nanvix/z.py
Comment on lines +255 to +266
package_mod.package(
sysroot,
toolchain,
**kwargs, # pyright: ignore[reportArgumentType]
run_fn=lambda *args, **kw: run(*args, docker=self.docker, **kw), # type: ignore[arg-type]
docker=self.docker is not None,
)
package_mod.verify(
kwargs["platform"], # pyright: ignore[reportArgumentType]
kwargs["process_mode"], # pyright: ignore[reportArgumentType]
kwargs["memory_size"], # pyright: ignore[reportArgumentType]
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Currently, the NANVIX_RELEASE variable does not really make a difference. The only thing it does is strip some files for production builds. Additionally, NANVIX_RELEASE is never set in CI, so collapsing the behavior here is harmless.

That being said, this is a design decision we should take into account when cleaning up this repo.

Comment thread .nanvix/z.py
Comment thread .nanvix/z.py
Comment on lines 312 to 314
def clean(self) -> None:
"""Remove build artifacts."""
build_mod.clean(repo_root())

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

./z release still exists, it's just automatic now.

@ada-x64 ada-x64 marked this pull request as ready for review June 9, 2026 20:36
Base automatically changed from fix/imports to nanvix/v3.12.3 June 9, 2026 21:30
@ppenna ppenna self-assigned this Jun 10, 2026
Comment thread .nanvix/package.py
Comment on lines -67 to -79
# Build.
build_mod.build(
sysroot,
toolchain,
repo_root,
platform=platform,
process_mode=process_mode,
memory_size=memory_size,
install_prefix=install_prefix,
release=True,
run_fn=run_fn,
docker=docker,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AFAIK. this is unfortunately required, until we completely refactor how build is decoupled from test.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

restored

@ada-x64 ada-x64 force-pushed the fix/release-override branch 3 times, most recently from f11415a to e8ead61 Compare June 10, 2026 15:45
Copilot AI review requested due to automatic review settings June 10, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

.nanvix/package.py:78

  • package() accepts a release flag but the build step hard-codes release=True, so callers cannot actually control whether a release or non-release build is packaged. This also makes z.py's computed release value ineffective.
        platform=platform,
        process_mode=process_mode,
        memory_size=memory_size,
        install_prefix=install_prefix,
        release=True,
        run_fn=run_fn,
        docker=docker,

Comment thread .nanvix/package.py
Comment on lines 87 to 94
@@ -93,12 +93,11 @@
docker=docker,
)
Comment thread .nanvix/z.py
Comment on lines 244 to 248
release = os.environ.get(_MAKE_VAR_RELEASE, "no") == "yes"
kwargs = self._build_kwargs(release=release)
build_mod.build(
sysroot,
toolchain,
Comment thread .nanvix/package.py
Comment on lines -199 to 202
# Cleanup staging.
shutil.rmtree(release_staging)

print("Release tarballs created in dist/")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why was this removed?

@ada-x64 ada-x64 force-pushed the fix/release-override branch from e8ead61 to 028726e Compare June 10, 2026 16:17
@ada-x64 ada-x64 closed this Jun 10, 2026
@ppenna ppenna deleted the fix/release-override branch June 11, 2026 04:00
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.

3 participants