Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nanvix/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ venv
cache
sysroot
buildroot
out
.yamllint.yml
black.toml
env.json
Expand Down
23 changes: 3 additions & 20 deletions .nanvix/z.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
./z clean # Remove build artifacts
"""

import shutil
import sys
import tempfile
from pathlib import Path
Expand Down Expand Up @@ -57,7 +56,7 @@ class Libxml2Build(ZScript):
# performance (especially on Windows), so anything not listed here
# is discarded when the container exits. Two categories:
# * legacy repo-root paths needed at runtime (test_libxml2.elf is
# resolved by make_initrd via repo_root()/app);
# read from repo_root() by the standalone test callsite below);
# * install-staged paths under .nanvix/out/ for `./z release`
# (see _staged_output_files()).
_BUILD_OUTPUTS: tuple[str, ...] = ("test_libxml2.elf",)
Expand Down Expand Up @@ -214,7 +213,7 @@ def _run_functional_standalone(self) -> None:
mkramfs = sysroot_path / "bin" / "mkramfs.elf"

# Bundle test_libxml2.elf + daemons into an initrd.
initrd = make_initrd(self, "test_libxml2.elf", test=True)
initrd = make_initrd(self, repo_root() / "test_libxml2.elf", test_out())

try:
with tempfile.TemporaryDirectory(prefix="nanvix_libxml2_") as tmpdir:
Expand Down Expand Up @@ -305,20 +304,9 @@ def _run_tests_windows(self) -> None:
for binary in test_binaries:
name = binary.stem
print(f"RUN {name}...")
# make_initrd resolves binaries relative to repo_root;
# copy the ELF there temporarily unless it already lives there.
# This is a constraint of the make_initrd API; cleanup is
# handled in the finally block below.
repo_elf = repo_root() / binary.name
copied_elf = False
initrd: Path | None = None
try:
if binary.resolve() != repo_elf.resolve():
# Don't clobber a dev's prior repo-root build.
preexisted = repo_elf.exists()
shutil.copy2(binary, repo_elf)
copied_elf = not preexisted
initrd = make_initrd(self, binary.name, test=True)
initrd = make_initrd(self, binary, test_out())
with tempfile.TemporaryDirectory(prefix=f"nanvix_{name}_") as tmpdir:
tmpdir_path = Path(tmpdir)
ramfs_dir = tmpdir_path / "ramfs"
Expand Down Expand Up @@ -354,14 +342,9 @@ def _run_tests_windows(self) -> None:
failed.append(name)
continue
print(f"OK {name}")
except FileExistsError as e:
print(f"FAIL {name} ({e})")
failed.append(name)
finally:
if initrd is not None and initrd.exists():
initrd.unlink()
if copied_elf and repo_elf.exists():
repo_elf.unlink()

if failed:
msg = " ".join(failed)
Expand Down
2 changes: 1 addition & 1 deletion .zutils-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.13.0
v0.14.0
Loading