Skip to content

fix: Verify release candidates under the physical temporary path - #505

Merged
CurtHagenlocher merged 1 commit into
apache:mainfrom
CurtHagenlocher:fix-verify-rc-tmpdir
Nov 16, 2026
Merged

CurtHagenlocher merged 1 commit into
apache:mainfrom
CurtHagenlocher:fix-verify-rc-tmpdir

Conversation

@CurtHagenlocher

Copy link
Copy Markdown
Contributor

What's wrong

On macOS, verify_rc.sh can fail with dozens of spurious compile errors in the test step: "type or namespace name 'FlightTicket' could not be found", K4os not found in the compression tests, and so on, even though the same projects built successfully moments earlier in the build step.

The cause is the temporary directory. On macOS it's under /var, which is a symlink to /private/var, and the script works under the symlinked path. Tools can then see the same files under both /var/folders/… and /private/var/folders/…. When that happens, MSBuild treats each project as two different projects and builds them concurrently into the same output folder, so builds read references that another build is still writing.

Evidence

From the Verify (8.0.x, macos-latest) job of the RC workflow on #504:

Run Runner image Restores under /var Restores under /private/var Result
Failing run 20261103.629 25 20 127 compile errors
Rerun of the same commit 20261028.624 0 34 Passed
Earlier runs, and the latest run on main 20261028.624 0 34 Passed

Every run reports its sandbox under /var/folders/…, but only the run on the newer image ended up with both paths in use. So this is likely to start failing on main too once that image becomes the default for macos-latest.

The fix

setup_tmpdir now resolves VERIFY_TMPDIR to its physical path with pwd -P before anything works in it, so the shell's $PWD and the operating system's view of the current directory agree. This applies both when the script creates the directory with mktemp and when the caller supplies VERIFY_TMPDIR. The cleanup trap removes the same directory either way. On Linux and Windows, where the path normally has no symlinks, nothing changes.

Testing

  • With a real symlinked directory, both branches of setup_tmpdir (mktemp and a caller-supplied VERIFY_TMPDIR) resolve to the physical path, $PWD is physical after the cd, and the cleanup trap still removes the directory.
  • shellcheck 0.10.0 (the version pinned in .pre-commit-config.yaml) and shfmt report no issues.
  • I couldn't run the script on macOS locally; this PR's own RC workflow run exercises it on macos-latest.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

On macOS the temporary directory is under /var, which is a symlink to /private/var.
verify_rc.sh worked under the symlinked path, so tools could see the same files under both
paths. On the newer macOS runner image, MSBuild then treated each project as two and built
them concurrently into the same outputs, failing with spurious "type or namespace not found"
errors. Resolving VERIFY_TMPDIR to its physical path makes every tool see one path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CurtHagenlocher
CurtHagenlocher merged commit 4e1dfd3 into apache:main Nov 16, 2026
14 checks passed
@CurtHagenlocher
CurtHagenlocher deleted the fix-verify-rc-tmpdir branch November 16, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant