Skip to content

The default library is found next to tslang when no path is given - #626

Merged
ASDAlexander77 merged 1 commit into
mainfrom
default-lib-path-exe-folder
Oct 20, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
default-lib-path-exe-folder

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Problem

With neither --default-lib-path nor DEFAULT_LIB_PATH set, getDefaultLibPath() returned "", so tslang looked for defaultlib/ in the current folder. Run from anywhere else, it compiled with no default library (can't resolve name: Map). --install-default-lib already installs into tslang's own folder when not told where, so the install and the compile disagreed.

Fix

getDefaultLibPath() (exe.cpp) now falls back to the folder of tslang itself, when that folder holds defaultlib. Order: --default-lib-path, DEFAULT_LIB_PATH, tslang's folder, then the current folder as before. A tslang without a defaultlib beside it is unchanged.

Testing

  • A copy of an install with the new tslang.exe, run from another folder with DEFAULT_LIB_PATH unset: --emit=exe and --emit=jit both resolve Map and run. The released tslang fails there. --no-default-lib still disables it.
  • ctest -C Release: 4834/4834 passed (build bin folders hold no defaultlib, so the suite is unaffected).

🤖 Generated with Claude Code

With neither --default-lib-path nor DEFAULT_LIB_PATH, getDefaultLibPath returned "", so the
library was looked for in ./defaultlib of the current folder: tslang compiled with no default
library unless it ran from its own folder. --install-default-lib already installs into the
folder of tslang when not told where; compiling now looks there too, when it holds defaultlib.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 33ec469 into main Oct 20, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the default-lib-path-exe-folder branch October 20, 2026 17:38
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