@smoothbricks/nx-plugin 0.4.26 → 0.4.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/README.md +994 -117
  2. package/dist/bin/smoo-nx-bound-failures.d.ts +3 -0
  3. package/dist/bin/smoo-nx-bound-failures.d.ts.map +1 -0
  4. package/dist/bin/smoo-nx-bound-failures.js +31 -0
  5. package/dist/bin/smoo-nx-cargo-hash.js +28 -3
  6. package/dist/bin/smoo-nx-exec.js +15 -73
  7. package/dist/bin/smoo-nx-failures.d.ts +3 -0
  8. package/dist/bin/smoo-nx-failures.d.ts.map +1 -0
  9. package/dist/bin/smoo-nx-failures.js +3 -0
  10. package/dist/bin/smoo-nx-nextest-extract.js +3 -2
  11. package/dist/bin/smoo-nx-test-walks.d.ts +3 -0
  12. package/dist/bin/smoo-nx-test-walks.d.ts.map +1 -0
  13. package/dist/bin/smoo-nx-test-walks.js +34 -0
  14. package/dist/bounded-test-policy.d.ts +7 -1
  15. package/dist/bounded-test-policy.d.ts.map +1 -1
  16. package/dist/bounded-test-policy.js +101 -40
  17. package/dist/build-state-output-policy.d.ts +25 -0
  18. package/dist/build-state-output-policy.d.ts.map +1 -0
  19. package/dist/build-state-output-policy.js +64 -0
  20. package/dist/cargo-closure-input.d.ts +3 -2
  21. package/dist/cargo-closure-input.d.ts.map +1 -1
  22. package/dist/cargo-closure-input.js +16 -15
  23. package/dist/cargo-dev-profile.d.ts +37 -0
  24. package/dist/cargo-dev-profile.d.ts.map +1 -0
  25. package/dist/cargo-dev-profile.js +108 -0
  26. package/dist/cargo-source-hash.d.ts +43 -6
  27. package/dist/cargo-source-hash.d.ts.map +1 -1
  28. package/dist/cargo-source-hash.js +309 -73
  29. package/dist/cargo-toolchain-policy.d.ts +4 -0
  30. package/dist/cargo-toolchain-policy.d.ts.map +1 -1
  31. package/dist/cargo-toolchain-policy.js +5 -0
  32. package/dist/cargo-workspace.d.ts +101 -5
  33. package/dist/cargo-workspace.d.ts.map +1 -1
  34. package/dist/cargo-workspace.js +291 -10
  35. package/dist/cross-check-policy.d.ts +21 -3
  36. package/dist/cross-check-policy.d.ts.map +1 -1
  37. package/dist/cross-check-policy.js +24 -6
  38. package/dist/disk-command-policy.d.ts +7 -0
  39. package/dist/disk-command-policy.d.ts.map +1 -0
  40. package/dist/disk-command-policy.js +98 -0
  41. package/dist/ensure-built-receipt.d.ts +25 -0
  42. package/dist/ensure-built-receipt.d.ts.map +1 -0
  43. package/dist/ensure-built-receipt.js +261 -0
  44. package/dist/ensure-built-witness.d.ts +57 -0
  45. package/dist/ensure-built-witness.d.ts.map +1 -0
  46. package/dist/ensure-built-witness.js +412 -0
  47. package/dist/ensure-built.d.ts +207 -12
  48. package/dist/ensure-built.d.ts.map +1 -1
  49. package/dist/ensure-built.js +576 -202
  50. package/dist/eslint-file-set.d.ts +7 -0
  51. package/dist/eslint-file-set.d.ts.map +1 -0
  52. package/dist/eslint-file-set.js +12 -0
  53. package/dist/executors/bounded-exec/cpu-pool.d.ts +63 -0
  54. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -0
  55. package/dist/executors/bounded-exec/cpu-pool.js +379 -0
  56. package/dist/executors/bounded-exec/cpu-tokens.d.ts +82 -0
  57. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -0
  58. package/dist/executors/bounded-exec/cpu-tokens.js +114 -0
  59. package/dist/executors/bounded-exec/disk-lease.d.ts +61 -0
  60. package/dist/executors/bounded-exec/disk-lease.d.ts.map +1 -0
  61. package/dist/executors/bounded-exec/disk-lease.js +91 -0
  62. package/dist/executors/bounded-exec/executor.d.ts +45 -2
  63. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  64. package/dist/executors/bounded-exec/executor.js +447 -52
  65. package/dist/executors/bounded-exec/gateway-lease.d.ts +52 -0
  66. package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -0
  67. package/dist/executors/bounded-exec/gateway-lease.js +143 -0
  68. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +35 -0
  69. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -0
  70. package/dist/executors/bounded-exec/hang-diagnostics.js +231 -0
  71. package/dist/executors/bounded-exec/progress.d.ts +35 -0
  72. package/dist/executors/bounded-exec/progress.d.ts.map +1 -0
  73. package/dist/executors/bounded-exec/progress.js +79 -0
  74. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +3 -0
  75. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -0
  76. package/dist/executors/bounded-exec/ram-temp-fixtures.js +12 -0
  77. package/dist/executors/bounded-exec/ram-temp-held.d.ts +91 -0
  78. package/dist/executors/bounded-exec/ram-temp-held.d.ts.map +1 -0
  79. package/dist/executors/bounded-exec/ram-temp-held.js +152 -0
  80. package/dist/executors/bounded-exec/ram-temp.d.ts +223 -0
  81. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -0
  82. package/dist/executors/bounded-exec/ram-temp.js +1528 -0
  83. package/dist/executors/bounded-exec/schema.d.ts +29 -11
  84. package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
  85. package/dist/executors/bounded-exec/verdict.d.ts +162 -0
  86. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -0
  87. package/dist/executors/bounded-exec/verdict.js +318 -0
  88. package/dist/executors/shard-timings/executor.d.ts +14 -0
  89. package/dist/executors/shard-timings/executor.d.ts.map +1 -0
  90. package/dist/executors/shard-timings/executor.js +25 -0
  91. package/dist/executors/shard-timings/schema.d.ts +4 -0
  92. package/dist/executors/shard-timings/schema.d.ts.map +1 -0
  93. package/dist/executors/shard-timings/schema.js +1 -0
  94. package/dist/failure-summary.d.ts +5 -0
  95. package/dist/failure-summary.d.ts.map +1 -0
  96. package/dist/failure-summary.js +118 -0
  97. package/dist/generators/create-package/generator.d.ts.map +1 -1
  98. package/dist/generators/create-package/generator.js +6 -2
  99. package/dist/index.d.ts +14 -2
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +370 -138
  102. package/dist/managed-files/ci-workflow.d.ts +13 -0
  103. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  104. package/dist/managed-files/ci-workflow.js +44 -13
  105. package/dist/managed-files/files.d.ts +7 -1
  106. package/dist/managed-files/files.d.ts.map +1 -1
  107. package/dist/managed-files/files.js +62 -8
  108. package/dist/managed-files/json-edit.d.ts +21 -0
  109. package/dist/managed-files/json-edit.d.ts.map +1 -0
  110. package/dist/managed-files/json-edit.js +295 -0
  111. package/dist/managed-files/managed-format.d.ts +33 -1
  112. package/dist/managed-files/managed-format.d.ts.map +1 -1
  113. package/dist/managed-files/managed-format.js +82 -2
  114. package/dist/managed-files/pr-preview-cleanup-workflow.d.ts +7 -0
  115. package/dist/managed-files/pr-preview-cleanup-workflow.d.ts.map +1 -1
  116. package/dist/managed-files/pr-preview-cleanup-workflow.js +68 -4
  117. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  118. package/dist/managed-files/publish-workflow.js +231 -48
  119. package/dist/managed-files/tree.d.ts +5 -0
  120. package/dist/managed-files/tree.d.ts.map +1 -1
  121. package/dist/managed-files/tree.js +5 -3
  122. package/dist/manifest-hash.d.ts.map +1 -1
  123. package/dist/manifest-hash.js +2 -5
  124. package/dist/nextest-code-bound.d.ts +62 -0
  125. package/dist/nextest-code-bound.d.ts.map +1 -0
  126. package/dist/nextest-code-bound.js +154 -0
  127. package/dist/nextest-extraction.d.ts +24 -8
  128. package/dist/nextest-extraction.d.ts.map +1 -1
  129. package/dist/nextest-extraction.js +42 -7
  130. package/dist/package-target-policy.d.ts.map +1 -1
  131. package/dist/package-target-policy.js +3 -5
  132. package/dist/release-config-policy.d.ts.map +1 -1
  133. package/dist/release-config-policy.js +3 -5
  134. package/dist/runtime-input.d.ts +14 -0
  135. package/dist/runtime-input.d.ts.map +1 -0
  136. package/dist/runtime-input.js +15 -0
  137. package/dist/rust-tokens.d.ts +11 -0
  138. package/dist/rust-tokens.d.ts.map +1 -0
  139. package/dist/rust-tokens.js +81 -0
  140. package/dist/task-results.d.ts +6 -0
  141. package/dist/task-results.d.ts.map +1 -0
  142. package/dist/task-results.js +61 -0
  143. package/dist/test-program.d.ts +54 -0
  144. package/dist/test-program.d.ts.map +1 -0
  145. package/dist/test-program.js +292 -0
  146. package/dist/test-timings.d.ts +71 -0
  147. package/dist/test-timings.d.ts.map +1 -0
  148. package/dist/test-timings.js +393 -0
  149. package/dist/test-walk-policy.d.ts +103 -0
  150. package/dist/test-walk-policy.d.ts.map +1 -0
  151. package/dist/test-walk-policy.js +657 -0
  152. package/dist/testing.d.ts +177 -0
  153. package/dist/testing.d.ts.map +1 -0
  154. package/dist/testing.js +824 -0
  155. package/dist/type-guards.d.ts +3 -0
  156. package/dist/type-guards.d.ts.map +1 -0
  157. package/dist/type-guards.js +4 -0
  158. package/dist/typecheck-test-policy.d.ts +8 -5
  159. package/dist/typecheck-test-policy.d.ts.map +1 -1
  160. package/dist/typecheck-test-policy.js +113 -100
  161. package/dist/workspace-config-policy.d.ts +8 -0
  162. package/dist/workspace-config-policy.d.ts.map +1 -1
  163. package/dist/workspace-config-policy.js +175 -63
  164. package/dist/workspace-index.d.ts +12 -0
  165. package/dist/workspace-index.d.ts.map +1 -0
  166. package/dist/workspace-index.js +17 -0
  167. package/dist/workspace-manifest.d.ts +37 -0
  168. package/dist/workspace-manifest.d.ts.map +1 -1
  169. package/executors.json +5 -0
  170. package/loader.js +13 -11
  171. package/managed/raw/envrc +33 -67
  172. package/managed/raw/git-format-staged.yml +30 -35
  173. package/managed/raw/patches/nx@23.2.1.patch +3484 -0
  174. package/managed/raw/tooling/direnv/apple-developer.sh +83 -0
  175. package/managed/raw/tooling/direnv/developer-links.ts +569 -11
  176. package/managed/raw/tooling/direnv/devenv.smoo.nix +314 -93
  177. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +20 -11
  178. package/managed/raw/tooling/direnv/linked-snapshots.ts +845 -0
  179. package/managed/raw/tooling/direnv/nx-socket-dir.sh +82 -0
  180. package/managed/raw/tooling/direnv/repo-path +14 -2
  181. package/managed/raw/tooling/direnv/setup-environment.ts +962 -148
  182. package/managed/raw/tooling/direnv/toolchain-stamp.ts +45 -3
  183. package/managed/raw/tooling/direnv/ttsc-env.sh +39 -0
  184. package/managed/raw/tooling/git-hooks/commit-msg.sh +5 -6
  185. package/managed/raw/tooling/git-hooks/pre-commit.sh +7 -6
  186. package/managed/raw/tooling/git-hooks/pre-push.sh +20 -15
  187. package/managed/templates/github/actions/cache-nix-devenv/action.yml +6 -6
  188. package/managed/templates/github/actions/cache-node-modules/action.yml +6 -4
  189. package/managed/templates/github/actions/cache-nx/action.yml +1 -1
  190. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +1 -1
  191. package/managed/templates/github/actions/forgejo-artifact.cjs +99 -0
  192. package/managed/templates/github/actions/forgejo-download-artifact/action.yml +49 -0
  193. package/managed/templates/github/actions/forgejo-download-artifact/index.cjs +7 -0
  194. package/managed/templates/github/actions/forgejo-upload-artifact/action.yml +65 -0
  195. package/managed/templates/github/actions/forgejo-upload-artifact/index.cjs +7 -0
  196. package/managed/templates/github/actions/setup-devenv/action.yml +21 -3
  197. package/managed/templates/github/workflows/managed-files.yml +1 -2
  198. package/nextest.toml +8 -41
  199. package/package.json +74 -12
  200. package/runtime-input.sh +81 -0
  201. package/src/__tests__/counted-cargo.ts +33 -14
  202. package/src/__tests__/fixture-nx-env.ts +111 -46
  203. package/src/__tests__/progress-clock.ts +43 -0
  204. package/src/__tests__/runtime-input.ts +23 -0
  205. package/src/bin/smoo-nx-bound-failures.test.ts +127 -0
  206. package/src/bin/smoo-nx-bound-failures.ts +33 -0
  207. package/src/bin/smoo-nx-cargo-hash.ts +28 -3
  208. package/src/bin/smoo-nx-exec.ts +16 -74
  209. package/src/bin/smoo-nx-failures.ts +4 -0
  210. package/src/bin/smoo-nx-nextest-extract.ts +3 -2
  211. package/src/bin/smoo-nx-test-walks.ts +42 -0
  212. package/src/bounded-test-policy.test.ts +268 -21
  213. package/src/bounded-test-policy.ts +114 -42
  214. package/src/build-state-output-policy.test.ts +115 -0
  215. package/src/build-state-output-policy.ts +90 -0
  216. package/src/bun-bootstrap.test.ts +57 -3
  217. package/src/bun-file-packages.test.ts +47 -0
  218. package/src/cargo-closure-input.test.ts +138 -66
  219. package/src/cargo-closure-input.ts +17 -15
  220. package/src/cargo-dev-profile.ts +137 -0
  221. package/src/cargo-resolve-cache.test.ts +70 -1
  222. package/src/cargo-source-hash.test.ts +193 -97
  223. package/src/cargo-source-hash.ts +345 -68
  224. package/src/cargo-toolchain-policy.ts +6 -0
  225. package/src/cargo-workspace.test.ts +320 -0
  226. package/src/cargo-workspace.ts +336 -10
  227. package/src/cross-check-policy.test.ts +59 -1
  228. package/src/cross-check-policy.ts +25 -6
  229. package/src/disk-command-policy.test.ts +61 -0
  230. package/src/disk-command-policy.ts +107 -0
  231. package/src/ensure-built-receipt.test.ts +184 -0
  232. package/src/ensure-built-receipt.ts +263 -0
  233. package/src/ensure-built-witness.test.ts +344 -0
  234. package/src/ensure-built-witness.ts +252 -0
  235. package/src/ensure-built.test.ts +1036 -578
  236. package/src/ensure-built.ts +820 -224
  237. package/src/eslint-file-set.ts +9 -0
  238. package/src/executors/bounded-exec/cpu-pool.test.ts +454 -0
  239. package/src/executors/bounded-exec/cpu-pool.ts +417 -0
  240. package/src/executors/bounded-exec/cpu-tokens.test.ts +269 -0
  241. package/src/executors/bounded-exec/cpu-tokens.ts +177 -0
  242. package/src/executors/bounded-exec/disk-lease.test.ts +185 -0
  243. package/src/executors/bounded-exec/disk-lease.ts +139 -0
  244. package/src/executors/bounded-exec/executor-host.test.ts +778 -0
  245. package/src/executors/bounded-exec/executor.test.ts +1116 -63
  246. package/src/executors/bounded-exec/executor.ts +565 -67
  247. package/src/executors/bounded-exec/gateway-lease.ts +176 -0
  248. package/src/executors/bounded-exec/hang-diagnostics.test.ts +285 -0
  249. package/src/executors/bounded-exec/hang-diagnostics.ts +283 -0
  250. package/src/executors/bounded-exec/progress.test.ts +79 -0
  251. package/src/executors/bounded-exec/progress.ts +118 -0
  252. package/src/executors/bounded-exec/ram-temp-fixtures.ts +12 -0
  253. package/src/executors/bounded-exec/ram-temp-held.test.ts +264 -0
  254. package/src/executors/bounded-exec/ram-temp-held.ts +242 -0
  255. package/src/executors/bounded-exec/ram-temp-host.test.ts +605 -0
  256. package/src/executors/bounded-exec/ram-temp.test.ts +674 -0
  257. package/src/executors/bounded-exec/ram-temp.ts +1918 -0
  258. package/src/executors/bounded-exec/schema.json +11 -5
  259. package/src/executors/bounded-exec/schema.ts +27 -11
  260. package/src/executors/bounded-exec/verdict.test.ts +440 -0
  261. package/src/executors/bounded-exec/verdict.ts +433 -0
  262. package/src/executors/shard-timings/executor.ts +36 -0
  263. package/src/executors/shard-timings/schema.json +21 -0
  264. package/src/executors/shard-timings/schema.ts +4 -0
  265. package/src/failure-summary.ts +119 -0
  266. package/src/generators/bounded-test-targets/generator.test.ts +4 -4
  267. package/src/generators/bun-test-tracing/generator.test.ts +2 -2
  268. package/src/generators/create-package/generator.test.ts +6 -0
  269. package/src/generators/create-package/generator.ts +6 -2
  270. package/src/host-controller-wiring.test.ts +31 -0
  271. package/src/index.test.ts +909 -295
  272. package/src/index.ts +441 -143
  273. package/src/linked-snapshots.nx.test.ts +172 -0
  274. package/src/managed-files/ci-workflow.ts +54 -13
  275. package/src/managed-files/files.ts +65 -9
  276. package/src/managed-files/forgejo-artifact.test.ts +395 -0
  277. package/src/managed-files/generator.test.ts +60 -1
  278. package/src/managed-files/json-edit.test.ts +216 -0
  279. package/src/managed-files/json-edit.ts +290 -0
  280. package/src/managed-files/managed-format-json.test.ts +308 -0
  281. package/src/managed-files/managed-format.ts +90 -2
  282. package/src/managed-files/pr-preview-cleanup-workflow.ts +69 -3
  283. package/src/managed-files/publish-workflow.ts +285 -67
  284. package/src/managed-files/repo-path.test.ts +129 -0
  285. package/src/managed-files/trace-db-artifact.test.ts +7 -0
  286. package/src/managed-files/tree.ts +11 -3
  287. package/src/manifest-hash.ts +2 -6
  288. package/src/nextest-code-bound.test.ts +155 -0
  289. package/src/nextest-code-bound.ts +195 -0
  290. package/src/nextest-extraction.test.ts +37 -5
  291. package/src/nextest-extraction.ts +51 -9
  292. package/src/nextest-partitions.test.ts +427 -82
  293. package/src/nx-cache-bound.test.ts +5 -10
  294. package/src/nx-cache-restore-mtime.test.ts +170 -0
  295. package/src/nx-daemon-claim.test.ts +277 -0
  296. package/src/nx-daemon-idle-cpu.test.ts +81 -0
  297. package/src/nx-daemon-idle-policy.test.ts +51 -0
  298. package/src/nx-daemon-ignore-files.test.ts +210 -0
  299. package/src/nx-daemon-root-normalization.test.ts +105 -0
  300. package/src/nx-daemon-validity.test.ts +925 -0
  301. package/src/nx-dot-input-policy.test.ts +353 -0
  302. package/src/nx-failure-life-cycles.test.ts +207 -0
  303. package/src/nx-files-archive-racy.test.ts +97 -0
  304. package/src/nx-foreign-workspace-env.test.ts +329 -0
  305. package/src/nx-incomplete-run-summary.test.ts +70 -0
  306. package/src/nx-plugin-load-errors.test.ts +120 -0
  307. package/src/nx-project-resolution-cache.test.ts +176 -0
  308. package/src/nx-raw-inputs.test.ts +166 -0
  309. package/src/nx-resident-graph-workers.test.ts +7 -16
  310. package/src/nx-run-information.test.ts +118 -0
  311. package/src/nx-skipped-task-exit.test.ts +180 -0
  312. package/src/nx-state-location.test.ts +63 -0
  313. package/src/nx-store-resolution.test.ts +26 -25
  314. package/src/nx-task-graph-cycles.test.ts +148 -0
  315. package/src/nx-task-output-lease.test.ts +414 -0
  316. package/src/nx-use-local.test.ts +103 -0
  317. package/src/package-target-policy.ts +3 -6
  318. package/src/release-config-policy.ts +3 -6
  319. package/src/runtime-input.test.ts +215 -0
  320. package/src/runtime-input.ts +17 -0
  321. package/src/rust-tokens.ts +78 -0
  322. package/src/serial-group-wiring.test.ts +326 -0
  323. package/src/task-history-namespace.test.ts +87 -89
  324. package/src/task-results.test.ts +226 -0
  325. package/src/task-results.ts +75 -0
  326. package/src/test-program.test.ts +303 -0
  327. package/src/test-program.ts +341 -0
  328. package/src/test-timings.test.ts +240 -0
  329. package/src/test-timings.ts +311 -0
  330. package/src/test-walk-policy.test.ts +585 -0
  331. package/src/test-walk-policy.ts +731 -0
  332. package/src/testing.test.ts +509 -0
  333. package/src/testing.ts +922 -0
  334. package/src/type-guards.ts +4 -0
  335. package/src/typecheck-test-policy.test.ts +496 -11
  336. package/src/typecheck-test-policy.ts +137 -103
  337. package/src/workspace-config-policy.test.ts +212 -13
  338. package/src/workspace-config-policy.ts +101 -73
  339. package/src/workspace-index.ts +18 -0
  340. package/src/workspace-manifest.ts +41 -0
  341. package/test-timings.json +85 -30
  342. package/managed/raw/tooling/direnv/inherited-devenv.ts +0 -665
  343. package/managed/raw/tooling/direnv/shared-caches.sh +0 -53
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  /**
3
- * Invalidate cmake build-script caches when the toolchain changes.
3
+ * Invalidate the caches under target/ that remember a toolchain when it changes.
4
4
  *
5
5
  * cmake-rs keeps CMAKE_OSX_SYSROOT and the compilers in CMakeCache.txt from
6
6
  * the FIRST configure and only clears a build directory when the source path
@@ -11,12 +11,25 @@
11
11
  * exporting it. Nx does not see this state either — it hashes inputs, not
12
12
  * what a cache under target/ remembers.
13
13
  *
14
+ * Cargo's own `.rustc_info.json` (one per target directory) is the same trap.
15
+ * It caches `rustc -vV` and `--print sysroot` under a key of the rustc path and
16
+ * its mtime. The shell names rustc by the toolchain's store path
17
+ * (devenv.smoo.nix), which a bump moves, but a git hook reaches it through the
18
+ * devenv profile's `bin/rustc` (repo-path), which a lock bump never moves, and
19
+ * every Nix store file has mtime 1, so that key survives a toolchain bump
20
+ * unchanged: after rust-overlay moved 1.100.0-nightly
21
+ * (2026-09-08) to 1.101.0-nightly (2026-10-03), `-Zbuild-std` compiled the OLD
22
+ * nightly's rust-src with the NEW compiler (`unrecognized intrinsic function`
23
+ * in core) because the cached sysroot still named the old store path.
24
+ *
14
25
  * Runs at the end of shell entry, after the project's own enterShell resolved
15
26
  * SDKROOT and the compilers. It records the toolchain identity the shell
16
27
  * settled on and, when that identity differs from the recorded one, removes
17
28
  * exactly the cargo build-script directories that hold a CMakeCache.txt, so
18
- * cargo re-runs those scripts against the current toolchain. Nothing else
19
- * under target/ is touched; a checkout without target/ has nothing to do.
29
+ * cargo re-runs those scripts against the current toolchain, and every target
30
+ * directory's `.rustc_info.json`, so cargo asks the current rustc again.
31
+ * Nothing else under target/ is touched; a checkout without target/ has
32
+ * nothing to do.
20
33
  */
