web-build fails on a symlink inside a nested dot directory (an editor's cache, a virtualenv) and reports it as a failed type check

Open Beginner friendly
#696 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, rust

Research direction

Start at host/web-js/build.mjs around line 395, where the directory walk skips dot entries only when top is true, and make the same rule hold at any depth. Compare with the mirrored rule in js/bake/src/lib.rs near line 834 (at == root && name.starts_with('.')), which the reporter left unchanged. Reproduce with the exact new symrepro script in the issue: the web build should exit 0 with the backend/.elixir_ls link present, and dot directories at any depth should be skipped like .exact/.

Written by the indexing model from the issue text.

Description

What happened

An app whose backend lives in a folder of its own stops building on the web once a tool has
left a symlink in a dot directory there. Ours is an Elixir backend in backend/: ElixirLS, the
Elixir editor extension, keeps backend/.elixir_ls/build/, which holds directory links
(lib/<app>/priv -> ../../../../priv). bun exact.mjs web-build then fails:

source links are not captured: <app>/backend/.elixir_ls/build/lib/app/priv
error: symrepro: app.ts failed the type check every host's build runs
symrepro: the web build (the JS target) failed; the wasm target is internal (--wasm)

A Python virtualenv does the same: with server/.venv/bin/python -> /usr/bin/python3 and no
.elixir_ls, the build fails on server/.venv/bin/python with the same headline.

Nothing in app.ts is wrong, and neither directory is source. The capture in
host/web-js/build.mjs skips dot directories only at the app's top level (if (top && name.startsWith('.') && entry.isDirectory()) continue;, line 395 on main at 65065d29a), so it
walks into backend/.elixir_ls/ and refuses the link. js/bake/src/lib.rs has the same rule
(at == root && name.starts_with('.'), line 834). The headline then names the type check, which
is not what failed, and the one line that names the link is easy to read past.

Fix: skip dot directories at any depth, as at the top. With top && removed from line 395,
the app below builds with the link in place (exit 0). I did not build a native target with the
same change to lib.rs. A headline naming the refused link, not the type check, would also help.

What I expected: a dot directory below the top level is no source either, and the build
leaves it out as it leaves out .exact/.

Host

Web (the bake's capture in js/bake has the same rule)

Smallest app that shows it

The app exact new writes, and one link:

bun <exact2>/scripts/exact.mjs new symrepro
cd symrepro
bun exact.mjs web-build      # builds
mkdir -p backend/priv backend/.elixir_ls/build/lib/app
ln -s ../../../../priv backend/.elixir_ls/build/lib/app/priv
bun exact.mjs web-build      # fails as above
Exact commit

65065d29a

Dominant language
Rust
Stars
2.8k
Forks
62
Avg merge
2h 48m
Merged PRs (30d)
126

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from expo/exact

All issues in expo/exact

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.