The pre-push hook builds the same packages twice at once
维护者通常 1 天内回复
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- github, node.js, typescript
- 领域
- build-system, ci-cd, tooling
调研方向
Open lefthook.yml from the reproduction link and inspect the parallel pre-push commands. The issue identifies the fix direction: invoke Nx once for both build and test targets so shared build tasks are planned once. Confirm the hook uses that single invocation; the reported task graph has 21 builds and 10 test runs.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The pre-push hook runs pnpm nx affected -t test and pnpm nx affected -t build as two commands with parallel: true. test depends on ^build, so both plan the builds of the affected packages' dependencies: on a branch that changes packages/bundler-metro, the two task graphs share 13 build tasks, @react-native-harness/bundler-metro:build among them. When those builds are not in the Nx cache, two tsc --build processes write the same dist at once. On Windows that failed my push:
error TS5033: Could not write file '…/packages/bundler-metro/dist/__tests__/resolver.test.d.ts.map': EBUSY: resource busy or locked
TypeScript then kept that error in packages/bundler-metro/dist/tsconfig.lib.tsbuildinfo, and every later build of the package failed the same way until that file was removed.
One invocation, pnpm nx affected -t build test --base=origin/main --head=HEAD --outputStyle=static, plans each build once (31 tasks: 21 builds and 10 test runs). I can open a PR with that change.
System Info
System:
OS: Windows 11 10.0.26200
Binaries:
Node: 26.8.1
React Native Harness Version
1.6.0 (main at bca0781)
Reproduction
https://github.com/callstackincubator/react-native-harness/blob/main/lefthook.yml
Steps to reproduce
- On a branch that changes
packages/bundler-metro, runpnpm nx affected -t test --base=origin/main --head=HEAD --graph=test.jsonandpnpm nx affected -t build --base=origin/main --head=HEAD --graph=build.json: both graphs hold the same 13buildtasks. - Push the branch with those builds missing from the Nx cache: both hook commands build the packages at the same time, and on Windows their writes to one file can collide as above.
- 主要语言
- TypeScript
- 星标
- 333
- 派生
- 20
- 平均合并
- 1 天 37 分钟
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/react-native-harness 的其他 Issue
-
--metroPort is documented, but the CLI rejects it as an unrecognized option可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
callstackincubator/react-native-harness#199 ·
维护者通常 1 天内回复
-
Windows Android SDK path not found可能已有人在做 @V3RON 于 37 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
callstackincubator/react-native-harness#183 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/react-native-harness#128 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 15/100
callstackincubator/react-native-harness#247 ·
维护者通常 1 天内回复
-
iOS simulator runs fail on Xcode 27 when the app is not installed可能已有人在做 @DaveyEke 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
callstackincubator/react-native-harness#223 ·
维护者通常 1 天内回复
查看 callstackincubator/react-native-harness 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
mobile-next/mobile-mcp#526 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 1/5 1 小时以内 新手友好度 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 条评论 ·
维护者通常 1 天内回复