21
34
  import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
22
35
  import { join, resolve } from 'node:path';
@@ -33,6 +46,9 @@ if (existsSync(target)) {
33
46
  if (removed > 0) {
34
47
  console.error(`devenv: toolchain identity changed; removed ${removed} cmake build-script cache(s) under target/`);
35
48
  }
49
+ for (const info of rustcInfoCaches(target, 0)) {
50
+ rmSync(info, { force: true });
51
+ }
36
52
  writeFileSync(stamp, identity);
37
53
  }
38
54
  }
@@ -86,3 +102,29 @@ function* cargoBuildDirs(dir: string, depth: number): Generator<string> {
86
102
  }
87
103
  }
88
104
  }
105
+
106
+ /**
107
+ * Every `.rustc_info.json` cargo wrote at a target-directory root: target/
108
+ * itself and the lanes nested in it (`target/<lane>`, and trybuild's
109
+ * `target/tests/trybuild`) - at most two levels below target/.
110
+ */
111
+ function* rustcInfoCaches(dir: string, depth: number): Generator<string> {
112
+ const info = join(dir, '.rustc_info.json');
113
+ if (existsSync(info)) {
114
+ yield info;
115
+ }
116
+ if (depth === 2) {
117
+ return;
118
+ }
119
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
120
+ if (
121
+ entry.isDirectory() &&
122
+ entry.name !== 'build' &&
123
+ entry.name !== 'deps' &&
124
+ entry.name !== 'incremental' &&
125
+ entry.name !== '.fingerprint'
126
+ ) {
127
+ yield* rustcInfoCaches(join(dir, entry.name), depth + 1);
128
+ }
129
+ }
130
+ }
@@ -0,0 +1,39 @@
1
+ # Managed by `smoo monorepo`. Sourced from the workspace root by devenv.smoo.nix's
2
+ # enterShell prologue, before nx-socket-dir.sh rebinds NX_WORKSPACE_ROOT_PATH,
3
+ # and by the git hooks, which run outside that shell:
4
+ #
5
+ # . tooling/direnv/ttsc-env.sh
6
+ #
7
+ # Exports ttsc's environment for this workspace: TTSC_TSGO_BINARY, the native
8
+ # TypeScript compiler (ttsc resolves only the unscoped `typescript` package by
9
+ # default, which here is the JavaScript compiler API), and TTSC_CACHE_DIR and
10
+ # TTSC_GO_CACHE_DIR, where ttsc keeps the plugin binaries it compiles and the
11
+ # Go build cache that compiles them.
12
+ #
13
+ # The compiler is always this checkout's own. An inherited cache directory is
14
+ # the host's choice and stays (CI points it at a cache shared across runs),
15
+ # unless the environment was bound for another workspace: an inherited
16
+ # NX_WORKSPACE_ROOT_PATH naming another directory says so, the evidence
17
+ # nx-socket-dir.sh drops that workspace's Nx state on. Its ttsc cache is then
18
+ # dropped too, and this workspace takes its own. A hook inherits whatever
19
+ # environment ran `git`; run from a shell bound to another checkout, every
20
+ # commit here compiled ttsc plugins into that checkout's cache, and failed
21
+ # outright once that checkout's cache was gone.
22
+ smoo_ttsc_checkout="$(pwd -P)"
23
+ if [ -n "${NX_WORKSPACE_ROOT_PATH:-}" ] &&
24
+ [ "$(cd "$NX_WORKSPACE_ROOT_PATH" >/dev/null 2>&1 && pwd -P)" != "$smoo_ttsc_checkout" ]; then
25
+ unset TTSC_CACHE_DIR TTSC_GO_CACHE_DIR
26
+ fi
27
+ unset smoo_ttsc_checkout
28
+ if [ -f "$PWD/tooling/direnv/typescript-go.nix" ]; then
29
+ export TTSC_TSGO_BINARY="$PWD/tooling/direnv/.devenv/profile/bin/tsgo"
30
+ if [ ! -x "$TTSC_TSGO_BINARY" ]; then
31
+ echo "ttsc-env.sh: native TypeScript producer is declared, but checkout profile/bin/tsgo is unavailable: $TTSC_TSGO_BINARY" >&2
32
+ return 1
33
+ fi
34
+ else
35
+ export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
36
+ fi
37
+ export TTSC_CACHE_DIR="${TTSC_CACHE_DIR:-$PWD/.cache/ttsc}"
38
+ export TTSC_GO_CACHE_DIR="${TTSC_GO_CACHE_DIR:-$TTSC_CACHE_DIR/go-build}"
39
+ mkdir -p "$TTSC_GO_CACHE_DIR"
@@ -3,13 +3,12 @@ cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
5
  export PATH="$("$TOOLING/direnv/repo-path")"
