Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
783f584
test(starry): add nix-smoke case and namespace-focused syscall regres…
silicalet Jun 2, 2026
b357762
chore(nix): update flake with rust-overlay input and newer nixpkgs
silicalet Jun 2, 2026
a1d2127
feat(starry-kernel): implement PID namespace orphan reaping with subr…
silicalet Jun 3, 2026
0cf2d64
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 3, 2026
bd1577b
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 3, 2026
b85e6f0
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 4, 2026
5304001
Merge remote-tracking branch 'origin/002-starryos-nix-smoke' into 002…
silicalet Jun 4, 2026
7ce90c9
feat(test-suit): add grouped nix-prereqs case and merge nix-smoke sub…
silicalet Jun 4, 2026
43ee6ed
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 4, 2026
60bd4c1
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 4, 2026
81f2925
fix(clippy): sync FAT DirNodeOps::create signature, clean up AGENTS.md
silicalet Jun 4, 2026
8a267fe
feat(vfs): merge PR #1097 uid/gid with mount namespace infrastructure
silicalet Jun 4, 2026
d80608c
style: apply cargo fmt to fix CI formatting check
silicalet Jun 4, 2026
591a7a9
fix(flock): correct dead-OFD pruning threshold from <=1 to <1
silicalet Jun 4, 2026
bcf5a3a
fix(starry-kernel): sync setns mount view
silicalet Jun 4, 2026
e241fae
test(starry): restore raw MSG_PEEK regression
silicalet Jun 5, 2026
ee36a33
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
ea4c0d0
fix(starry-kernel): repair wait merge imports
silicalet Jun 5, 2026
98553de
fix(rsext4): implement filename-independent open-unlink lifetime sema…
silicalet Jun 5, 2026
41b6b60
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
0ba5c08
fix(rsext4): implement Linux-compatible open-unlink final-close cleanup
silicalet Jun 5, 2026
8a17fb2
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
0fe8dea
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
607ca25
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
01f430b
fix(ax-fs-ng): use pending unlink registration helper
silicalet Jun 5, 2026
c5a36f6
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
d3dc988
Merge remote-tracking branch 'origin/002-starryos-nix-smoke' into 002…
silicalet Jun 5, 2026
26b52c2
test(starry): document tcp concurrent readiness check
silicalet Jun 5, 2026
0df67fe
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
8c0d055
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
297270d
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
57da177
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
bb502d7
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 5, 2026
58450dc
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 6, 2026
a40d4ad
Merge branch '002-starryos-nix-smoke' of github.com:silicalet/tgoskit…
silicalet Jun 6, 2026
9061fe3
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 6, 2026
d265f93
fix: use upstream AGENTS.md
silicalet Jun 6, 2026
094d37e
<think>Let me analyze this commit to understand what changes are being
silicalet Jun 6, 2026
761131b
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 6, 2026
120fe88
fix(clippy): collapse nested if in inode.rs, exclude old nix-smoke
silicalet Jun 6, 2026
f9138ba
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 6, 2026
9b9d6cb
chore: update flake.lock
silicalet Jun 6, 2026
8726e96
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 7, 2026
2d3223c
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 7, 2026
2b16f0d
Merge remote-tracking branch 'origin/002-starryos-nix-smoke' into 002…
silicalet Jun 7, 2026
530ebae
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 7, 2026
6f482c1
added README for nix app test, also as a explain/note for https://git…
silicalet Jun 7, 2026
decbfb0
fix(starry-kernel): add CLONE_FS support to sys_unshare
silicalet Jun 7, 2026
2fbe11b
fix(starry-kernel): resolve clippy warnings in CLONE_FS unshare
silicalet Jun 7, 2026
0c59271
chore(nix): disable nixpkgs test — blocked by Nix download unshare
silicalet Jun 7, 2026
14aa437
chore: trigger CI
silicalet Jun 7, 2026
cfd1921
chore: trigger CI
silicalet Jun 7, 2026
bdf1ec7
chore: trigger CI
silicalet Jun 8, 2026
c8376f0
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 8, 2026
8a3b711
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 8, 2026
b9a30bf
fix(starry): address PR #1125 review — unshare(CLONE_FS), builder arg…
silicalet Jun 8, 2026
fdce137
fix(starry-nix): narrow success marker and sync PR docs per review #1125
silicalet Jun 8, 2026
a7aaddf
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 8, 2026
d8f6f9e
fix(starry-ns): privatise FsContext before unshare(NEWNS) on shared c…
silicalet Jun 8, 2026
22e03b4
docs(nix): sync README file-structure labels with actual test coverage
silicalet Jun 9, 2026
f8173e0
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 9, 2026
3e8afc1
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 9, 2026
af2b21d
chore(starry): add nix-prereqs regression test suite and update flake…
silicalet Jun 9, 2026
258837b
feat(starry-nix): add aarch64 test configs for nix smoke and test-nix…
silicalet Jun 9, 2026
2d8ce85
Merge origin/002-starryos-nix-smoke into 002-starryos-nix-smoke
silicalet Jun 9, 2026
2674826
chore: trigger CI
silicalet Jun 9, 2026
8ce04eb
chore: trigger CI
silicalet Jun 9, 2026
690bac9
chore: trigger CI
silicalet Jun 9, 2026
d9986fc
chore: trigger CI
silicalet Jun 9, 2026
3fe67c3
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 10, 2026
5ec1ae3
fix(starry): remove duplicate test-nix-prereqs from old normal/ layout
silicalet Jun 10, 2026
17a8d74
fix(rsext4): correct inodetable_cache field typo in crc_integrity test
silicalet Jun 10, 2026
08a0201
fix(starry): move pipe close→IN from poll layer to epoll layer
silicalet Jun 10, 2026
08a099c
ci: trigger
silicalet Jun 11, 2026
efa9c8a
fix(starry): remove old normal/ test-suit layout and sync spec paths
silicalet Jun 11, 2026
bff5661
fix(axbuild): rename apply_dynamic_x86_64_qemu_boot to apply_dynamic_…
silicalet Jun 11, 2026
a9de8b9
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 11, 2026
107c69a
fix(test): add waitpid before poll in pipe-poll-close to avoid schedu…
silicalet Jun 11, 2026
173d4c2
fix(test): increase PTY read timeout for child stderr to 5s
silicalet Jun 11, 2026
8769441
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 12, 2026
2a1bb01
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 12, 2026
3b8b0bc
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 12, 2026
81969ec
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 13, 2026
a8f41e4
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 15, 2026
50c21a3
chore(nix): update nixpkgs and rust-overlay inputs
silicalet Jun 13, 2026
0407ae7
refactor(starry-test): migrate kernel regression tests from test-nix-…
silicalet Jun 15, 2026
6a9fb94
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 15, 2026
101c943
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 16, 2026
c678c0a
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 16, 2026
1ee064e
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 17, 2026
3d93d4e
chore(specs): remove stale spec files from tracking, now covered by .…
silicalet Jun 17, 2026
f7097e8
merge: sync with upstream/dev (3598a85)
silicalet Jun 17, 2026
37af498
fix(pty): restore peer close notification after upstream merge
silicalet Jun 17, 2026
22bfb09
fix(starry): record poll_wait wchan in poll/ppoll syscalls
silicalet Jun 17, 2026
fd3785a
fix(starry-nix): switch nix-nosandbox to builtins.toFile, bypass buil…
silicalet Jun 17, 2026
dfb9d51
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 17, 2026
8b23a30
seccomp and capablities (#1275)
fzg-23 Jun 18, 2026
d3a4ec0
fix(somehal): send x86 helper IPI on IPI vector (#1297)
Antareske Jun 18, 2026
f745ac9
refactor(ax-runtime): adapt submit-poll fs block irq registration (#1…
ZR233 Jun 18, 2026
3c72396
refactor(axvm): add VM interrupt fabric (#1273)
dweeqhd Jun 18, 2026
6cb11ce
fix: resolve post-merge build errors and formatting
silicalet Jun 18, 2026
24bdce4
fix: restore NsFd::Mnt named-field construction in fd_ops ns_open
silicalet Jun 18, 2026
3bf91a1
chore(repo): merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 19, 2026
3cb3bc9
chore(nix): update rust-overlay in flake.lock
silicalet Jun 19, 2026
9859e9d
ci: trigger CI
silicalet Jun 19, 2026
8b71253
ci: retrigger CI
silicalet Jun 19, 2026
51302d7
chore(flake): update rust-overlay lock
silicalet Jun 21, 2026
bffbcd4
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 21, 2026
a3102de
fix(axfs-ng): align ext4 error-state mount with Linux semantics
silicalet Jun 21, 2026
9b58b9c
fix(axfs-ng): add single retry for block reader in partition scan
silicalet Jun 21, 2026
aa7e005
fix(starry-kernel): drop FD_TABLE lock before release_locks_on_close
silicalet Jun 25, 2026
7dd4ce0
chore(starry-nix): wip nix qemu config + flake tweaks
silicalet Jun 25, 2026
62a1687
Merge upstream/dev into 002-starryos-nix-smoke
silicalet Jun 25, 2026
42cfc17
fix(starry-kernel): use TtyRead::closed in PTY read/poll for POLLHUP/EOF
silicalet Jun 25, 2026
67b0f2c
fix(starry-kernel): call DeviceOps::open on PTY open for peer-close n…
silicalet Jun 25, 2026
2477030
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 26, 2026
d3b9590
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 26, 2026
6539adf
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 26, 2026
75d10a4
fix(rsext4): flush dirty cache before invalidation after journal commit
silicalet Jun 26, 2026
f8b9a91
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 28, 2026
505508f
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jun 30, 2026
80e4948
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jun 30, 2026
be5f9a1
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jul 3, 2026
f5d59cf
fix(starry-nix): drop nixpkgs prebuild injection from smoke test
silicalet Jul 3, 2026
af527d8
ci: retrigger CI (previous run hit transient rootfs 404)
silicalet Jul 3, 2026
c5e488a
fix(ax-posix-api): drop use-hermit-types feature and Hermit getdents6…
silicalet Jul 3, 2026
653fb55
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jul 3, 2026
1e233ab
refactor(starry): remove wchan diagnostics from nix smoke
silicalet Jul 3, 2026
381b5e6
Merge remote-tracking branch 'upstream/dev' into 002-starryos-nix-smoke
silicalet Jul 6, 2026
aa997c1
fix(starry-nix): dynamic qemu-user-static binary and rsext4 page-cach…
silicalet Jul 7, 2026
934984c
Merge branch 'rcore-os:dev' into 002-starryos-nix-smoke
silicalet Jul 7, 2026
573b677
chore(ci): trigger CI re-run
silicalet Jul 7, 2026
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
112 changes: 112 additions & 0 deletions apps/starry/nix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Starry Nix App

This case runs a minimal Nix smoke test inside StarryOS through the app runner.
A prebuilt Nix is injected into the Alpine rootfs; the guest evaluates a Nix
expression and verifies a store-path write, covering the
install→startup→evaluate→artifact chain.

```bash
cargo xtask starry app qemu -t nix --arch x86_64
Comment thread
ZR233 marked this conversation as resolved.
cargo xtask starry app qemu -t nix --arch aarch64
Comment thread
ZR233 marked this conversation as resolved.
```

## No-Sandbox Only

Sandboxed `nix-build` is not yet enabled. Nix requires mount namespace
isolation to activate the build sandbox, and StarryOS mount namespace support is
still incomplete. Without working `unshare(CLONE_NEWNS)`, Nix prints:

> auto-disabling sandboxing because the prerequisite namespaces are not
> available

and silently falls back to unsandboxed mode. Running the sandbox variant as-is
would produce a **false PASS** — the build succeeds, but the claimed
sandboxed-build behaviour was never exercised.

Per the [discussion](https://github.com/rcore-os/tgoskits/pull/1125#issuecomment-4639168301)
on PR #1125: the teacher advised small-step iteration and submitting
no-sandbox first. The current version uses `builtins.toFile` for store-path
creation, which verifies Nix evaluation and store writes without depending on
the builder communication protocol (socketpair). Full `builtins.derivation`
builder workflow is deferred until the builder protocol (Nix socketpair hook)
is working on StarryOS — currently blocked by a poll notification gap in the
IRQ-safe deferred notification layer.

For now `test_nix.sh` intentionally skips the sandbox test and only runs
`nix-nosandbox`, which passes `--option sandbox false` explicitly so the result
honestly reflects the exercised code path. The sandbox test (`nix.sh`) will be
connected once mount namespace isolation is available in StarryOS.

## Test Content

| Script | Mode | Runs? |
|--------|------|-------|
| `nix-nosandbox` | `builtins.toFile` store-path write (no builder) | ✅ CI |
| `nix` | `nix-build --option sandbox true` (full derivation builder) | ❌ blocked (mount ns + socketpair) |

`test_nix.sh` runs only the `nix-nosandbox` phase. The sandbox test (`nix.sh`)
is blocked until mount namespace isolation is ready.

nixpkgs / `stdenv.mkDerivation` testing is tracked on a separate branch and is
intentionally not part of this smoke test; it requires mount namespace
isolation and a working `builtins.fetchTarball` download path that StarryOS
does not yet provide.

## Kernel Regression Tests

Kernel-level semantics (pipe poll, pidfd, rsext4 open-unlink, mount namespace
isolation, etc.) are covered separately by the **qemu-smp1/system** grouped suite:

```bash
cargo xtask starry test qemu --arch x86_64 -c qemu-smp1/system
cargo xtask starry test qemu --arch aarch64 -c qemu-smp1/system
```

These C-language regression tests were migrated from the former
`test-nix-prereqs` case and now live alongside other kernel regression tests
under the unified system grouped suite.
See `test-suit/starryos/qemu-smp1/system/`.

## File Structure

```
apps/starry/nix/
├── prebuild.sh # apk add nix into staging rootfs
├── nix.sh # sandbox-enabled nix-build (blocked, not CI)
├── nix-nosandbox.sh # builtins.toFile store-path write (CI gate)
├── test_nix.sh # nosandbox only
├── build-x86_64-unknown-none.toml
├── build-aarch64-unknown-none-softfloat.toml
├── qemu-x86_64.toml # 1200s timeout, shell_init_cmd=test_nix.sh
├── qemu-aarch64.toml
└── README.md # this file
```

## Dependencies

- Nix 2.31.5 (prebuilt via `apk add nix` in `prebuild.sh`)
- Alpine musl shared libraries (libc, libcrypto, libcurl, libgit2, libseccomp,
libsodium, libsqlite3, libssh2, etc.)
- Guest network access during prebuild only (Nix is injected into rootfs; no
network required at QEMU runtime)

## aarch64 Verification

`prebuild.sh` selects the correct `qemu-*-static` binary by `STARRY_ARCH`.
Both architectures have been verified end-to-end in the CI container:

```bash
# x86_64
podman run --rm \
-v "$(pwd)":/workspace -w /workspace \
ghcr.io/rcore-os/tgoskits-container:latest \
cargo xtask starry app qemu -t nix --arch x86_64
# → NIX_NOSANDBOX_COMPLETE

# aarch64
podman run --rm \
-v "$(pwd)":/workspace -w /workspace \
ghcr.io/rcore-os/tgoskits-container:latest \
cargo xtask starry app qemu -t nix --arch aarch64
# → NIX_NOSANDBOX_COMPLETE
```
8 changes: 8 additions & 0 deletions apps/starry/nix/build-aarch64-unknown-none-softfloat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target = "aarch64-unknown-none-softfloat"
env = { AX_IP = "10.0.2.15", AX_GW = "10.0.2.2" }
log = "Warn"
features = [
"ax-driver/virtio-blk",
"ax-driver/virtio-net",
]
plat_dyn = true
8 changes: 8 additions & 0 deletions apps/starry/nix/build-x86_64-unknown-none.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target = "x86_64-unknown-none"
env = { AX_IP = "10.0.2.15", AX_GW = "10.0.2.2" }
log = "Warn"
features = [
"ax-driver/virtio-blk",
"ax-driver/virtio-net",
]
plat_dyn = true
64 changes: 64 additions & 0 deletions apps/starry/nix/nix-nosandbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/sh
set -eu

# Create Nix subcommand symlinks (overlay doesn't support symlinks).
for cmd in build channel collect-garbage copy-closure env hash \
instantiate prefetch-url shell store; do
ln -sf nix /usr/bin/nix-$cmd 2>/dev/null || true
done

fail() {
echo "NIX_NOSANDBOX_ERROR: $1"
echo 'NIX_NOSANDBOX_TEST_FAILED'
exit 1
}

echo 'NIX_NOSANDBOX_PHASE_ROOTFS_BEGIN'
mkdir -p /nix /etc/nix /tmp/nix-nosandbox || fail 'failed to create Nix smoke directories'

echo 'NIX_NOSANDBOX_PHASE_PREBUILT_NIX_BEGIN'
command -v nix >/dev/null 2>&1 || fail 'prebuilt Nix is missing from case rootfs'
echo 'NIX_NOSANDBOX_PHASE_PREBUILT_NIX_DONE'

echo 'NIX_NOSANDBOX_PHASE_NIX_BEGIN'
nix --version || fail 'nix --version failed'
echo 'NIX_NOSANDBOX_PHASE_NIX_DONE'

echo 'NIX_NOSANDBOX_PHASE_BUILD_BEGIN'

# Use builtins.toFile for store path creation (no builder subprocess).
# This verifies Nix expression evaluation + store write without depending on
# the builder communication protocol (socketpair), which requires poll
# notification semantics not yet complete on StarryOS.
# See nix.sh (sandbox variant) for the full derivation workflow once
# mount namespace isolation and builder protocol support are available.
eval_output="/tmp/nix-nosandbox/eval_output"
rm -f "$eval_output"
set +e
nix --extra-experimental-features nix-command eval --raw --expr \
'builtins.toFile "nix-nosandbox" "NIX_LOCAL_BUILD_NOSANDBOX_OK"' \
>"$eval_output" 2>/tmp/nix-nosandbox/eval.log
eval_rc=$?
set -e
if [ "$eval_rc" -ne 0 ]; then
echo 'NIX_NOSANDBOX_DIAG_EVAL_LOG_BEGIN'
cat /tmp/nix-nosandbox/eval.log
echo 'NIX_NOSANDBOX_DIAG_EVAL_LOG_END'
echo "NIX_NOSANDBOX_EVAL_EXIT=$eval_rc"
fail 'tiny local nix eval failed'
fi
store_path=$(cat "$eval_output")
store_path=$(echo "$store_path" | tr -d '\n\r') # strip trailing newlines

echo 'NIX_NOSANDBOX_DIAG_STORE_PATH_BEGIN'
echo "$store_path"
echo 'NIX_NOSANDBOX_DIAG_STORE_PATH_END'

if [ ! -f "$store_path" ]; then
fail "store path does not exist: $store_path"
fi

cat "$store_path" || fail 'nix store output could not be read'
grep -q 'NIX_LOCAL_BUILD_NOSANDBOX_OK' "$store_path" || fail 'nix store output marker missing'
echo 'NIX_NOSANDBOX_PHASE_BUILD_DONE'
echo 'NIX_NOSANDBOX_TEST_PASSED'
Loading