Conversation
# Conflicts: # src/cli/main.zig # src/compile/cache_config.zig # src/compile/cache_module.zig # src/eval/test/lir_inline_test.zig # src/watch/watch.zig
…ng headerless apps The default `roc <file>` command now hot reloads automatically on the dev backend (no `--watch` flag needed); `roc check` and `roc test` still require `--watch`. Adds `--watch` to `roc build`, which reruns the build on every source change via the shared watch loop. Headerless default apps no longer hot reload — they compile through throwaway synthetic source files, so they just run once on every platform; the shared-memory shim is still their run mechanism where the default platform runtime exists. Also links CoreFoundation/CoreServices (macOS) and kernel32 (Windows) onto every target that compiles the watch module via a shared `linkWatchPlatformLibs` helper, fixing undefined-symbol link failures for the release binary and the cli_test/watch_test test executables.
The seqlock in hot_reload.zig used `@atomicLoad/Store(u64, ...)`, which Zig rejects on 32-bit targets (x86-linux-musl, arm-linux-musleabihf) lacking lock-free 64-bit atomics. Route those accesses through `loadU64`/`storeU64` helpers that `comptime`-branch to a plain load/store when `usize` is 32-bit. Hot reload only runs on 64-bit hosts — the dev backend is unavailable on 32-bit, so `HostLirCodeGen` is `void` and the control block is never driven there — so the fallback is never executed; it only needs to compile. The u64 wire format and 64-bit atomic behavior are unchanged. Also `@intCast` a u64 image_size to usize in a RunImage test that failed the same 32-bit build.
Resolved conflicts: combined the LLVM-build target detection (narrowed error set + main's native-macOS guard); bumped cache version to 8 and regenerated the ModuleEnv layout-version hash and serialized-size constant (1808) for the merged struct; added the new `nominal_mapper` field to the punned single-field-record parser state. Converted main's decoder platform-test helpers off `anyerror` to an explicit `TestError` set to satisfy this branch's tidy rule.
# Conflicts: # src/compile/cache_module.zig # test/serialization_size_check.zig
rtfeldman
marked this pull request as ready for review
June 24, 2026 14:34
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.
Adds watch-mode supervision for
roc check --watchandroc test --watch, using explicit compiler-produced watch inputs so reruns track root files, transitive modules, file imports, and filesystem packages/platforms without source scanning. The same watch infrastructure now powersroc --watchfor default dev-shim execution, where successful rebuilds send replacement RunImage bytes through shared memory while failed or cancelled rebuilds leave the currently running image intact.\n\nThis also records source-relative file-import dependencies in cached module state, rejects absolute file imports, keeps LIR out of the dev-shim shared-memory payload, and adds a tidy ban foranyerrorundersrc/.