6
- # ttsc compiles with the native TypeScript compiler, which the dev shell names in
7
- # TTSC_TSGO_BINARY. A hook runs outside that shell, where ttsc would resolve the
8
- # JavaScript compiler a package's `typescript` dependency names and refuse to run.
9
- if [ -z "${TTSC_TSGO_BINARY:-}" ] && [ -x "$PWD/node_modules/@typescript/native/bin/tsc" ]; then
10
- export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
11
- fi
6
+ # ttsc compiles with this checkout's native TypeScript compiler into this
7
+ # checkout's plugin cache, which the dev shell names. A hook runs outside that
8
+ # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
9
+ . "$TOOLING/direnv/ttsc-env.sh"
12
10
 
13
11
  set -e -o pipefail
14
12
 
15
13
  smoo monorepo validate-commit-msg --fix "$1"
14
+ smoo monorepo check-public-denylist --commit-message "$1"
@@ -3,12 +3,10 @@ cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
5
  export PATH="$("$TOOLING/direnv/repo-path")"
6
- # ttsc compiles with the native TypeScript compiler, which the dev shell names in
7
- # TTSC_TSGO_BINARY. A hook runs outside that shell, where ttsc would resolve the
8
- # JavaScript compiler a package's `typescript` dependency names and refuse to run.
9
- if [ -z "${TTSC_TSGO_BINARY:-}" ] && [ -x "$PWD/node_modules/@typescript/native/bin/tsc" ]; then
10
- export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
11
- fi
6
+ # ttsc compiles with this checkout's native TypeScript compiler into this
7
+ # checkout's plugin cache, which the dev shell names. A hook runs outside that
8
+ # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
9
+ . "$TOOLING/direnv/ttsc-env.sh"
12
10
 
