@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.
- package/README.md +994 -117
- package/dist/bin/smoo-nx-bound-failures.d.ts +3 -0
- package/dist/bin/smoo-nx-bound-failures.d.ts.map +1 -0
- package/dist/bin/smoo-nx-bound-failures.js +31 -0
- package/dist/bin/smoo-nx-cargo-hash.js +28 -3
- package/dist/bin/smoo-nx-exec.js +15 -73
- package/dist/bin/smoo-nx-failures.d.ts +3 -0
- package/dist/bin/smoo-nx-failures.d.ts.map +1 -0
- package/dist/bin/smoo-nx-failures.js +3 -0
- package/dist/bin/smoo-nx-nextest-extract.js +3 -2
- package/dist/bin/smoo-nx-test-walks.d.ts +3 -0
- package/dist/bin/smoo-nx-test-walks.d.ts.map +1 -0
- package/dist/bin/smoo-nx-test-walks.js +34 -0
- package/dist/bounded-test-policy.d.ts +7 -1
- package/dist/bounded-test-policy.d.ts.map +1 -1
- package/dist/bounded-test-policy.js +101 -40
- package/dist/build-state-output-policy.d.ts +25 -0
- package/dist/build-state-output-policy.d.ts.map +1 -0
- package/dist/build-state-output-policy.js +64 -0
- package/dist/cargo-closure-input.d.ts +3 -2
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +16 -15
- package/dist/cargo-dev-profile.d.ts +37 -0
- package/dist/cargo-dev-profile.d.ts.map +1 -0
- package/dist/cargo-dev-profile.js +108 -0
- package/dist/cargo-source-hash.d.ts +43 -6
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +309 -73
- package/dist/cargo-toolchain-policy.d.ts +4 -0
- package/dist/cargo-toolchain-policy.d.ts.map +1 -1
- package/dist/cargo-toolchain-policy.js +5 -0
- package/dist/cargo-workspace.d.ts +101 -5
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +291 -10
- package/dist/cross-check-policy.d.ts +21 -3
- package/dist/cross-check-policy.d.ts.map +1 -1
- package/dist/cross-check-policy.js +24 -6
- package/dist/disk-command-policy.d.ts +7 -0
- package/dist/disk-command-policy.d.ts.map +1 -0
- package/dist/disk-command-policy.js +98 -0
- package/dist/ensure-built-receipt.d.ts +25 -0
- package/dist/ensure-built-receipt.d.ts.map +1 -0
- package/dist/ensure-built-receipt.js +261 -0
- package/dist/ensure-built-witness.d.ts +57 -0
- package/dist/ensure-built-witness.d.ts.map +1 -0
- package/dist/ensure-built-witness.js +412 -0
- package/dist/ensure-built.d.ts +207 -12
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +576 -202
- package/dist/eslint-file-set.d.ts +7 -0
- package/dist/eslint-file-set.d.ts.map +1 -0
- package/dist/eslint-file-set.js +12 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts +63 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-pool.js +379 -0
- package/dist/executors/bounded-exec/cpu-tokens.d.ts +82 -0
- package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-tokens.js +114 -0
- package/dist/executors/bounded-exec/disk-lease.d.ts +61 -0
- package/dist/executors/bounded-exec/disk-lease.d.ts.map +1 -0
- package/dist/executors/bounded-exec/disk-lease.js +91 -0
- package/dist/executors/bounded-exec/executor.d.ts +45 -2
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +447 -52
- package/dist/executors/bounded-exec/gateway-lease.d.ts +52 -0
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -0
- package/dist/executors/bounded-exec/gateway-lease.js +143 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +35 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -0
- package/dist/executors/bounded-exec/hang-diagnostics.js +231 -0
- package/dist/executors/bounded-exec/progress.d.ts +35 -0
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -0
- package/dist/executors/bounded-exec/progress.js +79 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +3 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.js +12 -0
- package/dist/executors/bounded-exec/ram-temp-held.d.ts +91 -0
- package/dist/executors/bounded-exec/ram-temp-held.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-temp-held.js +152 -0
- package/dist/executors/bounded-exec/ram-temp.d.ts +223 -0
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-temp.js +1528 -0
- package/dist/executors/bounded-exec/schema.d.ts +29 -11
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.d.ts +162 -0
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -0
- package/dist/executors/bounded-exec/verdict.js +318 -0
- package/dist/executors/shard-timings/executor.d.ts +14 -0
- package/dist/executors/shard-timings/executor.d.ts.map +1 -0
- package/dist/executors/shard-timings/executor.js +25 -0
- package/dist/executors/shard-timings/schema.d.ts +4 -0
- package/dist/executors/shard-timings/schema.d.ts.map +1 -0
- package/dist/executors/shard-timings/schema.js +1 -0
- package/dist/failure-summary.d.ts +5 -0
- package/dist/failure-summary.d.ts.map +1 -0
- package/dist/failure-summary.js +118 -0
- package/dist/generators/create-package/generator.d.ts.map +1 -1
- package/dist/generators/create-package/generator.js +6 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +370 -138
- package/dist/managed-files/ci-workflow.d.ts +13 -0
- package/dist/managed-files/ci-workflow.d.ts.map +1 -1
- package/dist/managed-files/ci-workflow.js +44 -13
- package/dist/managed-files/files.d.ts +7 -1
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +62 -8
- package/dist/managed-files/json-edit.d.ts +21 -0
- package/dist/managed-files/json-edit.d.ts.map +1 -0
- package/dist/managed-files/json-edit.js +295 -0
- package/dist/managed-files/managed-format.d.ts +33 -1
- package/dist/managed-files/managed-format.d.ts.map +1 -1
- package/dist/managed-files/managed-format.js +82 -2
- package/dist/managed-files/pr-preview-cleanup-workflow.d.ts +7 -0
- package/dist/managed-files/pr-preview-cleanup-workflow.d.ts.map +1 -1
- package/dist/managed-files/pr-preview-cleanup-workflow.js +68 -4
- package/dist/managed-files/publish-workflow.d.ts.map +1 -1
- package/dist/managed-files/publish-workflow.js +231 -48
- package/dist/managed-files/tree.d.ts +5 -0
- package/dist/managed-files/tree.d.ts.map +1 -1
- package/dist/managed-files/tree.js +5 -3
- package/dist/manifest-hash.d.ts.map +1 -1
- package/dist/manifest-hash.js +2 -5
- package/dist/nextest-code-bound.d.ts +62 -0
- package/dist/nextest-code-bound.d.ts.map +1 -0
- package/dist/nextest-code-bound.js +154 -0
- package/dist/nextest-extraction.d.ts +24 -8
- package/dist/nextest-extraction.d.ts.map +1 -1
- package/dist/nextest-extraction.js +42 -7
- package/dist/package-target-policy.d.ts.map +1 -1
- package/dist/package-target-policy.js +3 -5
- package/dist/release-config-policy.d.ts.map +1 -1
- package/dist/release-config-policy.js +3 -5
- package/dist/runtime-input.d.ts +14 -0
- package/dist/runtime-input.d.ts.map +1 -0
- package/dist/runtime-input.js +15 -0
- package/dist/rust-tokens.d.ts +11 -0
- package/dist/rust-tokens.d.ts.map +1 -0
- package/dist/rust-tokens.js +81 -0
- package/dist/task-results.d.ts +6 -0
- package/dist/task-results.d.ts.map +1 -0
- package/dist/task-results.js +61 -0
- package/dist/test-program.d.ts +54 -0
- package/dist/test-program.d.ts.map +1 -0
- package/dist/test-program.js +292 -0
- package/dist/test-timings.d.ts +71 -0
- package/dist/test-timings.d.ts.map +1 -0
- package/dist/test-timings.js +393 -0
- package/dist/test-walk-policy.d.ts +103 -0
- package/dist/test-walk-policy.d.ts.map +1 -0
- package/dist/test-walk-policy.js +657 -0
- package/dist/testing.d.ts +177 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +824 -0
- package/dist/type-guards.d.ts +3 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/type-guards.js +4 -0
- package/dist/typecheck-test-policy.d.ts +8 -5
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +113 -100
- package/dist/workspace-config-policy.d.ts +8 -0
- package/dist/workspace-config-policy.d.ts.map +1 -1
- package/dist/workspace-config-policy.js +175 -63
- package/dist/workspace-index.d.ts +12 -0
- package/dist/workspace-index.d.ts.map +1 -0
- package/dist/workspace-index.js +17 -0
- package/dist/workspace-manifest.d.ts +37 -0
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/executors.json +5 -0
- package/loader.js +13 -11
- package/managed/raw/envrc +33 -67
- package/managed/raw/git-format-staged.yml +30 -35
- package/managed/raw/patches/nx@23.2.1.patch +3484 -0
- package/managed/raw/tooling/direnv/apple-developer.sh +83 -0
- package/managed/raw/tooling/direnv/developer-links.ts +569 -11
- package/managed/raw/tooling/direnv/devenv.smoo.nix +314 -93
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +20 -11
- package/managed/raw/tooling/direnv/linked-snapshots.ts +845 -0
- package/managed/raw/tooling/direnv/nx-socket-dir.sh +82 -0
- package/managed/raw/tooling/direnv/repo-path +14 -2
- package/managed/raw/tooling/direnv/setup-environment.ts +962 -148
- package/managed/raw/tooling/direnv/toolchain-stamp.ts +45 -3
- package/managed/raw/tooling/direnv/ttsc-env.sh +39 -0
- package/managed/raw/tooling/git-hooks/commit-msg.sh +5 -6
- package/managed/raw/tooling/git-hooks/pre-commit.sh +7 -6
- package/managed/raw/tooling/git-hooks/pre-push.sh +20 -15
- package/managed/templates/github/actions/cache-nix-devenv/action.yml +6 -6
- package/managed/templates/github/actions/cache-node-modules/action.yml +6 -4
- package/managed/templates/github/actions/cache-nx/action.yml +1 -1
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +1 -1
- package/managed/templates/github/actions/forgejo-artifact.cjs +99 -0
- package/managed/templates/github/actions/forgejo-download-artifact/action.yml +49 -0
- package/managed/templates/github/actions/forgejo-download-artifact/index.cjs +7 -0
- package/managed/templates/github/actions/forgejo-upload-artifact/action.yml +65 -0
- package/managed/templates/github/actions/forgejo-upload-artifact/index.cjs +7 -0
- package/managed/templates/github/actions/setup-devenv/action.yml +21 -3
- package/managed/templates/github/workflows/managed-files.yml +1 -2
- package/nextest.toml +8 -41
- package/package.json +74 -12
- package/runtime-input.sh +81 -0
- package/src/__tests__/counted-cargo.ts +33 -14
- package/src/__tests__/fixture-nx-env.ts +111 -46
- package/src/__tests__/progress-clock.ts +43 -0
- package/src/__tests__/runtime-input.ts +23 -0
- package/src/bin/smoo-nx-bound-failures.test.ts +127 -0
- package/src/bin/smoo-nx-bound-failures.ts +33 -0
- package/src/bin/smoo-nx-cargo-hash.ts +28 -3
- package/src/bin/smoo-nx-exec.ts +16 -74
- package/src/bin/smoo-nx-failures.ts +4 -0
- package/src/bin/smoo-nx-nextest-extract.ts +3 -2
- package/src/bin/smoo-nx-test-walks.ts +42 -0
- package/src/bounded-test-policy.test.ts +268 -21
- package/src/bounded-test-policy.ts +114 -42
- package/src/build-state-output-policy.test.ts +115 -0
- package/src/build-state-output-policy.ts +90 -0
- package/src/bun-bootstrap.test.ts +57 -3
- package/src/bun-file-packages.test.ts +47 -0
- package/src/cargo-closure-input.test.ts +138 -66
- package/src/cargo-closure-input.ts +17 -15
- package/src/cargo-dev-profile.ts +137 -0
- package/src/cargo-resolve-cache.test.ts +70 -1
- package/src/cargo-source-hash.test.ts +193 -97
- package/src/cargo-source-hash.ts +345 -68
- package/src/cargo-toolchain-policy.ts +6 -0
- package/src/cargo-workspace.test.ts +320 -0
- package/src/cargo-workspace.ts +336 -10
- package/src/cross-check-policy.test.ts +59 -1
- package/src/cross-check-policy.ts +25 -6
- package/src/disk-command-policy.test.ts +61 -0
- package/src/disk-command-policy.ts +107 -0
- package/src/ensure-built-receipt.test.ts +184 -0
- package/src/ensure-built-receipt.ts +263 -0
- package/src/ensure-built-witness.test.ts +344 -0
- package/src/ensure-built-witness.ts +252 -0
- package/src/ensure-built.test.ts +1036 -578
- package/src/ensure-built.ts +820 -224
- package/src/eslint-file-set.ts +9 -0
- package/src/executors/bounded-exec/cpu-pool.test.ts +454 -0
- package/src/executors/bounded-exec/cpu-pool.ts +417 -0
- package/src/executors/bounded-exec/cpu-tokens.test.ts +269 -0
- package/src/executors/bounded-exec/cpu-tokens.ts +177 -0
- package/src/executors/bounded-exec/disk-lease.test.ts +185 -0
- package/src/executors/bounded-exec/disk-lease.ts +139 -0
- package/src/executors/bounded-exec/executor-host.test.ts +778 -0
- package/src/executors/bounded-exec/executor.test.ts +1116 -63
- package/src/executors/bounded-exec/executor.ts +565 -67
- package/src/executors/bounded-exec/gateway-lease.ts +176 -0
- package/src/executors/bounded-exec/hang-diagnostics.test.ts +285 -0
- package/src/executors/bounded-exec/hang-diagnostics.ts +283 -0
- package/src/executors/bounded-exec/progress.test.ts +79 -0
- package/src/executors/bounded-exec/progress.ts +118 -0
- package/src/executors/bounded-exec/ram-temp-fixtures.ts +12 -0
- package/src/executors/bounded-exec/ram-temp-held.test.ts +264 -0
- package/src/executors/bounded-exec/ram-temp-held.ts +242 -0
- package/src/executors/bounded-exec/ram-temp-host.test.ts +605 -0
- package/src/executors/bounded-exec/ram-temp.test.ts +674 -0
- package/src/executors/bounded-exec/ram-temp.ts +1918 -0
- package/src/executors/bounded-exec/schema.json +11 -5
- package/src/executors/bounded-exec/schema.ts +27 -11
- package/src/executors/bounded-exec/verdict.test.ts +440 -0
- package/src/executors/bounded-exec/verdict.ts +433 -0
- package/src/executors/shard-timings/executor.ts +36 -0
- package/src/executors/shard-timings/schema.json +21 -0
- package/src/executors/shard-timings/schema.ts +4 -0
- package/src/failure-summary.ts +119 -0
- package/src/generators/bounded-test-targets/generator.test.ts +4 -4
- package/src/generators/bun-test-tracing/generator.test.ts +2 -2
- package/src/generators/create-package/generator.test.ts +6 -0
- package/src/generators/create-package/generator.ts +6 -2
- package/src/host-controller-wiring.test.ts +31 -0
- package/src/index.test.ts +909 -295
- package/src/index.ts +441 -143
- package/src/linked-snapshots.nx.test.ts +172 -0
- package/src/managed-files/ci-workflow.ts +54 -13
- package/src/managed-files/files.ts +65 -9
- package/src/managed-files/forgejo-artifact.test.ts +395 -0
- package/src/managed-files/generator.test.ts +60 -1
- package/src/managed-files/json-edit.test.ts +216 -0
- package/src/managed-files/json-edit.ts +290 -0
- package/src/managed-files/managed-format-json.test.ts +308 -0
- package/src/managed-files/managed-format.ts +90 -2
- package/src/managed-files/pr-preview-cleanup-workflow.ts +69 -3
- package/src/managed-files/publish-workflow.ts +285 -67
- package/src/managed-files/repo-path.test.ts +129 -0
- package/src/managed-files/trace-db-artifact.test.ts +7 -0
- package/src/managed-files/tree.ts +11 -3
- package/src/manifest-hash.ts +2 -6
- package/src/nextest-code-bound.test.ts +155 -0
- package/src/nextest-code-bound.ts +195 -0
- package/src/nextest-extraction.test.ts +37 -5
- package/src/nextest-extraction.ts +51 -9
- package/src/nextest-partitions.test.ts +427 -82
- package/src/nx-cache-bound.test.ts +5 -10
- package/src/nx-cache-restore-mtime.test.ts +170 -0
- package/src/nx-daemon-claim.test.ts +277 -0
- package/src/nx-daemon-idle-cpu.test.ts +81 -0
- package/src/nx-daemon-idle-policy.test.ts +51 -0
- package/src/nx-daemon-ignore-files.test.ts +210 -0
- package/src/nx-daemon-root-normalization.test.ts +105 -0
- package/src/nx-daemon-validity.test.ts +925 -0
- package/src/nx-dot-input-policy.test.ts +353 -0
- package/src/nx-failure-life-cycles.test.ts +207 -0
- package/src/nx-files-archive-racy.test.ts +97 -0
- package/src/nx-foreign-workspace-env.test.ts +329 -0
- package/src/nx-incomplete-run-summary.test.ts +70 -0
- package/src/nx-plugin-load-errors.test.ts +120 -0
- package/src/nx-project-resolution-cache.test.ts +176 -0
- package/src/nx-raw-inputs.test.ts +166 -0
- package/src/nx-resident-graph-workers.test.ts +7 -16
- package/src/nx-run-information.test.ts +118 -0
- package/src/nx-skipped-task-exit.test.ts +180 -0
- package/src/nx-state-location.test.ts +63 -0
- package/src/nx-store-resolution.test.ts +26 -25
- package/src/nx-task-graph-cycles.test.ts +148 -0
- package/src/nx-task-output-lease.test.ts +414 -0
- package/src/nx-use-local.test.ts +103 -0
- package/src/package-target-policy.ts +3 -6
- package/src/release-config-policy.ts +3 -6
- package/src/runtime-input.test.ts +215 -0
- package/src/runtime-input.ts +17 -0
- package/src/rust-tokens.ts +78 -0
- package/src/serial-group-wiring.test.ts +326 -0
- package/src/task-history-namespace.test.ts +87 -89
- package/src/task-results.test.ts +226 -0
- package/src/task-results.ts +75 -0
- package/src/test-program.test.ts +303 -0
- package/src/test-program.ts +341 -0
- package/src/test-timings.test.ts +240 -0
- package/src/test-timings.ts +311 -0
- package/src/test-walk-policy.test.ts +585 -0
- package/src/test-walk-policy.ts +731 -0
- package/src/testing.test.ts +509 -0
- package/src/testing.ts +922 -0
- package/src/type-guards.ts +4 -0
- package/src/typecheck-test-policy.test.ts +496 -11
- package/src/typecheck-test-policy.ts +137 -103
- package/src/workspace-config-policy.test.ts +212 -13
- package/src/workspace-config-policy.ts +101 -73
- package/src/workspace-index.ts +18 -0
- package/src/workspace-manifest.ts +41 -0
- package/test-timings.json +85 -30
- package/managed/raw/tooling/direnv/inherited-devenv.ts +0 -665
- package/managed/raw/tooling/direnv/shared-caches.sh +0 -53
|
@@ -31,12 +31,128 @@
|
|
|
31
31
|
hash = "sha256-ebjX+1+9axEqsnZXCRZSumA38gPNdmoz98tMt2oftN4=";
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
# The nixpkgs the Go pin below comes from (devenv.yaml `nixpkgs-go`).
|
|
35
|
+
goPkgs = import inputs.nixpkgs-go {inherit (pkgs.stdenv.hostPlatform) system;};
|
|
36
|
+
|
|
37
|
+
# The native TypeScript compiler typecheck targets run, built from a pinned
|
|
38
|
+
# source revision rather than taken from the npm `@typescript/native` binary
|
|
39
|
+
# that emit, editors and ttsc plugins keep using. The Nx plugin's inferred
|
|
40
|
+
# `typecheck` and `typecheck-tests` run it directly (not through ttsc, whose
|
|
41
|
+
# auto-loaded typia host checks with its own compiler) and hash this path as
|
|
42
|
+
# an input, so a revision bump is a cache miss.
|
|
43
|
+
#
|
|
44
|
+
# The revision is can1357/TypeScript perf/checker-speedups-v3: 36 checker,
|
|
45
|
+
# arena and scheduler commits on microsoft/TypeScript main 6ad8c56f9b5a,
|
|
46
|
+
# while they are upstreamed. Its Go module (tsc/, Go 1.27) builds with the
|
|
47
|
+
# nixpkgs-go input's go_1_27 inside this derivation; the shell's own Go stays the
|
|
48
|
+
# one ttsc vendors. The sparse checkout keeps the ~61k test baselines out of
|
|
49
|
+
# the store, and GOWORK=off keeps the repository's go.work (tools/) out of
|
|
50
|
+
# the module build.
|
|
51
|
+
typecheckTsc = goPkgs.buildGo127Module {
|
|
52
|
+
pname = "tsc";
|
|
53
|
+
version = "7.1.0-dev-c1ae0cde";
|
|
54
|
+
src = pkgs.fetchFromGitHub {
|
|
55
|
+
owner = "can1357";
|
|
56
|
+
repo = "TypeScript";
|
|
57
|
+
rev = "c1ae0cde041b8aa08600198fad014d869c83b602";
|
|
58
|
+
sparseCheckout = ["tsc/cmd" "tsc/internal"];
|
|
59
|
+
hash = "sha256-X4wKd/+b4EGMGwXGpfQ5YHkgfqqtPgfyf3x1maEuE+4=";
|
|
60
|
+
};
|
|
61
|
+
modRoot = "tsc";
|
|
62
|
+
subPackages = ["cmd/tsc"];
|
|
63
|
+
vendorHash = "sha256-XmN6VfL922FqKUHRnBfGTuEUFbPELf8F6JINVMTz1/w=";
|
|
64
|
+
env = {
|
|
65
|
+
CGO_ENABLED = "0";
|
|
66
|
+
GOWORK = "off";
|
|
67
|
+
};
|
|
68
|
+
ldflags = ["-s" "-w"];
|
|
69
|
+
# Upstream's tests run against the full checkout's baselines, which the
|
|
70
|
+
# sparse source omits; the revision is the tested artifact.
|
|
71
|
+
doCheck = false;
|
|
72
|
+
};
|
|
73
|
+
|
|
34
74
|
# A repository that enables uv under languages.python gets its uv workspace
|
|
35
75
|
# synced and activated by this contract (enterShell item 5), never by
|
|
36
76
|
# devenv's own python tasks.
|
|
37
77
|
python = config.languages.python;
|
|
38
78
|
uvProject = python.enable && python.uv.enable;
|
|
79
|
+
|
|
80
|
+
# The Rust toolchain's own store bin, put ahead of this checkout's profile on
|
|
81
|
+
# PATH (enterShell item 2). `cargo clippy` runs `cargo-clippy`, which sets
|
|
82
|
+
# RUSTC_WORKSPACE_WRAPPER to the clippy-driver beside its own executable path
|
|
83
|
+
# (current_exe, which on Darwin is the path that was executed, symlinks
|
|
84
|
+
# unresolved), and cargo hashes that wrapper path into the identity of every
|
|
85
|
+
# workspace unit it checks. Reached through
|
|
86
|
+
# `<checkout>/tooling/direnv/.devenv/profile/bin`, the wrapper names the
|
|
87
|
+
# checkout, so a copy-on-write clone at another path re-checks every
|
|
88
|
+
# workspace crate under fresh unit directories although its target/ arrived
|
|
89
|
+
# warm, and the stale ones pile up per checkout. Resolved here, cargo,
|
|
90
|
+
# cargo-clippy and clippy-driver are one store path in every checkout.
|
|
91
|
+
# rustc resolves here too, but cargo keys units on its `-vV` output and not
|
|
92
|
+
# its path, so plain builds keep their units. The profile still carries the
|
|
93
|
+
# same files for anything that names it.
|
|
94
|
+
rustToolchainBin = "${config.languages.rust.toolchainPackage}/bin";
|
|
95
|
+
|
|
96
|
+
# Expose pyflakes without propagating a second interpreter into the shell.
|
|
97
|
+
pyflakesBin = pkgs.runCommandLocal "pyflakes-${pkgs.python3Packages.pyflakes.version}" {} ''
|
|
98
|
+
mkdir -p "$out/bin"
|
|
99
|
+
ln -s ${pkgs.python3Packages.pyflakes}/bin/pyflakes "$out/bin/pyflakes"
|
|
100
|
+
'';
|
|
39
101
|
in {
|
|
102
|
+
# nixpkgs carries actionlint, not the jdx fork. Supply the immutable upstream
|
|
103
|
+
# release as a normal package, with the same pin in developer shells and CI.
|
|
104
|
+
# Nix fetches/verifies it once; validation never installs or compiles a tool.
|
|
105
|
+
overlays = [
|
|
106
|
+
(_final: prev: let
|
|
107
|
+
sources = {
|
|
108
|
+
aarch64-darwin = {
|
|
109
|
+
platform = "darwin_arm64";
|
|
110
|
+
hash = "sha256-GtIQvSH0xwqB4L/+zG0iPayo3RPlf6aJl4cGT4tyTHw=";
|
|
111
|
+
};
|
|
112
|
+
x86_64-darwin = {
|
|
113
|
+
platform = "darwin_amd64";
|
|
114
|
+
hash = "sha256-A8y1LzvzxrG2NYaJpNMeXwXVWLMsC47a6sfEUqvn//Q=";
|
|
115
|
+
};
|
|
116
|
+
aarch64-linux = {
|
|
117
|
+
platform = "linux_arm64";
|
|
118
|
+
hash = "sha256-l4qfMsxO0dgblFY/xJZDuLOkjcuk0eoInZugX34X56c=";
|
|
119
|
+
};
|
|
120
|
+
x86_64-linux = {
|
|
121
|
+
platform = "linux_amd64";
|
|
122
|
+
hash = "sha256-AmvObQ7xlvWyK/Q6yxNI1HxdClrmHW7DvboSKagjFhs=";
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
system = prev.stdenv.hostPlatform.system;
|
|
126
|
+
source = sources.${system} or (throw "jactionlint: unsupported managed shell platform ${system}");
|
|
127
|
+
in {
|
|
128
|
+
jactionlint = prev.stdenvNoCC.mkDerivation rec {
|
|
129
|
+
pname = "jactionlint";
|
|
130
|
+
version = "2.0.2";
|
|
131
|
+
src = prev.fetchurl {
|
|
132
|
+
url = "https://github.com/jdx/jactionlint/releases/download/v${version}/jactionlint_${version}_${source.platform}.tar.gz";
|
|
133
|
+
inherit (source) hash;
|
|
134
|
+
};
|
|
135
|
+
sourceRoot = ".";
|
|
136
|
+
dontConfigure = true;
|
|
137
|
+
dontBuild = true;
|
|
138
|
+
# Preserve the upstream signed macOS executable; no strip/patch phase.
|
|
139
|
+
dontFixup = true;
|
|
140
|
+
installPhase = ''
|
|
141
|
+
runHook preInstall
|
|
142
|
+
install -Dm755 jactionlint "$out/bin/jactionlint"
|
|
143
|
+
runHook postInstall
|
|
144
|
+
'';
|
|
145
|
+
meta = {
|
|
146
|
+
description = "Static correctness, security and policy checker for GitHub Actions";
|
|
147
|
+
homepage = "https://github.com/jdx/jactionlint";
|
|
148
|
+
license = lib.licenses.mit;
|
|
149
|
+
mainProgram = "jactionlint";
|
|
150
|
+
platforms = builtins.attrNames sources;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
})
|
|
154
|
+
];
|
|
155
|
+
|
|
40
156
|
env = lib.mkMerge [
|
|
41
157
|
{
|
|
42
158
|
# Nx otherwise defaults to three workers. Scale to the cores available in each
|
|
@@ -54,6 +170,7 @@ in {
|
|
|
54
170
|
# `NX_USE_LOCAL=false nx migrate` restores that for the one command.
|
|
55
171
|
NX_USE_LOCAL = "true";
|
|
56
172
|
TTSC_TYPESCRIPT_GO_DIR = "${typescriptGo}";
|
|
173
|
+
SMOO_TYPECHECK_TSC = "${typecheckTsc}/bin/tsc";
|
|
57
174
|
}
|
|
58
175
|
# Playwright's downloaded Ubuntu browser has no runtime closure on NixOS
|
|
59
176
|
# (CI reached the executable, then failed loading libglib-2.0.so.0). Use
|
|
@@ -63,6 +180,17 @@ in {
|
|
|
63
180
|
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH = lib.getExe pkgs.chromium;
|
|
64
181
|
})
|
|
65
182
|
];
|
|
183
|
+
|
|
184
|
+
# devenv's Cachix integration adds one substituter, devenv.cachix.org, whose
|
|
185
|
+
# signing key it fetches from the Cachix API whenever its per-user key file
|
|
186
|
+
# (cachix_trusted_keys.json) lacks it. That cache holds nothing this shell
|
|
187
|
+
# pulls: its packages come from devenv-nixpkgs, whose store paths
|
|
188
|
+
# cache.nixos.org already serves, and the rest are built here. Off, devenv
|
|
189
|
+
# makes no network call before evaluating, which matters wherever the API is
|
|
190
|
+
# unreachable (a cowshed sandbox's gateway, an offline host). A host that
|
|
191
|
+
# wants the cache anyway names it in its own nix.conf.
|
|
192
|
+
cachix.enable = false;
|
|
193
|
+
|
|
66
194
|
# sccache is deliberately absent from this shell. It used to export
|
|
67
195
|
# RUSTC_WRAPPER=sccache as a BARE NAME, which PATH then resolved per project —
|
|
68
196
|
# which is precisely how an unpatched binary from one profile came to serve
|
|
@@ -202,23 +330,23 @@ in {
|
|
|
202
330
|
|
|
203
331
|
# One Go for every repository, same reasoning as the Rust toolchain: a compiler
|
|
204
332
|
# is part of a cache key, so two of them mean two caches.
|
|
333
|
+
# The typecheck compiler's Go 1.27 above is a build input of that one
|
|
334
|
+
# derivation only: no shell, plugin or repository build ever runs it.
|
|
205
335
|
#
|
|
206
|
-
# Pinned to the patch release ttsc vendors inside its native package
|
|
207
|
-
#
|
|
208
|
-
#
|
|
209
|
-
#
|
|
210
|
-
#
|
|
211
|
-
#
|
|
212
|
-
# rots.
|
|
336
|
+
# Pinned to the patch release ttsc vendors inside its native package: ttsc
|
|
337
|
+
# builds plugins with that SDK unless TTSC_GO_BINARY names another, so matching
|
|
338
|
+
# it is how there is ONE Go rather than ours plus a dependency's. `smoo
|
|
339
|
+
# monorepo check` enforces the match and fails with both versions when they
|
|
340
|
+
# diverge, which is what makes this pin a maintained invariant instead of a
|
|
341
|
+
# comment that rots.
|
|
213
342
|
#
|
|
214
343
|
# It needs its own input because the fleet's nixpkgs does not carry that patch:
|
|
215
|
-
# devenv-nixpkgs rolling ships go 1.26.5
|
|
216
|
-
#
|
|
217
|
-
#
|
|
218
|
-
#
|
|
219
|
-
#
|
|
220
|
-
#
|
|
221
|
-
# patch the ttsc pin is what moves.
|
|
344
|
+
# devenv-nixpkgs rolling ships go 1.26.5, while ttsc 0.30.4 vendors go1.26.8.
|
|
345
|
+
# Same idiom, and same reason, for any single-package pin — one leaf package
|
|
346
|
+
# from a nixpkgs that has it, lock-pinned, prebuilt, rather than a fleet-wide
|
|
347
|
+
# bump that would move rustc, bun and node too. Not every pairing is
|
|
348
|
+
# reachable: ttsc 0.28.1/0.28.2 vendor go1.26.6, which NO channel packages, so
|
|
349
|
+
# when no revision offers the vendored patch the ttsc pin is what moves.
|
|
222
350
|
#
|
|
223
351
|
# The ownership boundary this pin sits inside, unchanged by it: our code is
|
|
224
352
|
# built with the Go devenv provides, a dependency may vendor its own SDK, and
|
|
@@ -253,9 +381,14 @@ in {
|
|
|
253
381
|
# `nixpkgs_2`.
|
|
254
382
|
packages =
|
|
255
383
|
[
|
|
256
|
-
|
|
384
|
+
goPkgs.go
|
|
257
385
|
pkgs.nodejs_26
|
|
258
386
|
pkgs.binaryen
|
|
387
|
+
# Smoo's GitHub Actions validator uses the managed prebuilt package above.
|
|
388
|
+
pkgs.jactionlint
|
|
389
|
+
# Keep jactionlint's default shell and Python checks in the same pinned closure.
|
|
390
|
+
pkgs.shellcheck-minimal
|
|
391
|
+
pyflakesBin
|
|
259
392
|
# Test runner for inferred Cargo test targets. Generated targets must never
|
|
260
393
|
# depend on an ambient host installation that CI does not reproduce.
|
|
261
394
|
pkgs.cargo-nextest
|
|
@@ -276,12 +409,124 @@ in {
|
|
|
276
409
|
# devenv wraps the Python interpreter to find native libraries in
|
|
277
410
|
# `languages.python.libraries`, whose default is this checkout's
|
|
278
411
|
# `.devenv/profile`. That path then lands in the interpreter's store path, the
|
|
279
|
-
# profile that holds it and the uv environment built with it,
|
|
280
|
-
# evaluates and builds its own interpreter and profile on first
|
|
281
|
-
#
|
|
282
|
-
#
|
|
283
|
-
#
|
|
284
|
-
|
|
412
|
+
# profile that holds it, PKG_CONFIG_PATH and the uv environment built with it,
|
|
413
|
+
# so every clone evaluates and builds its own interpreter and profile on first
|
|
414
|
+
# entry, every cache keyed on the build environment misses — ttsc hashes
|
|
415
|
+
# PKG_CONFIG_PATH into its plugin key and rebuilds the Go plugin per clone —
|
|
416
|
+
# and a copied uv environment names another checkout's interpreter. Cleared,
|
|
417
|
+
# the interpreter is one store path in every checkout. devenv still adds the
|
|
418
|
+
# C++ runtime; a wheel that needs another library names that library here.
|
|
419
|
+
languages.python.libraries = lib.mkDefault [];
|
|
420
|
+
|
|
421
|
+
# The stdenv build variables the shell derivation leaks beyond the ones devenv
|
|
422
|
+
# already drops: generic names (`name`, `system`) that collide with any
|
|
423
|
+
# script's own, and builder-only settings (NIX_CFLAGS_COMPILE,
|
|
424
|
+
# SOURCE_DATE_EPOCH, the sandbox profiles) that change what a compiler run
|
|
425
|
+
# from the shell produces. The shell is a place to run tools, not a builder.
|
|
426
|
+
# mkOptionDefault: devenv's own default list stays, this one joins it.
|
|
427
|
+
unsetEnvVars = lib.mkOptionDefault [
|
|
428
|
+
"CONFIG_SHELL"
|
|
429
|
+
"DETERMINISTIC_BUILD"
|
|
430
|
+
"IN_NIX_SHELL"
|
|
431
|
+
"MACOSX_DEPLOYMENT_TARGET"
|
|
432
|
+
"NIX_CFLAGS_COMPILE"
|
|
433
|
+
"NIX_COREFOUNDATION_RPATH"
|
|
434
|
+
"NIX_DONT_SET_RPATH"
|
|
435
|
+
"NIX_DONT_SET_RPATH_FOR_BUILD"
|
|
436
|
+
"NIX_ENFORCE_NO_NATIVE"
|
|
437
|
+
"NIX_IGNORE_LD_THROUGH_GCC"
|
|
438
|
+
"NIX_INDENT_MAKE"
|
|
439
|
+
"NIX_NO_SELF_RPATH"
|
|
440
|
+
"NIX_STORE"
|
|
441
|
+
"PATH_LOCALE"
|
|
442
|
+
"SOURCE_DATE_EPOCH"
|
|
443
|
+
"__darwinAllowLocalNetworking"
|
|
444
|
+
"__impureHostDeps"
|
|
445
|
+
"__propagatedImpureHostDeps"
|
|
446
|
+
"__propagatedSandboxProfile"
|
|
447
|
+
"__sandboxProfile"
|
|
448
|
+
"cmakeFlags"
|
|
449
|
+
"configureFlags"
|
|
450
|
+
"mesonFlags"
|
|
451
|
+
"name"
|
|
452
|
+
"system"
|
|
453
|
+
];
|
|
454
|
+
|
|
455
|
+
# Shell entry's installs are devenv tasks ordered before devenv:enterShell, so
|
|
456
|
+
# devenv decides when they run and an unchanged checkout starts no installer.
|
|
457
|
+
#
|
|
458
|
+
# smoo:install runs `bun install` (and `uv sync` for a uv project) through
|
|
459
|
+
# setup-environment.ts when anything they read changed: execIfModified keys
|
|
460
|
+
# each file by content hash, by its path relative to tooling/direnv (so a
|
|
461
|
+
# copy-on-write clone at another path is unchanged), honouring .gitignore.
|
|
462
|
+
# The globs over-match (a fixture's package.json), which costs a no-op
|
|
463
|
+
# install. node_modules/.smoo-install is the stamp a successful install
|
|
464
|
+
# writes; named literally it is checked although node_modules is ignored, so
|
|
465
|
+
# deleting node_modules reinstalls. The script keeps its own per-installer
|
|
466
|
+
# digest under the install lock, so two shells entering at once install once.
|
|
467
|
+
# The scripts themselves are inputs: a new setup-environment.ts reruns.
|
|
468
|
+
#
|
|
469
|
+
# smoo:cargo-fetch establishes what the Nx plugin's offline `cargo metadata
|
|
470
|
+
# --locked` needs: every Cargo workspace's locked packages in CARGO_HOME. Its
|
|
471
|
+
# stamps live in smoo's user cache and count only while CARGO_HOME names the
|
|
472
|
+
# directory they were fetched into, which differs per host and per sandbox
|
|
473
|
+
# and no checkout path can name, so it is gated by `status` (exit 0 when
|
|
474
|
+
# CARGO_HOME holds them) rather than execIfModified.
|
|
475
|
+
#
|
|
476
|
+
# smoo:developer-links points the packages the root package.json's
|
|
477
|
+
# `smoo.developerLinks` declares at their local checkouts, after an install
|
|
478
|
+
# and in every tree that installed them (tooling/direnv/developer-links.ts).
|
|
479
|
+
# Gated by `status` too: a clone or an install can lose a link without any
|
|
480
|
+
# file devenv watches changing. Stale install links, including external Nx
|
|
481
|
+
# aliases, run the managed Bun installer before declarations are applied.
|
|
482
|
+
# A runner links nothing.
|
|
483
|
+
#
|
|
484
|
+
# A failed task does not fail shell entry (devenv reports it and the shell
|
|
485
|
+
# still loads, so the tools to repair it stay available). CI runs both with
|
|
486
|
+
# `devenv tasks run`, which does fail; setup-environment.ts is strict there.
|
|
487
|
+
tasks = let
|
|
488
|
+
setup = ''bun "$DEVENV_ROOT/setup-environment.ts"'';
|
|
489
|
+
in {
|
|
490
|
+
"smoo:install" = {
|
|
491
|
+
description = "bun install / uv sync when what they read changed";
|
|
492
|
+
exec = setup + lib.optionalString uvProject " --python ${python.package.interpreter}";
|
|
493
|
+
execIfModified = [
|
|
494
|
+
"../../package.json"
|
|
495
|
+
"../../bun.lock"
|
|
496
|
+
"../../bun.lockb"
|
|
497
|
+
"../../bunfig.toml"
|
|
498
|
+
"../../**/package.json"
|
|
499
|
+
"../../**/*.patch"
|
|
500
|
+
"../../pyproject.toml"
|
|
501
|
+
"../../uv.lock"
|
|
502
|
+
"../../**/pyproject.toml"
|
|
503
|
+
"../../tooling/workspace.gitconfig"
|
|
504
|
+
"setup-environment.ts"
|
|
505
|
+
"developer-links.ts"
|
|
506
|
+
"linked-snapshots.ts"
|
|
507
|
+
"secret-references.ts"
|
|
508
|
+
"../../node_modules/.smoo-install"
|
|
509
|
+
"../../node_modules/@typescript/native/bin/tsc"
|
|
510
|
+
];
|
|
511
|
+
before = ["devenv:enterShell"];
|
|
512
|
+
showOutput = true;
|
|
513
|
+
};
|
|
514
|
+
"smoo:cargo-fetch" = {
|
|
515
|
+
description = "cargo fetch --locked into CARGO_HOME for each Cargo workspace";
|
|
516
|
+
exec = "${setup} --cargo";
|
|
517
|
+
status = "${setup} --cargo --check";
|
|
518
|
+
before = ["devenv:enterShell"];
|
|
519
|
+
showOutput = true;
|
|
520
|
+
};
|
|
521
|
+
"smoo:developer-links" = {
|
|
522
|
+
description = "repair stale install links and link declared local checkouts";
|
|
523
|
+
exec = "${setup} --links";
|
|
524
|
+
status = "${setup} --links --check";
|
|
525
|
+
after = ["smoo:install"];
|
|
526
|
+
before = ["devenv:enterShell"];
|
|
527
|
+
showOutput = true;
|
|
528
|
+
};
|
|
529
|
+
};
|
|
285
530
|
|
|
286
531
|
enterShell = lib.mkMerge [
|
|
287
532
|
# Prologue, in order:
|
|
@@ -289,17 +534,25 @@ in {
|
|
|
289
534
|
# 1. The devenv wrapper runs from tooling/direnv; every later step expects the
|
|
290
535
|
# workspace root.
|
|
291
536
|
# 2. PATH order is most-specific → least-specific, the same list the git hooks
|
|
292
|
-
# use, so a hook and a shell resolve one binary the same way.
|
|
537
|
+
# use, so a hook and a shell resolve one binary the same way. The Rust
|
|
538
|
+
# toolchain's store bin then goes ahead of all of it (rustToolchainBin
|
|
539
|
+
# above): the same files the profile links, named by a path no checkout
|
|
540
|
+
# owns. Ahead of even that goes the installed cowshed's bin, whose
|
|
541
|
+
# `cargo` link is the jobserver launcher, so the budget reaches builds
|
|
542
|
+
# no Nx executor started.
|
|
293
543
|
# 3. ttsc drives the native TypeScript 7 binary while Nx imports the TypeScript
|
|
294
544
|
# 6 API, so the two must be named separately.
|
|
295
|
-
# 4.
|
|
296
|
-
#
|
|
297
|
-
#
|
|
298
|
-
#
|
|
299
|
-
#
|
|
300
|
-
#
|
|
301
|
-
#
|
|
302
|
-
#
|
|
545
|
+
# 4. ttsc caches in the checkout's .cache/ttsc (the path the CI ttsc-plugin
|
|
546
|
+
# cache restores), its Go build cache in a directory of its own so
|
|
547
|
+
# `ttsc clean` can reclaim it: ttsc never deletes a GOCACHE it did not
|
|
548
|
+
# resolve itself, and sharing GOCACHE once left 35G nothing could empty.
|
|
549
|
+
# GOFLAGS carries -trimpath, Go's stable way to keep absolute build paths
|
|
550
|
+
# out of an artifact. A value the caller exported wins for each. Where Go
|
|
551
|
+
# and the machine-wide caches live otherwise is the host's or the
|
|
552
|
+
# sandbox's business, not this shell's.
|
|
553
|
+
# 5. Dependencies are installed by the smoo:install and smoo:cargo-fetch
|
|
554
|
+
# tasks above, which devenv runs before this prologue; the prologue only
|
|
555
|
+
# activates what they installed.
|
|
303
556
|
#
|
|
304
557
|
# The uv project environment is devenv's UV_PROJECT_ENVIRONMENT, synced
|
|
305
558
|
# with the interpreter devenv would use and activated here after the
|
|
@@ -354,45 +607,26 @@ in {
|
|
|
354
607
|
# resolves its own GOROOT from its own binary, which makes "whose Go is
|
|
355
608
|
# whose" a property of which binary is invoked — the only thing that can
|
|
356
609
|
# actually be reasoned about.
|
|
357
|
-
# 8. On Darwin,
|
|
358
|
-
# -
|
|
359
|
-
#
|
|
360
|
-
#
|
|
361
|
-
#
|
|
362
|
-
#
|
|
363
|
-
#
|
|
364
|
-
#
|
|
365
|
-
#
|
|
366
|
-
#
|
|
367
|
-
#
|
|
368
|
-
# build script that resolves the SDK by name dies at `ld: library 'c++'
|
|
369
|
-
# not found`, which a CMake `*-sys` crate reaches before compiling a line
|
|
370
|
-
# of the project. DEVELOPER_DIR is the half that hides: `xcrun
|
|
371
|
-
# --show-sdk-path` honours it, so even code that correctly asks xcrun for
|
|
372
|
-
# the SDK is handed the nix one, while `xcrun --find clang` and
|
|
373
|
-
# `xcodebuild -version` keep reporting Xcode and look healthy. It also
|
|
374
|
-
# defeats any later guard that unsets a nix SDKROOT and then re-resolves
|
|
375
|
-
# it through xcrun, because xcrun answers with the same tree again.
|
|
376
|
-
#
|
|
377
|
-
# Only a /nix/store value is dropped. An SDKROOT the operator exported
|
|
378
|
-
# deliberately — the documented way to link Darwin from a Linux host — is
|
|
379
|
-
# left exactly as given. Each drop is announced, so a shell never silently
|
|
380
|
-
# swaps the SDK a build was compiled against.
|
|
381
|
-
# Nx's fallback includes HOME or TMPDIR, either of which can exceed the
|
|
382
|
-
# Unix socket limit in a checkout. Reuse devenv's short runtime directory,
|
|
383
|
-
# which is keyed on this checkout's devenv root and so is one per
|
|
384
|
-
# workspace. Unconditionally: an inherited value is another workspace's
|
|
385
|
-
# shell (a shed entered from the host, a second repository from the first,
|
|
386
|
-
# a subprocess of either), and one socket dir for two workspaces makes the
|
|
387
|
-
# daemon refuse whichever came second ("received a message from a
|
|
388
|
-
# different workspace"). Nobody supplies this deliberately.
|
|
389
|
-
#
|
|
390
|
-
# In a cowshed sandbox an inherited private .devenv can supply the
|
|
391
|
-
# evaluated shell after its inputs and task graph are checked. The merged
|
|
392
|
-
# hook still runs only when direnv imports the workspace's own export.
|
|
610
|
+
# 8. On Darwin, Xcode answers for the Apple toolchain: nix CC/CXX, a
|
|
611
|
+
# nix-store SDKROOT and DEVELOPER_DIR, and every store PATH entry carrying
|
|
612
|
+
# nixpkgs xcbuild's `xcrun` are dropped, each one announced, so Xcode's
|
|
613
|
+
# clang compiles against the licensed SDK and `xcrun` is Apple's.
|
|
614
|
+
# tooling/direnv/apple-developer.sh does it and states why.
|
|
615
|
+
# Nx's own socket fallback (under HOME or TMPDIR) can exceed the Unix socket
|
|
616
|
+
# limit in a checkout, and an inherited NX_SOCKET_DIR may be another
|
|
617
|
+
# workspace's: tooling/direnv/nx-socket-dir.sh, sourced below, names this
|
|
618
|
+
# workspace's own, and binds NX_WORKSPACE_ROOT_PATH, which the smoo Nx
|
|
619
|
+
# wrappers read to decide whether inherited Nx overrides belong to the root
|
|
620
|
+
# they run.
|
|
393
621
|
(lib.mkBefore ''
|
|
394
622
|
cd "$DEVENV_ROOT/../.."
|
|
623
|
+
# Direct `devenv shell` skips .envrc. Reuse cowshed's one environment writer
|
|
624
|
+
# before project hooks, rather than restating its CI/compiler-cache policy.
|
|
625
|
+
if [ -f .cowshed/env ]; then
|
|
626
|
+
. "$PWD/.cowshed/env"
|
|
627
|
+
fi
|
|
395
628
|
export PATH="$("$PWD/tooling/direnv/repo-path")"
|
|
629
|
+
export PATH="${rustToolchainBin}:$PATH"
|
|
396
630
|
# devenv enters the shell with TMPDIR unset (not empty) on every platform.
|
|
397
631
|
# Tools then fall back to /tmp, which on Darwin is not the per-user
|
|
398
632
|
# temporary directory the OS hands out, and a test that asserts the
|
|
@@ -402,47 +636,34 @@ in {
|
|
|
402
636
|
TMPDIR="$(getconf DARWIN_USER_TEMP_DIR 2>/dev/null || true)"
|
|
403
637
|
export TMPDIR="''${TMPDIR:-/tmp}"
|
|
404
638
|
fi
|
|
405
|
-
|
|
406
|
-
|
|
639
|
+
# ttsc's compiler and caches: tooling/direnv/ttsc-env.sh, shared with the
|
|
640
|
+
# git hooks, which run outside this shell. It reads the inherited
|
|
641
|
+
# NX_WORKSPACE_ROOT_PATH, so it runs before nx-socket-dir.sh rebinds it.
|
|
642
|
+
. "$DEVENV_ROOT/ttsc-env.sh"
|
|
643
|
+
export GOFLAGS="''${GOFLAGS:--trimpath}"
|
|
407
644
|
unset GOROOT
|
|
408
|
-
bun "$DEVENV_ROOT/setup-environment.ts"${lib.optionalString uvProject " --python ${python.package.interpreter}"} || exit $?
|
|
409
645
|
${lib.optionalString uvProject ''
|
|
410
646
|
if [ -f pyproject.toml ]; then
|
|
411
647
|
export VIRTUAL_ENV="$UV_PROJECT_ENVIRONMENT"
|
|
412
648
|
export PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
413
649
|
fi
|
|
414
650
|
''}
|
|
415
|
-
#
|
|
416
|
-
#
|
|
417
|
-
#
|
|
418
|
-
#
|
|
419
|
-
|
|
420
|
-
# workspace"), which reads as a hung Nx in a workspace that did nothing
|
|
421
|
-
# wrong. Nx's own diagnostic names this exact cause.
|
|
422
|
-
nx_workspace_root="$(cd "$DEVENV_ROOT/../.." >/dev/null 2>&1 && pwd || printf '%s' "$PWD")"
|
|
423
|
-
export NX_WORKSPACE_ROOT_PATH="$nx_workspace_root"
|
|
424
|
-
export NX_SOCKET_DIR="$DEVENV_RUNTIME/nx-$(printf '%s' "$nx_workspace_root" | cksum | cut -d' ' -f1)"
|
|
425
|
-
mkdir -p "$NX_SOCKET_DIR"
|
|
651
|
+
# Nx's workspace root and socket dir: tooling/direnv/nx-socket-dir.sh
|
|
652
|
+
# gives every workspace its own socket dir, and in a cowshed checkout the
|
|
653
|
+
# one literal path its host shells and sandboxed jobs all share, and
|
|
654
|
+
# states why.
|
|
655
|
+
. "$DEVENV_ROOT/nx-socket-dir.sh"
|
|
426
656
|
${lib.optionalString pkgs.stdenv.isDarwin ''
|
|
427
|
-
|
|
428
|
-
case "''${SDKROOT:-}" in
|
|
429
|
-
/nix/store/*)
|
|
430
|
-
echo "devenv: dropping nix-store SDKROOT ($SDKROOT); Xcode holds the licensed macOS SDK" >&2
|
|
431
|
-
unset SDKROOT NIX_APPLE_SDK_VERSION
|
|
432
|
-
;;
|
|
433
|
-
esac
|
|
434
|
-
case "''${DEVELOPER_DIR:-}" in
|
|
435
|
-
/nix/store/*)
|
|
436
|
-
echo "devenv: dropping nix-store DEVELOPER_DIR ($DEVELOPER_DIR); xcrun must answer from Xcode" >&2
|
|
437
|
-
unset DEVELOPER_DIR NIX_APPLE_SDK_VERSION
|
|
438
|
-
;;
|
|
439
|
-
esac
|
|
657
|
+
. "$DEVENV_ROOT/apple-developer.sh" /nix/store
|
|
440
658
|
''}
|
|
441
659
|
'')
|
|
442
660
|
# Epilogue, after every project step (a project's own enterShell may resolve
|
|
443
661
|
# SDKROOT/compilers; the toolchain identity must see the final values). The
|
|
444
662
|
# stamp logic lives in toolchain-stamp.ts; see its header for why.
|
|
445
663
|
(lib.mkAfter ''
|
|
664
|
+
# Project hooks may prepend real Cargo. Reuse the managed PATH writer
|
|
665
|
+
# last: its served install identity is the host's, not the private HOME.
|
|
666
|
+
export PATH="$("$DEVENV_ROOT/repo-path")"
|
|
446
667
|
bun "$DEVENV_ROOT/toolchain-stamp.ts" || exit $?
|
|
447
668
|
if [ -n "$DEVENV_SHELL_PWD" ]; then
|
|
448
669
|
cd "$DEVENV_SHELL_PWD"
|
|
@@ -77,22 +77,28 @@ install_devenv() {
|
|
|
77
77
|
# `nix profile remove --all` on a host would take the fleet's other roots with
|
|
78
78
|
# it. SMOO_HOST_RUNNER comes from setup-devenv's runner-kind detection.
|
|
79
79
|
#
|
|
80
|
-
# With none present these runners install
|
|
81
|
-
#
|
|
82
|
-
#
|
|
83
|
-
#
|
|
84
|
-
#
|
|
85
|
-
# running broke it: run 34374650577 segfaulted the Rust linker
|
|
80
|
+
# With none present these runners install a devenv RELEASE, not the locked
|
|
81
|
+
# rev. The lock pin exists to make the ephemeral runners' cached devenv
|
|
82
|
+
# reproducible; a host installs into a long-lived shared profile whose blast
|
|
83
|
+
# radius is the whole fleet, and pinning it down to an older CLI than the
|
|
84
|
+
# fleet had been running broke it: run 34374650577 segfaulted the Rust linker
|
|
86
85
|
# (devenv-rust-linker, clang exit 139) building cowshed-cli tests, where run
|
|
87
86
|
# 34371205556 on the same commit range was green with floating 2a399e9.
|
|
88
87
|
# 190959a is TWO COMMITS OLDER than what these hosts had been getting, so the
|
|
89
|
-
# pin was moving them backwards.
|
|
90
|
-
#
|
|
88
|
+
# pin was moving them backwards.
|
|
89
|
+
#
|
|
90
|
+
# Floating `github:cachix/devenv` (devenv's main) was no better: on
|
|
91
|
+
# 2026-10-16 main moved to a nix 2.35.2 that devenv.cachix.org does not
|
|
92
|
+
# serve, every host compiled 65 derivations, and nix-store-2.35.2 failed to
|
|
93
|
+
# build — CI went red fleet-wide with no commit here to bisect. A release
|
|
94
|
+
# tag fixes both: devenv.cachix.org pins every release from v2.0.4 on for
|
|
95
|
+
# good, so it always substitutes, and it moves only when this line does.
|
|
96
|
+
# Keep it at or above what the consuming locks name.
|
|
91
97
|
if [ "${SMOO_HOST_RUNNER:-false}" = true ]; then
|
|
92
98
|
if command -v devenv >/dev/null 2>&1; then
|
|
93
99
|
echo "using host devenv: $(command -v devenv) ($(devenv version))"
|
|
94
100
|
else
|
|
95
|
-
flake="${DEVENV_FLAKE:-github:cachix/devenv}"
|
|
101
|
+
flake="${DEVENV_FLAKE:-github:cachix/devenv/v2.4.0}"
|
|
96
102
|
echo "host runner has no devenv; nix profile add ${flake}"
|
|
97
103
|
nix profile add --accept-flake-config "$flake"
|
|
98
104
|
fi
|
|
@@ -142,8 +148,11 @@ devenv_path_and_caches() {
|
|
|
142
148
|
build_devenv_shell() {
|
|
143
149
|
local since
|
|
144
150
|
since="$(date +%s)"
|
|
145
|
-
#
|
|
146
|
-
#
|
|
151
|
+
# The installs are devenv tasks, and a failed task does not fail
|
|
152
|
+
# `devenv shell`; `devenv tasks run` does, so CI runs them first and the
|
|
153
|
+
# shell capture below then finds them current. Its evaluation is the one
|
|
154
|
+
# the capture reuses from devenv's eval cache.
|
|
155
|
+
devenv tasks run smoo:install smoo:cargo-fetch
|
|
147
156
|
persist_devenv_environment
|
|
148
157
|
# Only the ephemeral-runner path of setup-devenv opts in: the scan walks the
|
|
149
158
|
# whole store, which on a developer host or a host runner is large and not
|