Skip to content

Commit 92e886b

Browse files
authored
Merge pull request #57 from debugmcp/chore/typescript-6.0-upgrade
chore: upgrade TypeScript 5.9.3 → 6.0.2 + MinGW docs
2 parents 81af447 + ca1184f commit 92e886b

13 files changed

Lines changed: 311 additions & 325 deletions

File tree

‎docs/rust-debugging-windows.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,34 @@ The resulting binaries (in `target/x86_64-pc-windows-gnu/debug`) contain DWARF d
7373

7474
> **Tip:** For scripts or CI, set `RUSTFLAGS="-C debuginfo=2"` to ensure full debug symbols even if profiles are customised.
7575
76+
### Full MinGW Binutils Required for Crates That Import From Windows DLLs
77+
78+
`rustup toolchain install stable-gnu` ships a *self-contained* GNU toolchain under `%USERPROFILE%\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\bin\self-contained\`. That directory contains `dlltool.exe`, `ld.exe`, and a linker-only `x86_64-w64-mingw32-gcc.exe`, but **no GNU assembler (`as.exe`)**.
79+
80+
For a bare binary (no dependencies) that is enough — `rust-lld` handles linking and `dlltool` is never invoked. But as soon as any transitive dependency needs to import symbols from a Windows system DLL (e.g. `windows-sys`, `parking_lot_core`, anything that brings in `tokio`), `rustc` calls `dlltool.exe` to synthesise import libraries for `kernel32.dll` / `ntdll.dll`, and `dlltool` in turn spawns `as.exe`. Without it you get:
81+
82+
```
83+
error: dlltool could not create import library with ... dlltool.exe ...:
84+
dlltool.exe: CreateProcess
85+
error: could not compile `parking_lot_core` (lib) due to 1 previous error
86+
```
87+
88+
Install the full MinGW-w64 binutils (and gcc, if any dependency's `build.rs` compiles C) via MSYS2:
89+
90+
```powershell
91+
winget install --id=MSYS2.MSYS2 -e
92+
C:\msys64\usr\bin\bash.exe -lc "pacman -Sy --noconfirm && pacman -S --needed --noconfirm mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc"
93+
```
94+
95+
Then prepend `C:\msys64\mingw64\bin` to your user `PATH` so `as.exe`, `ld.exe`, `dlltool.exe`, and `gcc.exe` resolve there:
96+
97+
```powershell
98+
$current = [Environment]::GetEnvironmentVariable('Path','User')
99+
[Environment]::SetEnvironmentVariable('Path', "C:\msys64\mingw64\bin;$current", 'User')
100+
```
101+
102+
Open a new shell (or VS Code window) so the change is picked up, then rerun `cargo +stable-gnu build --target x86_64-pc-windows-gnu`.
103+
76104
---
77105

78106
## What Happens With MSVC Builds?

‎examples/javascript/tsconfig.json‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
4-
"module": "commonjs",
5-
"lib": ["ES2020"],
3+
"target": "ES2022",
4+
"module": "nodenext",
5+
"moduleResolution": "nodenext",
6+
"lib": ["ES2022"],
7+
"types": ["node"],
68
"outDir": "./",
79
"rootDir": "./",
810
"sourceMap": true,

‎examples/javascript/typescript_test.js‎

Lines changed: 84 additions & 148 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)