Skip to content

fix(nostrand): resolve task names and files reliably - #191

Draft
parth-io wants to merge 3 commits into
developfrom
fix/runtime-task-resolution
Draft

parth-io wants to merge 3 commits into
developfrom
fix/runtime-task-resolution

Conversation

@parth-io

@parth-io parth-io commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #190

  • FindFunction loads a qualified name's namespace through Require, so dashed namespaces resolve, and an unknown namespace is a miss instead of an uncaught FileNotFoundException
  • A qualified name has exactly one slash, and Run finds a file's -main with the new Nostrand.FileToNamespace, so files in subdirectories run
  • Run returns false for a file without a -main instead of exiting silently
  • Require rejects an empty name with ArgumentException
  • LoadNostrand loads through Require, so a second call does not reload nostrand

FindFunction loaded a qualified name's namespace by path without
munging it, so `nos my-game.build/compile` looked for
my-game/build.clj, and a namespace with no file escaped as an uncaught
FileNotFoundException. It now loads through Runtime.Require, which
munges the dash and skips a namespace already loaded, and treats
FileNotFoundException as a miss.

Run returned true for a file whose -main it could not find, which the
miss would have turned into silent success for a file in a
subdirectory; it now returns false there.

LoadNostrand loaded nostrand.core and nostrand.tasks through
*load-fn*, reloading both on every call. It now loads through Require.

The commented-out lines left in LoadNostrand and Run from the old Main
go with them.
FindFunction split a qualified name on every slash, so a file path
like sub/dir/thing.clj was read as namespace sub, and Run looked up a
file's -main by its path, which the same split broke for any file in
a subdirectory. A qualified name now has exactly one slash, and Run
derives the file's namespace with the new Nostrand.FileToNamespace.
Run's own FileNotFoundException catch goes, since FindFunction already
treats that as a miss.
Runtime.Require passed an empty name straight to require. It now
throws ArgumentException, since Require is engine API a host calls
directly.
@parth-io parth-io self-assigned this Oct 8, 2026
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.

nostrand's Runtime resolves task names and files unreliably

1 participant