13
11
  set -e -o pipefail
14
12
 
@@ -19,6 +17,9 @@ set -e -o pipefail
19
17
  # pre-format entry a partial commit strands in the real index.
20
18
  git-format-staged
21
19
 
20
+ # Judge the formatted added lines from that same index, not unstaged edits.
21
+ smoo monorepo check-public-denylist --staged
22
+
22
23
  # Adding a workspace package is rare and easy to leave half-wired. Run the
23
24
  # full monorepo validator only for newly staged package manifests.
24
25
  smoo monorepo validate --fail-fast --only-if-new-workspace-package
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
  # Two gates, in order.
3
3
  #
4
- # 1. On every OS, the public-tree denylist: every commit this push publishes
5
- # is refused if its tree matches a pattern from this clone's local
6
- # `smoothbricks.publicDenylist` git config (or SMOOTHBRICKS_PUBLIC_DENYLIST).
7
- # The patterns live outside the repository so the guard never publishes what
8
- # it guards; with none configured the check passes silently.
4
+ # 1. On every OS, the public denylist: every commit this push publishes is
5
+ # refused if its tree, or the message of any commit the remote does not hold
6
+ # yet, matches a pattern from this clone's local `smoothbricks.publicDenylist`
7
+ # git config (or SMOOTHBRICKS_PUBLIC_DENYLIST). The patterns live outside the
8
+ # repository so the guard never publishes what it guards; with none
9
+ # configured the check passes silently.
9
10
  #
