Skip to content

Canonicalise the usd_process temp root on macOS - #105

Merged
Blogbotana merged 2 commits into
Apibim-com:masterfrom
axisrow:ao/task-next-fork/promotion/usd-process-temp-root
Oct 20, 2026
Merged

Blogbotana merged 2 commits into
Apibim-com:masterfrom
axisrow:ao/task-next-fork/promotion/usd-process-temp-root

Conversation

@axisrow

@axisrow axisrow commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

Mirror of the fork's #42 (axisrow/BeamCraft, fix for the fork's issue #40), rebased onto
upstream master 73c3597. Two commits, verbatim, test-side only:

  • Build the usd_process store root from the canonical temp directory (4bbef96)
  • Canonicalise the usd_process temp root on macOS only (65997fa)

The usd_process fixtures build their store root from std::env::temp_dir(); on macOS that
path sits behind the /var → /private/var symlink and the store root check refuses it.
The fixture now canonicalises the temp root first. Follows the storage-side fix of the
previous PR.

How you verified it

  • cargo test -p beamcraft-cli --test usd_process on macOS (passes with the canonical
    TMPDIR used by this machine's sandbox; fails identically without the fix, which is
    how the bug reproduces)
  • CI on this PR for Windows/Linux.

Provenance (clean-room)

  • Verbatim fork material, same MPL-2.0 project; no new assets or dependencies.

🤖 Generated with Claude Code

Issue tracking

Fixes #348

axisrow and others added 2 commits October 20, 2026 16:43
The blob store rejects links among a root's ancestors, and on macOS the temp
directory sits behind the /var -> /private/var symlink, so all nine
usd_process tests failed with UnsafeEntry on a pristine macOS checkout before
any A04 change. Start from the canonicalized temp directory so the fixture
root has no link ancestor on any platform.

(cherry picked from commit 4bbef96)
Since 4bbef96 the fixture canonicalised std::env::temp_dir() unconditionally;
on Windows that yields a verbatim \\?\C:\... root, which BlobStore::new
rejects, so all nine usd_process tests died at fixture setup on Windows CI
(master run 39305089702). Keep the plain temp path elsewhere, mirroring the
ancestor-link policy in crates/host/src/storage.rs, where only macOS
resolves system links.

Fixes #40

Co-Authored-By: Claude Code <[email protected]>
(cherry picked from commit 65997fa)

@axisrow axisrow left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approved

Test-only fix, net diff is one fixture change: the usd_process store root is built from temp_dir().canonicalize() on macOS and from the plain temp path everywhere else, mirroring the ancestor-link policy that crates/host/src/storage.rs implements per platform (the same cfg!(target_os = "macos") constant idiom).

Points checked:

  • The macOS-only gate is right: on Windows canonicalize yields a \\?\ verbatim path, which the store refuses as a root, so unconditional canonicalisation (the first commit) was correctly fixed up by the second.
  • Both branches compile on every target (cfg! is a runtime constant), the unwrap sits in test code where the workspace clippy rules permit it, and temp_dir() always exists, so it cannot panic in practice.
  • The canonicalised root still ends in the same unique fixture directory name, so parallel-fixture isolation and the process-id/uniqueness naming are unchanged.
  • Consistent with #104: ancestors may be links on macOS and the store resolves them, and aligning the fixture root with the real path keeps any path comparisons inside the test exact rather than link-dependent.

@axisrow

axisrow commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Implements the work tracked in #133 and #135 (mirrors of axisrow#23 and axisrow#40: the macOS /var symlink in temp_dir ancestors, and the Windows regression fixed by limiting the canonicalization to macOS).

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.

PR #105: Canonicalise the usd_process temp root on macOS

2 participants