From 70c358d0995d77e94b3ec7a0b5f16f16470548a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20S=C3=A1nchez?= Date: Fri, 9 Oct 2026 14:24:45 -0500 Subject: [PATCH] test: the make env mode check reads GNU stat first, so it passes on Linux The check ran `stat -f %Lp FILE || stat -c %a FILE`. GNU stat reads -f as "file system" and %Lp as a file name: it prints the file system's details, exits non-zero on the missing name, and the fallback adds "600", so the output never equals 600. CI on Linux failed on it from #61 on (89ca301, and the v2.0.0 release commit 4e62d44); macOS passed. GNU's form first, then BSD's, gives 600 on both. Co-Authored-By: Claude Opus 5.5 --- evals/static/test-modules.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evals/static/test-modules.sh b/evals/static/test-modules.sh index a6d71a0..ef57c53 100755 --- a/evals/static/test-modules.sh +++ b/evals/static/test-modules.sh @@ -293,8 +293,10 @@ ports() { stack env PORTS='APP_PORT=web:3000 REDIS_PORT=redis:6379' /bin/bash op check "templates: ports.sh is executable" "[ -x '$TPL/ops/scripts/ports.sh' ]" out=$(stack make env 2>&1) +# GNU stat first: its -f means "file system" and takes %Lp for a file name, so BSD's form tried first +# prints more than the mode on Linux. check "make env: creates .env from .env.example, readable only by its owner" \ - "[ -f '$DS/site/.env' ] && [ \"\$(stat -f %Lp '$DS/site/.env' 2>/dev/null || stat -c %a '$DS/site/.env')\" = 600 ] && cmp -s '$DS/site/.env' '$DS/site/.env.example'" + "[ -f '$DS/site/.env' ] && [ \"\$(stat -c %a '$DS/site/.env' 2>/dev/null || stat -f %Lp '$DS/site/.env')\" = 600 ] && cmp -s '$DS/site/.env' '$DS/site/.env.example'" echo 'MAILCHIMP_API_KEY=topsecret' >> "$DS/site/.env" out=$(stack make env 2>&1) check "make env: leaves an existing .env alone" "grep -q '^MAILCHIMP_API_KEY=topsecret$' '$DS/site/.env' && echo \"\$out\" | grep -q 'left as it is'"