10
11
  # 2. The macOS-only Linux cross-compile gate. It is a cache PROBE and nothing
11
12
  # else: it reads the nx cache and never compiles. A hit means a real
@@ -31,18 +32,22 @@
31
32
 
32
33
  cd "$(git rev-parse --show-toplevel)"
33
34
  TOOLING="$PWD/tooling"
35
+ # A push to the `backup` remote is a private mirror, not publication: both
36
+ # gates below guard publication only, so they do not apply.
37
+ if [ "${1:-}" = backup ]; then exit 0; fi
34
38
 
35
39
  export PATH="$("$TOOLING/direnv/repo-path")"
36
- # ttsc compiles with the native TypeScript compiler, which the dev shell names in
37
- # TTSC_TSGO_BINARY. A hook runs outside that shell, where ttsc would resolve the
38
- # JavaScript compiler a package's `typescript` dependency names and refuse to run.
39
- if [ -z "${TTSC_TSGO_BINARY:-}" ] && [ -x "$PWD/node_modules/@typescript/native/bin/tsc" ]; then
40
- export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
41
- fi
40
+ # ttsc compiles with this checkout's native TypeScript compiler into this
41
+ # checkout's plugin cache, which the dev shell names. A hook runs outside that
42
+ # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
43
+ . "$TOOLING/direnv/ttsc-env.sh"
42
44
 
43
- # git hands a pre-push hook one `<local ref> <local sha> <remote ref> <remote sha>`
44
- # line per ref it updates; an all-zero local sha is a deletion, which publishes
45
- # no tree.
45
+ # git hands a pre-push hook the remote's name as $1 and one
46
+ # `<local ref> <local sha> <remote ref> <remote sha>` line per ref it updates;
47
+ # an all-zero local sha is a deletion, which publishes no tree. The pushed shas
48
+ # are the tips to judge; --remote narrows the commit messages judged to those
49
+ # the remote's tracking branches do not already hold, so history that is
50
+ # already public is not judged again on every push.
46
51
  pushed=()
47
52
  while read -r _local_ref local_sha _remote_ref _remote_sha; do
48
53
  case "$local_sha" in
