Skip to content

Binaries staged per target triple; Android shares the one defaultlib tree - #30

Merged
ASDAlexander77 merged 2 commits into
mainfrom
default-lib-triple-layout
Oct 6, 2026
Merged

ASDAlexander77 merged 2 commits into
mainfrom
default-lib-triple-layout

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Summary

Binaries are staged per target triple, then build mode, then memory model, and every target shares one tree:

__build/defaultlib/{lib,dll}/<arch>/<vendor>/<os>/<env>/{debug,release}/{gc,rc,none}/
  x64 Windows  x86_64/pc/windows/msvc      x86 Windows  i386/pc/windows/msvc
  Linux        x86_64/unknown/linux/gnu    Android      aarch64|x86_64/unknown/linux/android
__build/defaultlib/*.d.ts, generics/, ...  shared by every build
  • scripts/build_core.bat, scripts/build.sh and scripts/build_android.bat no longer spell the layout out. They ask tslang --print-default-lib-dir=<lib|dll> with the same -mtriple / --di / -mm flags they compile with, so they stage exactly where tslang later looks. With an older tslang they stop with "cannot name the output folders".
  • build_android.bat stages into the shared __build/defaultlib instead of __build/android/<abi>/defaultlib; a program takes --default-lib-path=__build whatever its target. Its compiler record is COMPILER_VERSION.android-<abi>.txt, beside the x64 and x86 ones.
  • TSLANG_ARCH=x86 now stages into i386/pc/windows/msvc (LLVM's canonical name for x86).
  • Intermediate objects moved from the repo-root lib/ / dll/ to repo-root defaultlib/, now gitignored.
  • build.bat: a failed single-model build (build.bat <mode> <model>) returned 0, because %errorlevel% inside a ( ) block is expanded before the build runs. It now returns the build's exit code.
  • README documents the layout and the release-zip Android paths.

Merge order

Needs ASDAlexander77/TypeScriptCompiler#526 (adds --print-default-lib-dir and the matching lookup). Merge that one first.

This repo's own create-release.yml downloads the alpha45 compiler, which predates -mm=, so that workflow was already broken before this change; it is left untouched. The compiler's release workflow builds this library with the compiler it just built.

Test plan

  • build.bat (release and debug, gc/rc/none) for x64 and with TSLANG_ARCH=x86, all SUCCESS into the triple tree
  • scripts\build_android.bat (both ABIs, both modes, all models): 12 archives in the shared tree, no leftover object folders
  • The compiler's default-library collector tests (JIT + exe) and its Android link test pass against this tree, not skipped
  • scripts/build.sh only syntax-checked locally; needs a Linux run

🤖 Generated with Claude Code

ASDAlexander77 and others added 2 commits October 6, 2026 17:25
…tree

__build/defaultlib/{lib,dll}/<arch>/<vendor>/<os>/<env>/{debug,release}/{gc,rc,none}/ for
every target: x64 Windows is x86_64/pc/windows/msvc, x86 i386/pc/windows/msvc, Linux
x86_64/unknown/linux/gnu, Android <aarch64|x86_64>/unknown/linux/android. The scripts ask
tslang --print-default-lib-dir (TypeScriptCompiler, same PR series) for each folder with the
flags they compile with, so they stage exactly where tslang later looks. The declarations
stay at the defaultlib root, shared by every build: build_android.bat stages into
__build/defaultlib rather than __build/android/<abi>, and a program takes
--default-lib-path=__build whatever its target.

build.bat: a failed single-model build (build.bat <mode> <model>) returned 0, since
%errorlevel% inside a ( ) block is expanded before the build runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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