环境
- OS/架构: Linux x86_64
- mcpp/工具链: mcpp 2026.7.31.1, GCC 16 lane toolchain
- mbun 版本: mbun 2026.07.18.0; Bun 1.3.14 compatible; Node v26.3.0 compatible
- 基线: W43 pre-Wave-B binary at commit 0350565
复现步骤
Create an entry importing an alias whose valid mapping exists only in a non-nearest config, then invoke either valued spelling:
tools/integration/safe-test.sh 15 <mbun> run --tsconfig-override <tmp>/custom.json <tmp>/index.ts
tools/integration/safe-test.sh 15 <mbun> run --tsconfig-override=<tmp>/custom.json <tmp>/index.ts
Corpus reproduction:
tools/integration/safe-test.sh 30 <mbun> test compat/bun/test/cli/run/tsconfig-override.test.ts
期望 vs 实际
期望: both valued spellings are parsed, the config path is made absolute against the option-parse cwd, and that explicit config wins over nearest tsconfig.json lookup for every import. Existing baseUrl, paths, monorepo cwd, and extends behavior must be reused.
实际: the two-token form treats --tsconfig-override as the run target; the equals form treats the whole flag token as the target. The corpus file is 0 pass / 6 fail.
报错信息
error: Script not found "--tsconfig-override"
error: Module not found "--tsconfig-override=<config>"
初步分析
src/main.cpp has no valued run-flag arm for --tsconfig-override.
modules/jsc/src/runtime/engine.inc already loads, parses, caches, and follows extends for the nearest config, then passes TsconfigPaths into the existing resolver.
- The missing piece is process-level runtime resolution context: publish one absolute override path before entry execution and make the existing config loader prefer it. A second CLI resolver or ad-hoc path substitution is unnecessary and unsafe.
- The explicit path must be its own cache key and must not become relative to the entry/importing file.
相关资料
- Upstream acceptance:
compat/bun/test/cli/run/tsconfig-override.test.ts
- Upstream parse/handoff:
compat/bun/src/cli/Arguments.rs (tsconfig_override)
- Upstream resolver option:
compat/bun/src/bundler/options.rs
- Existing mbun parser/resolver:
modules/resolver/src/resolver.cppm
- Existing mbun runtime config loader:
modules/jsc/src/runtime/engine.inc
Parent sprint: #80
环境
复现步骤
Create an entry importing an alias whose valid mapping exists only in a non-nearest config, then invoke either valued spelling:
Corpus reproduction:
期望 vs 实际
期望: both valued spellings are parsed, the config path is made absolute against the option-parse cwd, and that explicit config wins over nearest
tsconfig.jsonlookup for every import. Existing baseUrl, paths, monorepo cwd, and extends behavior must be reused.实际: the two-token form treats
--tsconfig-overrideas the run target; the equals form treats the whole flag token as the target. The corpus file is 0 pass / 6 fail.报错信息
初步分析
src/main.cpphas no valued run-flag arm for--tsconfig-override.modules/jsc/src/runtime/engine.incalready loads, parses, caches, and follows extends for the nearest config, then passesTsconfigPathsinto the existing resolver.相关资料
compat/bun/test/cli/run/tsconfig-override.test.tscompat/bun/src/cli/Arguments.rs(tsconfig_override)compat/bun/src/bundler/options.rsmodules/resolver/src/resolver.cppmmodules/jsc/src/runtime/engine.incParent sprint: #80