@@ -50,7 +55,7 @@ while read -r _local_ref local_sha _remote_ref _remote_sha; do
50
55
  esac
51
56
  done
52
57
  if [ "${#pushed[@]}" -gt 0 ]; then
53
- smoo monorepo check-public-denylist "${pushed[@]}" || exit 1
58
+ smoo monorepo check-public-denylist --remote "$1" "${pushed[@]}" || exit 1
54
59
  fi
55
60
 
56
61
  case "$(uname -s)" in
@@ -20,26 +20,26 @@ runs:
20
20
  - name: Restore devenv and direnv state
21
21
  id: restore-devenv
22
22
  if: inputs.mode == 'restore'
23
- uses: actions/cache/restore@v5.0.5
23
+ uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
24
24
  with:
25
25
  path: |
26
26
  ${{ github.workspace }}/tooling/direnv/.devenv
27
27
  ${{ github.workspace }}/tooling/direnv/.direnv
28
28
  key:
29
29
  ${{ runner.os }}-${{ runner.arch }}-devenv-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
30
- 'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.smoo.nix', 'tooling/direnv/devenv.lock',
31
- 'tooling/direnv/envrc.sh', 'tooling/direnv/setup-environment.ts') }}
30
+ 'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.smoo.nix', 'tooling/direnv/devenv.lock', '.envrc',
31
+ 'tooling/direnv/setup-environment.ts') }}
32
32
  restore-keys: |
33
33
  ${{ runner.os }}-${{ runner.arch }}-devenv-v3-
34
34
 
35
35
  - name: Save devenv and direnv state
36
36
  if: inputs.mode == 'save'
37
- uses: actions/cache/save@v5.0.5
37
+ uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
38
38
  with:
39
39
  path: |
40
40
  ${{ github.workspace }}/tooling/direnv/.devenv
41
41
  ${{ github.workspace }}/tooling/direnv/.direnv
42
42
  key:
43
43
  ${{ runner.os }}-${{ runner.arch }}-devenv-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
44
- 'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.smoo.nix', 'tooling/direnv/devenv.lock',
45
- 'tooling/direnv/envrc.sh', 'tooling/direnv/setup-environment.ts') }}
44
+ 'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.smoo.nix', 'tooling/direnv/devenv.lock', '.envrc',
45
+ 'tooling/direnv/setup-environment.ts') }}
@@ -5,12 +5,14 @@ runs:
5
5
  using: composite
6
6
  steps:
7
7
  - name: Cache node_modules
8
- uses: actions/cache@v5.0.5
8
+ uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
9
9
  with:
10
- # Dependencies only. ttsc plugin/GOCACHE live under $TTSC_CACHE_DIR
11
- # (.cache/ttsc), not inside node_modules.
10
+ # Isolated Bun links and their targets are one dependency tree.
11
+ # ttsc plugin/GOCACHE stay under $TTSC_CACHE_DIR (.cache/ttsc).
12
12
  # v2 isolates restore-keys from older Darwin caches with a broken TS dual-package hoist.
13
- path: node_modules
13
+ path: |
14
+ node_modules
15
+ ~/.bun/install/cache/links
14
16
  # prettier-ignore
15
17
  key: ${{ runner.os }}-${{ runner.arch }}-node-v2-{{NODE_MODULES_CACHE_KEY}}
16
18
  restore-keys: |
@@ -11,7 +11,7 @@ runs:
11
11
  steps:
12
12
  - name: Restore Nx cache
13
13
  id: restore
14
- uses: actions/cache/restore@v5.0.5
14
+ uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
15
15
  with:
16
16
  path: |
17
17
  .nx/cache
@@ -9,7 +9,7 @@ runs:
9
9
  using: composite
10
10
  steps:
11
11
  - name: Cache ttsc plugin binaries
12
- uses: actions/cache@v5.0.5
12
+ uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
13
13
  with:
14
14
  # Only the compiled plugin binaries (~30MB each). Path is relative to the
15
15
  # workspace; devenv sets TTSC_CACHE_DIR to <repo>/.cache/ttsc.
