Skip to content

tests: compare real paths against a temp root made under the real temp path (orca #48, slice 5) - #53

Merged
nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-macos-tmp-symlink
Nov 15, 2026
Merged

nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-macos-tmp-symlink

Conversation

@nachumi-a2zoperations

Copy link
Copy Markdown

Refs #48 (slice 5: the macOS temp-symlink trio, 3 red files). #48 stays open for the rest.

Root cause

On macOS the temp folder is a symlink into /private (/var/folders → /private/var/folders, /tmp → /private/tmp). Each of these tests makes its root under tmpdir() (the symlinked spelling) and compares it with a path its child process reports, which is always the real one:

Test What the child reports Why it is the real path
config/scripts/cli-build/verify-cli-bin.test.mjs process.cwd() the kernel returns the resolved path
config/scripts/desktop-build/output-contracts/main-entry-facade.test.ts the bundled main's __dirname Node resolves the main module's real path
src/main/cli/packaged-cli-assets.test.ts (macOS launcher) the CLI path the launcher hands on the launcher resolves its own location physically

On Linux /tmp is not a symlink, so the Dells pass. The product is right in all three: the paths it reports are real, valid paths, so nothing wrong reaches a user. No product code changes.

Fix (tests only)

Following the Leader's rule (compare canonical paths in the tests): the three tests make their temp root under realpathSync(tmpdir()), so both sides use the canonical spelling.

Tests

  • Red before on the MacBook: 3 failing.
  • Green now: 8/8 in the three files, on the Bun runner and on plain Node.
  • Preflight check-changed: 23/23.

…p path (orca #48, slice 5)

Root cause of verify-cli-bin, packaged-cli-assets (macOS launcher)
and main-entry-facade failing on the MacBook (on Node and on Bun): on
macOS the temp folder is a symlink into /private (/var/folders ->
/private/var/folders, /tmp -> /private/tmp). Each test creates its root
under tmpdir() (the symlinked spelling) and compares it with a path its
child process reports, which is always the real one:
- verify-cli-bin: the child's process.cwd() (the kernel returns the
  resolved path);
- main-entry-facade: the bundled main's __dirname (Node resolves the
  main module's real path);
- packaged-cli-assets: the macOS launcher resolves its own location
  physically before building the CLI path it hands on.
On Linux /tmp is not a symlink, so the Dells pass.

The product is right in all three: the paths it reports are real,
valid paths, so nothing wrong reaches a user. No product code changes.

Fix (tests only, per the Leader's rule: compare canonical paths in the
tests): the three tests make their temp root under
realpathSync(tmpdir()), so both sides use the canonical spelling.

Red before on the MacBook: 3 failing. Green now: 8/8 in the three
files on the Bun runner and on plain Node.

Refs #48
@nachumi-a2zoperations
nachumi-a2zoperations merged commit 31d0b3c into blowzer/fork-only Nov 15, 2026
2 checks passed
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