Skip to content

Commit 9be88a0

Browse files
Ship tsbindgen and clang's resource directory in the release package (#372)
tsbindgen has built alongside tslang since #367, but the release packaging step only ever staged an explicit allowlist of binaries, so it never reached the zip/tarball. It also needs clang's resource directory (stddef.h, stdint.h, ...) next to it, or it fails at runtime with "clang's resource directory not found" - findResourceDir's release-package candidate is exeDir/lib/clang/<major>, so stage 3rdParty/llvm's lib/clang folder at that path in both packages. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 2583b63 commit 9be88a0

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎.github/workflows/create-release.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,14 @@ jobs:
227227
# defaultlib/*.d.ts, defaultlib/generics/
228228
# plus the shared collector in its own folder, because its import library is also named
229229
# gc.lib: gcdll/gc.lib + gcdll/gc.dll, for programs that load a tslang shared library.
230+
# tsbindgen looks for clang's resource directory next to itself as lib/clang/<major>
231+
# (findResourceDir's "release package" candidate), so stage that layout too.
230232
run: |
231233
New-Item -ItemType Directory -Force -Path .\gcdll_stage\gcdll | Out-Null
232234
Copy-Item -Path ..\3rdParty\gcdll\x64\release\lib\gc.lib, ..\3rdParty\gcdll\x64\release\bin\gc.dll -Destination .\gcdll_stage\gcdll -ErrorAction Stop
233-
Get-ChildItem -Path .\tslang\msbuild\x64\release\bin\tslang.exe, .\tslang\msbuild\x64\release\bin\TypeScriptRuntime.dll, .\tslang\msbuild\x64\release\bin\gc.dll, .\gc\msbuild\x64\release\${{ env.BUILD_TYPE }}\gc.lib, .\tslang\msbuild\x64\release\lib\TypeScriptAsyncRuntime.lib, ..\3rdParty\llvm\x64\release\bin\wasm-ld.exe, ..\TypeScriptCompilerDefaultLib\__build, .\gcdll_stage | Compress-Archive -DestinationPath ..\${{ env.ASSET_NAME }}-windows-x64.zip
235+
New-Item -ItemType Directory -Force -Path .\resourcedir_stage\lib | Out-Null
236+
Copy-Item -Path ..\3rdParty\llvm\x64\release\lib\clang -Destination .\resourcedir_stage\lib -Recurse -ErrorAction Stop
237+
Get-ChildItem -Path .\tslang\msbuild\x64\release\bin\tslang.exe, .\tslang\msbuild\x64\release\bin\tsbindgen.exe, .\tslang\msbuild\x64\release\bin\TypeScriptRuntime.dll, .\tslang\msbuild\x64\release\bin\gc.dll, .\gc\msbuild\x64\release\${{ env.BUILD_TYPE }}\gc.lib, .\tslang\msbuild\x64\release\lib\TypeScriptAsyncRuntime.lib, ..\3rdParty\llvm\x64\release\bin\wasm-ld.exe, ..\TypeScriptCompilerDefaultLib\__build, .\gcdll_stage, .\resourcedir_stage | Compress-Archive -DestinationPath ..\${{ env.ASSET_NAME }}-windows-x64.zip
234238
shell: pwsh
235239

236240
- name: Archive Zip of Windows Asset
@@ -431,6 +435,7 @@ jobs:
431435
rm -rf ./__stage
432436
mkdir -p ./__stage
433437
cp ./tslang/ninja/release/bin/tslang ./__stage/
438+
cp ./tslang/ninja/release/bin/tsbindgen ./__stage/
434439
cp ./tslang/ninja/release/lib/libTypeScriptRuntime.so ./__stage/
435440
cp ./gc/ninja/release/libgc.a ./__stage/
436441
cp ./tslang/ninja/release/lib/libTypeScriptAsyncRuntime.a ./__stage/
@@ -439,6 +444,10 @@ jobs:
439444
# subfolders are preserved: defaultlib/{dll,lib}/{debug,release}/{gc,rc,none},
440445
# defaultlib/*.d.ts, defaultlib/generics/
441446
cp -r ../TypeScriptCompilerDefaultLib/__build/defaultlib ./__stage/
447+
# tsbindgen looks for clang's resource directory next to itself as lib/clang/<major>
448+
# (findResourceDir's "release package" candidate).
449+
mkdir -p ./__stage/lib
450+
cp -r ../3rdParty/llvm/release/lib/clang ./__stage/lib/
442451
tar -czvhf ../${{ env.ASSET_NAME }}-${{ matrix.os }}-x64.tar.gz -C ./__stage .
443452
444453
- name: Archive Tar.GZ of Linux Asset

0 commit comments

Comments
 (0)