@@ -0,0 +1,99 @@
1
+ 'use strict';
2
+
3
+ // Shared bootstrap of the managed Forgejo artifact actions (forgejo-upload-artifact, forgejo-download-artifact).
4
+ //
5
+ // Forgejo only resolves a step's `uses:` from a full URL or a name under DEFAULT_ACTIONS_URL, and its stock
6
+ // upload/download clients are the GHES-gated GitHub ones. The pinned code.forgejo.org clients lift that gate, so each
7
+ // wrapper action fetches its exact pinned commit into a private temporary directory and runs the original dist entry
8
+ // with the wrapper's own environment: the INPUT_* variables go in unchanged and the original action writes
9
+ // GITHUB_OUTPUT itself. Nothing here interprets, rewrites or defaults an input or an output.
10
+ //
11
+ // No dependencies beyond Node and git. No credential is persisted, and git cannot prompt.
12
+
13
+ const { spawnSync } = require('node:child_process');
14
+ const { mkdtempSync, rmSync } = require('node:fs');
15
+ const { join } = require('node:path');
16
+
17
+ const GIT_ENVIRONMENT_THAT_REDIRECTS_THE_REPOSITORY = ['GIT_DIR', 'GIT_WORK_TREE', 'GIT_INDEX_FILE'];
18
+
19
+ function fail(message, status = 1) {
20
+ process.stderr.write('forgejo-artifact: ' + message + '\n');
21
+ process.exitCode = status;
22
+ }
23
+ function describeExit(result) {
24
+ if (result.error) return 'could not start: ' + result.error.message;
25
+ if (result.signal) return 'was killed by signal ' + result.signal;
26
+ return 'exited with status ' + result.status;
27
+ }
28
+
29
+ function gitEnvironment() {
30
+ const environment = { ...process.env, GIT_TERMINAL_PROMPT: '0' };
31
+ for (const name of GIT_ENVIRONMENT_THAT_REDIRECTS_THE_REPOSITORY) delete environment[name];
32
+ return environment;
33
+ }
34
+
35
+ function git(directory, args, captureStdout = false) {
36
+ const result = spawnSync('git', args, {
37
+ cwd: directory,
38
+ env: gitEnvironment(),
39
+ encoding: 'utf8',
40
+ stdio: ['ignore', captureStdout ? 'pipe' : 'inherit', 'inherit'],
41
+ });
42
+ if (result.error || result.status !== 0) {
43
+ fail('git ' + args.join(' ') + ' ' + describeExit(result));
44
+ return null;
45
+ }
46
+ return captureStdout ? result.stdout : '';
47
+ }
48
+
49
+ function checkout(directory, pin) {
50
+ for (const args of [
51
+ ['init', '--quiet', '--initial-branch=main'],
52
+ ['fetch', '--quiet', '--depth=1', '--no-tags', pin.repository, pin.commit],
53
+ ['-c', 'advice.detachedHead=false', 'checkout', '--quiet', '--detach', pin.commit],
54
+ ]) {
55
+ if (git(directory, args) === null) return false;
56
+ }
57
+ const revision = git(directory, ['rev-parse', 'HEAD'], true);
58
+ if (revision === null) return false;
59
+ const head = revision.trim();
60
+ if (head !== pin.commit) {
61
+ fail('checked out HEAD ' + head + ' is not the pinned commit ' + pin.commit);
62
+ return false;
63
+ }
64
+ return true;
65
+ }
66
+
67
+ /** Run the pinned original action: {repository, commit, entry}. Sets process.exitCode; never throws. */
68
+ function run(pin) {
69
+ process.exitCode = 0;
70
+ const runnerTemp = process.env.RUNNER_TEMP;
71
+ if (!runnerTemp) {
72
+ fail('RUNNER_TEMP is not set, so there is nowhere private to fetch ' + pin.repository);
73
+ return;
74
+ }
75
+ let directory;
76
+ try {
77
+ directory = mkdtempSync(join(runnerTemp, 'forgejo-artifact-'));
78
+ if (!checkout(directory, pin)) return;
79
+ const result = spawnSync(process.execPath, [join(directory, pin.entry)], { stdio: 'inherit' });
80
+ if (result.error || result.status !== 0) {
81
+ fail(
82
+ pin.repository + '@' + pin.commit + ' ' + pin.entry + ' ' + describeExit(result),
83
+ result.error || result.status === null ? 1 : result.status,
84
+ );
85
+ }
86
+ } catch (error) {
87
+ fail(error instanceof Error ? error.message : String(error));
88
+ } finally {
89
+ if (directory !== undefined) {
90
+ try {
91
+ rmSync(directory, { recursive: true, force: true });
92
+ } catch (error) {
93
+ fail('could not remove ' + directory + ': ' + String(error), process.exitCode || 1);
94
+ }
95
+ }
96
+ }
97
+ }
98
+
99
+ module.exports = { run };
@@ -0,0 +1,49 @@
1
+ name: 'Download a Build Artifact'
2
+ description: 'Download a build artifact that was previously uploaded in the workflow by the upload-artifact action'
3
+ author: 'GitHub'
4
+ inputs:
5
+ name:
6
+ description: 'Name of the artifact to download. If unspecified, all artifacts for the run are downloaded.'
7
+ required: false
8
+ artifact-ids:
9
+ description:
10
+ 'IDs of the artifacts to download, comma-separated. Either inputs `artifact-ids` or `name` can be used, but not
11
+ both.'
12
+ required: false
13
+ path:
14
+ description: 'Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE'
15
+ required: false
16
+ pattern:
17
+ description: 'A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified.'
18
+ required: false
19
+ merge-multiple:
20
+ description:
21
+ 'When multiple artifacts are matched, this changes the behavior of the destination directories. If true, the
22
+ downloaded artifacts will be in the same directory specified by path. If false, the downloaded artifacts will be
23
+ extracted into individual named directories within the specified path.'
24
+ required: false
25
+ default: 'false'
26
+ github-token:
27
+ description:
28
+ 'The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a
29
+ different repository or from a different workflow run. If this is not specified, the action will attempt to
30
+ download artifacts from the current repository and the current workflow run.'
31
+ required: false
32
+ repository:
33
+ description:
34
+ 'The repository owner and the repository name joined together by "/". If github-token is specified, this is the
35
+ repository that artifacts will be downloaded from.'
36
+ required: false
37
+ default: ${{ github.repository }}
38
+ run-id:
39
+ description:
40
+ 'The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified,
41
+ this is the run that artifacts will be downloaded from.'
42
+ required: false
43
+ default: ${{ github.run_id }}
44
+ outputs:
45
+ download-path:
46
+ description: 'Path of artifact download'
47
+ runs:
48
+ using: 'node24'
49
+ main: 'index.cjs'
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ require('../forgejo-artifact.cjs').run({
4
+ repository: 'https://code.forgejo.org/forgejo/download-artifact',
5
+ commit: '769f970437aa3291b13f35dc23fc87967d7fb19f', // v7
6
+ entry: 'dist/index.js',
7
+ });
@@ -0,0 +1,65 @@
1
+ name: 'Upload a Build Artifact'
2
+ description: 'Upload a build artifact that can be used by subsequent workflow steps'
3
+ author: 'GitHub'
4
+ inputs:
5
+ name:
6
+ description: 'Artifact name'
7
+ default: 'artifact'
8
+ path:
9
+ description: 'A file, directory or wildcard pattern that describes what to upload'
10
+ required: true
11
+ if-no-files-found:
12
+ description: >
13
+ The desired behavior if no files are found using the provided path.
14
+
15
+ Available Options:
16
+ warn: Output a warning but do not fail the action
17
+ error: Fail the action with an error message
18
+ ignore: Do not output any warnings or errors, the action does not fail
19
+ default: 'warn'
20
+ retention-days:
21
+ description: >
22
+ Duration after which artifact will expire in days. 0 means using default retention.
23
+
24
+ Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
25
+ compression-level:
26
+ description: >
27
+ The level of compression for Zlib to be applied to the artifact archive. The value can range from 0 to 9: - 0: No
28
+ compression - 1: Best speed - 6: Default compression (same as GNU Gzip) - 9: Best compression Higher levels will
29
+ result in better compression, but will take longer to complete. For large files that are not easily compressed, a
30
+ value of 0 is recommended for significantly faster uploads.
31
+ default: '6'
32
+ overwrite:
33
+ description: >
34
+ If true, an artifact with a matching name will be deleted before a new one is uploaded. If false, the action will
35
+ fail if an artifact for the given name already exists. Does not fail if the artifact does not exist.
36
+ default: 'false'
37
+ include-hidden-files:
38
+ description: >
39
+ If true, hidden files will be included in the artifact. If false, hidden files will be excluded from the artifact.
40
+ default: 'false'
41
+
42
+ outputs:
43
+ artifact-id:
44
+ description: >
45
+ A unique identifier for the artifact that was just uploaded. Empty if the artifact upload failed.
46
+
47
+ This ID can be used as input to other APIs to download, delete or get more information about an artifact:
48
+ https://docs.github.com/en/rest/actions/artifacts
49
+ artifact-url:
50
+ description: >
51
+ A download URL for the artifact that was just uploaded. Empty if the artifact upload failed.
52
+
53
+ This download URL only works for requests Authenticated with GitHub. Anonymous downloads will be prompted to first
54
+ login. If an anonymous download URL is needed than a short time restricted URL can be generated using the download
55
+ artifact API: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact
56
+
57
+ This URL will be valid for as long as the artifact exists and the workflow run and repository exists. Once an
58
+ artifact has expired this URL will no longer work. Common uses cases for such a download URL can be adding
59
+ download links to artifacts in descriptions or comments on pull requests or issues.
60
+ artifact-digest:
61
+ description: >
62
+ SHA-256 digest for the artifact that was just uploaded. Empty if the artifact upload failed.
63
+ runs:
64
+ using: 'node24'
65
+ main: 'index.cjs'
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ require('../forgejo-artifact.cjs').run({
4
+ repository: 'https://code.forgejo.org/forgejo/upload-artifact',
5
+ commit: 'cb8afe72b42edc798abfb8fcb556cf660d894245', // v5
6
+ entry: 'dist/upload/index.js',
7
+ });
@@ -176,7 +176,7 @@ runs:
176
176
  # still finds them.
