Skip to content

Commit b7274ab

Browse files
Scope cache workaround to affected compiler and x64 builds
1 parent 27c81b9 commit b7274ab

3 files changed

Lines changed: 30 additions & 14 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,14 @@ with different arguments, stdin, environment, fixtures, helper servers,
170170
expected exit codes, or output assertions. `happy` is only a naming convention;
171171
an app can have any number of successful and failing cases.
172172

173-
Example checks, tests and builds use `--no-cache` on every operating system so
174-
validation compiles the current platform sources against the current native ABI.
175-
The pinned nightly can produce invalid cached loop code after check/test
176-
warm-up; do not re-enable these caches until an upstream fix is verified.
177-
When upgrading a platform URL, rebuild your application with
178-
`roc build --no-cache your-app.roc` as well.
173+
The runner normally uses the compiler cache. A temporary workaround disables it
174+
for `x64musl` and `x64mac` builds with `nightly-2026-10-12-2664a27`: after
175+
`roc check` and `roc test` warm the cache, the command stress helper can SIGSEGV
176+
before its first write. The same build passes with `--no-cache`
177+
([controlled reproduction](https://github.com/roc-lang/basic-cli/actions/runs/39512913704)).
178+
TODO: remove this workaround once a compiler update passes that cached
179+
check/test/build sequence on both targets. Other Unix targets and check/test
180+
stages retain caching; the existing Windows workaround is unchanged.
179181

180182
CI separates source validation, cross-target compilation, and native execution.
181183
Every example is compiled for each target declared in `platform/main.roc`:

‎docs/releases/0.26.0.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ The Windows x64 host keeps the MSVC ABI and now supplies the startup and runtime
260260

261261
## Upgrading from 0.25
262262

263-
Update the platform URL and rebuild with `roc build --no-cache your-app.roc`: the native host interface changed, and mixing hosts and platform sources from different versions is not supported. Then work through the modules you use.
263+
Update the platform URL and rebuild: the native host interface changed, and mixing hosts and platform sources from different versions is not supported. Then work through the modules you use.
264+
265+
With `nightly-2026-10-12-2664a27`, Linux x64 and Intel macOS builds can crash when reusing a cache warmed by `roc check`/`roc test`. For that compiler bug, use `roc build --no-cache your-app.roc` ([reproduction](https://github.com/roc-lang/basic-cli/actions/runs/39512913704)). This is a temporary compiler workaround, not a requirement of the platform upgrade.
264266

265267
**Target discovery**
266268

‎scripts/test.py‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,24 @@ def binary_stem(source: Path) -> str:
8989
return "-".join(parts[1:])
9090

9191

92-
def roc_extra_args() -> tuple[str, ...]:
92+
@functools.cache
93+
def roc_version() -> str:
94+
return subprocess.check_output([ROC, "version"], text=True).strip()
95+
96+
97+
def roc_extra_args(*, build_target: str | None = None) -> tuple[str, ...]:
9398
args = ("--max-transitive-mb=256",)
94-
# Validate the current Roc sources against the current native ABI on every
95-
# target. The pinned compiler can reuse invalid cached loop code after
96-
# check/test warm-up (reproduced on Linux and Intel macOS).
97-
return (*args, "--no-cache")
99+
if platform.system() == "Windows":
100+
return (*args, "--no-cache")
101+
# TODO: Remove this workaround after a compiler update passes the cached
102+
# check -> test -> build reproduction on x64musl and x64mac. With 2664a27,
103+
# cmd-api's flood helper SIGSEGVs before its first write; --no-cache passes.
104+
# Reproduction: https://github.com/roc-lang/basic-cli/actions/runs/39512913704
105+
if build_target in ("x64musl", "x64mac") and roc_version() == (
106+
"Roc compiler version nightly-2026-10-12-2664a27"
107+
):
108+
return (*args, "--no-cache")
109+
return args
98110

99111

100112
def load_spec() -> tuple[dict[str, bool], list[dict[str, object]]]:
@@ -619,7 +631,7 @@ def run_stage(
619631
binary.parent.mkdir(parents=True, exist_ok=True)
620632
command(
621633
ROC, "build", source, f"--target={target}",
622-
f"--output={binary}", *roc_extra_args(),
634+
f"--output={binary}", *roc_extra_args(build_target=target),
623635
)
624636
binaries[path] = binary
625637
elif stage == "run":
@@ -793,7 +805,7 @@ def main() -> None:
793805

794806
if shutil.which(ROC) is None:
795807
raise SystemExit(f"Roc executable '{ROC}' was not found")
796-
print(f"Using roc version: {subprocess.check_output([ROC, 'version'], text=True).strip()}")
808+
print(f"Using roc version: {roc_version()}")
797809
if not args.no_build and not args.bundle_path:
798810
print("\n=== Building platform ===")
799811
command(sys.executable, ROOT / "scripts" / "build.py", "--target", target)

0 commit comments

Comments
 (0)