Skip to content

fix(nostrand): pin path roots to the directory they were added in - #188

Merged
parth-io merged 5 commits into
developfrom
fix/load-path-roots-move-with-cwd
Sep 23, 2026
Merged

parth-io merged 5 commits into
developfrom
fix/load-path-roots-move-with-cwd

Conversation

@parth-io

@parth-io parth-io commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #187

  • *load-paths* and the assembly search roots pin each entry to the directory it was added in, so in-dir no longer moves roots added elsewhere.
  • A project's own :paths/:deps coords resolve against the directory of its deps file rather than the cwd.
  • establish-deps-edn's no-argument form becomes establish-project, which takes the project root and validates it. A task calling (nos/establish-deps-edn) should call (nos/establish-project "."); the two-argument form is unchanged.
  • establish-project replaces both searches rather than appending to them, so a second call switches projects instead of leaving the first one's roots ahead. CLOJURE_LOAD_PATH and MONO_PATH roots survive the switch; a two-argument form adds extra source roots, searched after the project root and before its dependencies.
  • The project root now lives in nostrand.core, and reading it before establish-project has run throws rather than quietly falling back to the process cwd.
  • CLOJURE_LOAD_PATH is now absent or a list of absolute paths, nothing else.
  • Refreshes the committed nostrand DLLs for the above.

Only the in-dir behaviour is visible today: Main passes its own cwd, so cwd and project root cannot diverge until the engine is split out (#185). The rest is groundwork for that split, including project switching, which the Editor host needs to compile a second project in a warm domain.

@parth-io
parth-io marked this pull request as draft September 22, 2026 06:08
@parth-io
parth-io force-pushed the fix/load-path-roots-move-with-cwd branch from 5afe30c to f65505a Compare September 22, 2026 06:10
@parth-io parth-io changed the title fix(nostrand): pin load-path roots to the directory they were added in fix(nostrand): pin path roots to the directory they were added in Sep 22, 2026
@parth-io
parth-io force-pushed the fix/load-path-roots-move-with-cwd branch 3 times, most recently from 30e01e6 to 7c8b10f Compare September 22, 2026 08:48
@parth-io
parth-io requested a review from skydread1 September 22, 2026 08:48
@parth-io
parth-io marked this pull request as ready for review September 22, 2026 08:48
@parth-io parth-io self-assigned this Sep 22, 2026
#187)

-load-path kept paths as text and resolved it against the current
directory at each flush. A change in directory would make the
paths wrong.

Use absolute paths as the default instead.
…dded in (#187)

Similar to -load-path, use absolute paths as the default.
…187)

resolve-deps seeded the root deps map with ".". The project's own
:local/root and :paths then resolved against the process cwd.

A deps file's coords must resolve against its own directory.
@parth-io
parth-io force-pushed the fix/load-path-roots-move-with-cwd branch from 7c8b10f to 35cdb81 Compare September 22, 2026 09:11
Comment thread nostrand/nostrand/core.clj Outdated
Comment thread nostrand/nostrand/deps/basis.clj Outdated
@parth-io
parth-io force-pushed the fix/load-path-roots-move-with-cwd branch from b24eb41 to 452b4a0 Compare September 23, 2026 03:12
…e cwd (#187)

project-deps-file read the current directory. A host with a different
cwd found no deps file, and EstablishProject returned null.

establish-project now takes the root and resets both searches to it,
so a second call switches projects.
@parth-io
parth-io force-pushed the fix/load-path-roots-move-with-cwd branch from 452b4a0 to d26aad6 Compare September 23, 2026 03:16
@parth-io
parth-io requested a review from skydread1 September 23, 2026 03:18
@parth-io
parth-io merged commit 8441f5d into develop Sep 23, 2026
1 check passed
@parth-io
parth-io deleted the fix/load-path-roots-move-with-cwd branch September 23, 2026 03:54
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.

Relative load-path roots move when the current directory changes

2 participants