177
177
  - name: ❄️ Install Nix
178
178
  if: steps.runner-kind.outputs.host != 'true'
179
- uses: nixbuild/nix-quick-install-action@v35
179
+ uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35
180
180
  with:
181
181
  nix_conf: |
182
182
  keep-outputs = true
@@ -210,7 +210,7 @@ runs:
210
210
  - name: 🧊 Cache Nix store
211
211
  id: nix-cache
212
212
  if: steps.runner-kind.outputs.host != 'true'
213
- uses: nix-community/cache-nix-action@v7
213
+ uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7
214
214
  with:
215
215
  paths: |
216
216
  /nix
@@ -220,9 +220,27 @@ runs:
220
220
  restore-prefixes-first-match: ${{ runner.os }}-${{ runner.arch }}-nix-v6-
221
221
  gc-max-store-size: 1G
222
222
 
223
+ # cache-nix-action unpacks through sudo, so the directory it creates on the
224
+ # way to ~/.cache/nix, ~/.cache itself, belongs to root. Every later step runs
225
+ # as the runner, and the first one that makes something there (smoo's
226
+ # cargo-fetch stamp under ~/.cache/smoo) fails with EACCES. ~/.cache/nix inside
227
+ # it stays the runner's.
228
+ - name: 🏠 Give ~/.cache back to the runner
229
+ if: steps.runner-kind.outputs.host != 'true'
230
+ shell: bash
231
+ run: |
232
+ mkdir -p "$HOME/.cache"
233
+ if [ -O "$HOME/.cache" ]; then
234
+ echo "$HOME/.cache is already the runner's"
235
+ else
236
+ ls -ld "$HOME/.cache"
237
+ sudo chown "$(id -u):$(id -g)" "$HOME/.cache"
238
+ echo "gave ~/.cache to $(id -un)"
239
+ fi
240
+
223
241
  - name: ⚡ Enable Cachix
224
242
  if: steps.runner-kind.outputs.host != 'true'
225
- uses: cachix/cachix-action@v17
243
+ uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17
226
244
  with:
227
245
  name: devenv
228
246
 
@@ -44,9 +44,8 @@ __SMOO_CI_RUNS_ON__
44
44
  timeout-minutes: 30
45
45
  __SMOO_PRIVATE_INSTALL_ENV__ steps:
46
46
  - name: 📥 Checkout
47
- uses: actions/checkout@v6.0.2
47
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
48
48
  with:
49
- filter: blob:none
50
49
  fetch-depth: 0
51
50
  persist-credentials: true
52
51
  # Prefer MANAGED_FILES_TOKEN so push can update workflow files.
package/nextest.toml CHANGED
@@ -1,51 +1,18 @@
1
1
  # Injected by @smoothbricks/nx-plugin as `--config-file` on inferred cargo-test
2
- # package targets. `period` matches bun's `--timeout=30000`; `terminate-after = 1`
3
- # kills at that bound instead of warning then waiting another period.
2
+ # package targets. `period` matches bun's `--timeout=30000`. A slow-timeout here
3
+ # only warns: nextest prints a `SLOW` line naming the test every period, and
4
+ # never kills it. The run's no-progress bound (`idleTimeoutMs`, README "Bounded
5
+ # Test Targets") ends a test that never returns, and names it from those lines.
4
6
  [profile.default]
5
- slow-timeout = { period = "30s", terminate-after = 1 }
7
+ slow-timeout = { period = "30s" }
6
8
 
7
9
  # Compile-fail tests compile fixture crates (or rustc a negative contract) as
8
10
  # their body. `cargo test --no-run` cannot pre-build those; they are generated
9
11
  # at test time. Filterset matches the class by test name rather than listing
10
12
  # today's two tests (`compile_fail_cases`, `lesser_capabilities_fail_to_compile_*`).
11
13
  #
12
- # 180s is provisional: measure the test alone on an idle machine.
13
- # An unbounded run phase is how a hung test becomes a hung lane.
14
+ # Their raised period is what marks them exceptional: the plugin lifts them out
15
+ # of the ordinary hash into partitions of their own.
14
16
  [[profile.default.overrides]]
15
17
  filter = 'test(/compile_fail|fail_to_compile/)'
16
- slow-timeout = { period = "180s", terminate-after = 1 }
17
-
18
- # The full-lifecycle real-APFS tests cannot meet the default deadline, and
19
- # `specs/cowshed/08_testing.md` already contains the arithmetic that proves it.
20
- #
21
- # That spec sets the house rule for real-substrate timing: "CI asserts with a 3×
22
- # multiplier to absorb runner noise". `apfs_integration.rs` measured its lifecycle
23
- # at 14.8s on an IDLE host when it still ran a second image format, so under the
24
- # repo's own noise model CI needed 44.4s. A 30s deadline was therefore unreachable
25
- # by construction: the test was not slow, the bound contradicted the spec. The
26
- # one-format lifecycle measures 6.6-10.6s idle, so the bound below still covers it.
27
- #
28
- # Nor is the cost reducible. The same spec's "Attach floor verdict: not
29
- # flag-reducible" records that `-noverify` saves ~15ms (noise), `-noautofsck`
30
- # nothing, and `diskutil image attach` exposes no equivalent knobs — the ~235-400ms
31
- # per attach is inherent to DiskImages + APFS mount + DiskArbitration, and halving
32
- # it would need DiskImages2 or the diskarbitrationd private API, which the spec
33
- # explicitly forbids budgets from assuming. The lifecycle attaches once per phase
34
- # across adopt, mount, clone-under-churn, checkpoint, restore, retire, reclaim, GC
35
- # and detach, so its floor is a multiple of an irreducible constant.
36
- #
37
- # The alternative was splitting the lifecycle into phase-scoped tests so each fits
38
- # 30s. It loses: every split pays that attach constant again, so the suite's total
39
- # wall time rises to buy a smaller per-test bound; splitting phases buys only a
40
- # number.
41
- #
42
- # 60s is 3× the worst idle measurement (44.4s) rounded up, not a guess. It stays
43
- # bounded because an unbounded run phase is how a hung test becomes a hung lane.
44
- # Re-derive it if the idle measurements in `apfs_integration.rs` change.
45
- #
46
- # Membership is by name and narrower than the class: the fast `real_apfs_*` unit
47
- # tests in the lib keep the 30s default — they passed at 4.4s and 7.3s and have no
48
- # claim on more.
49
- [[profile.default.overrides]]
50
- filter = 'test(/real_apfs_.*_substrate_lifecycle/)'
51
- slow-timeout = { period = "60s", terminate-after = 1 }
18
+ slow-timeout = { period = "180s" }