Skip to content

Build the packaged debug default lib against the release CRT - #362

Merged
ASDAlexander77 merged 1 commit into
mainfrom
release-debug-crt
Sep 24, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
release-debug-crt

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

The second half of the v0.0-pre-alpha85 release fix. #361 got DefaultLib's debug build through; the re-tagged run (36068766958) then failed on Windows one step later, at "Test Default Library": debug/compile 0/155. All three Linux jobs passed.

Cause

The Windows zip ships only release-CRT (/MT) builds of TypeScriptAsyncRuntime.lib, gc.lib and LLVMSupport.lib. Since DefaultLib #7, the debug default-lib archive is built /MTd. A program compiled without --opt links that archive (chosen by --di), so the /MTd wrappers meet /MT libraries:

TypeScriptAsyncRuntime.lib(AsyncRuntime.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in TypeScriptDefaultLib.lib(datetime.obj)
TypeScriptAsyncRuntime.lib(AsyncRuntime.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in TypeScriptDefaultLib.lib(datetime.obj)

It isn't just CI: any user of the release zip doing tslang --di --emit=exe with the default lib on Windows hits it.

Fix

Set TSLANG_DEBUG_CRT: /MT for the Windows "Build Default Library" step. DefaultLib #10 (merged) added that override: the packaged debug archive is built against the release CRT, matching the libraries it ships with, and keeps its debug info. Unset, it stays /MTd, which is right next to a debug tslang build.

Tested (Windows, release tslang, linked only against release libraries, the way the zip does)

  • Old /MTd debug archive: debug/compile 0/155 with the LNK2038 above, the same as CI.
  • With TSLANG_DEBUG_CRT=/MT, all four DefaultLib modes: release/compile, release/jit, debug/compile, debug/jit 155/155 each.
  • The release workflow's gc-defaultlib-collector and gc-shared-auto ctests against the /MT archive: 3/3.

This workflow runs only on tag push, so this PR's checks do not exercise it. The re-tag after merge is the real test.

🤖 Generated with Claude Code

The Windows release zip ships only /MT builds of TypeScriptAsyncRuntime.lib,
gc.lib and LLVMSupport.lib, but DefaultLib builds its debug archive /MTd, so
a program compiled without --opt linked /MTd wrappers against /MT libraries
and failed with LNK2038. That failed v0.0-pre-alpha85 at "Test Default
Library" (debug/compile 0/155) and would fail any user's `--di` build.

Set TSLANG_DEBUG_CRT=/MT for the DefaultLib build step (DefaultLib #10), so
the packaged debug archive matches the libraries it ships with. It keeps its
debug info.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 47a6968 into main Sep 24, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the release-debug-crt branch September 24, 2026 23:33
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