From 6b4d498b1664c1ebee639b31209c650f93bdd38b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 01:30:21 +0000 Subject: [PATCH] id: give the scaffold test's Roc compile a writable cache Roc writes its cache under XDG_CACHE_HOME, else $HOME/.cache. In the nix check sandbox HOME is /homeless-shelter, which cannot be created, so world_new_scaffold_compiles_with_pinned_roc failed id-lib's check with a bare AccessDenied. Point XDG_CACHE_HOME at the test's temp dir, as world_compile.rs already does for real compiles; same for the serve_tests scaffold compile. Closes #11163 Co-Authored-By: Claude Opus 5.5 --- pkgs/id/tests/cli_integration.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/id/tests/cli_integration.rs b/pkgs/id/tests/cli_integration.rs index 0108af88e4..f44770b4a6 100644 --- a/pkgs/id/tests/cli_integration.rs +++ b/pkgs/id/tests/cli_integration.rs @@ -696,8 +696,14 @@ mod cli_tests { let platform_copy = temp.path().join("roc-world"); copy_dir_tree(&platform, &platform_copy).unwrap(); let wasm = app.join("scaffold_check.wasm"); + // Roc writes its cache under XDG_CACHE_HOME, else $HOME/.cache. + // The nix check sandbox's HOME (/homeless-shelter) cannot be + // created, so the compiler stopped with a bare AccessDenied + // (#11163). Point the cache at the test's own temp dir, the + // way world_compile.rs does for every real compile. let compiled = Command::new(&roc) .current_dir(&app) + .env("XDG_CACHE_HOME", temp.path().join("roc-cache")) .args([ "build", "main.roc", @@ -2634,6 +2640,8 @@ mod serve_tests { std::os::unix::fs::symlink(&platform, root.path().join("roc-world")).unwrap(); let wasm = root.path().join("scaffold-app.wasm"); let output = StdCommand::new(&roc) + // A writable Roc cache, as in the scaffold test above (#11163). + .env("XDG_CACHE_HOME", root.path().join("roc-cache")) .args([ "build", scaffold.join("main.roc").to_str().unwrap(),