@smoothbricks/nx-plugin 0.5.0 → 0.5.2
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 +107 -46
- package/dist/bin/smoo-nx-test-clocks.js +2 -2
- package/dist/bin/smoo-nx-test-walks.js +6 -9
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +25 -15
- package/dist/ensure-built-witness.d.ts +33 -5
- package/dist/ensure-built-witness.d.ts.map +1 -1
- package/dist/ensure-built-witness.js +84 -18
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +33 -14
- package/dist/executors/bounded-exec/cpu-pool.d.ts +14 -7
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +297 -38
- package/dist/executors/bounded-exec/cpu-tokens.d.ts +19 -7
- package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-tokens.js +21 -7
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +12 -6
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/run-cpu-pool.js +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/owned-installation.d.ts +6 -5
- package/dist/owned-installation.d.ts.map +1 -1
- package/dist/owned-installation.js +324 -201
- package/dist/producer-receipts.d.ts +10 -0
- package/dist/producer-receipts.d.ts.map +1 -1
- package/dist/producer-receipts.js +30 -5
- package/dist/test-walk-policy.d.ts +8 -0
- package/dist/test-walk-policy.d.ts.map +1 -1
- package/dist/test-walk-policy.js +34 -0
- package/dist/workspace-manifest.d.ts +5 -5
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/managed/raw/patches/nx@23.2.1.patch +14 -3
- package/managed/raw/tooling/direnv/developer-links.ts +37 -10
- package/managed/raw/tooling/direnv/devenv.smoo.nix +1 -3
- package/managed/raw/tooling/direnv/linked-snapshots.ts +49 -12
- package/managed/raw/tooling/direnv/repo-path +1 -1
- package/managed/raw/tooling/direnv/setup-environment.ts +2 -0
- package/managed/raw/tooling/git-hooks/pre-push.sh +34 -11
- package/package.json +3 -3
- package/runtime-input.sh +21 -9
- package/src/__tests__/cargo-closure-filesets.ts +94 -0
- package/src/__tests__/counted-cargo.ts +1 -1
- package/src/__tests__/owned-installation.ts +5 -6
- package/src/bin/smoo-nx-test-clocks.ts +2 -2
- package/src/bin/smoo-nx-test-walks.ts +6 -9
- package/src/cargo-closure-filesets.test.ts +63 -0
- package/src/cargo-closure-input.test.ts +2 -2
- package/src/cargo-closure-input.ts +23 -15
- package/src/cargo-closure-key.test.ts +1 -1
- package/src/cargo-resolve-cache.test.ts +1 -1
- package/src/cross-check-policy.test.ts +53 -12
- package/src/ensure-built-witness.test.ts +53 -2
- package/src/ensure-built-witness.ts +103 -18
- package/src/ensure-built.test.ts +79 -5
- package/src/ensure-built.ts +51 -15
- package/src/executors/bounded-exec/cpu-pool.test.ts +132 -4
- package/src/executors/bounded-exec/cpu-pool.ts +300 -46
- package/src/executors/bounded-exec/cpu-tokens.test.ts +60 -15
- package/src/executors/bounded-exec/cpu-tokens.ts +34 -11
- package/src/executors/bounded-exec/executor.test.ts +72 -4
- package/src/executors/bounded-exec/executor.ts +12 -6
- package/src/executors/bounded-exec/run-cpu-pool.test.ts +3 -0
- package/src/executors/bounded-exec/run-cpu-pool.ts +5 -4
- package/src/index.ts +4 -0
- package/src/linked-snapshots.nx.test.ts +1 -1
- package/src/nextest-partitions.test.ts +1 -1
- package/src/nx-daemon-validity.test.ts +51 -0
- package/src/owned-installation.test.ts +105 -0
- package/src/owned-installation.ts +335 -93
- package/src/producer-receipts.test.ts +37 -15
- package/src/producer-receipts.ts +29 -5
- package/src/runtime-input.test.ts +22 -1
- package/src/task-results.test.ts +1 -1
- package/src/test-walk-policy.test.ts +35 -0
- package/src/test-walk-policy.ts +32 -0
- package/src/workspace-manifest.ts +5 -5
- package/test-timings.json +94 -92
|
@@ -10,12 +10,13 @@ import { GATEWAY_SOCKET } from './gateway-lease.js';
|
|
|
10
10
|
* Every runner sizes itself to the whole host unless something budgets it, and without a gateway nothing did: under
|
|
11
11
|
* `NX_PARALLEL=100%` Nx starts every target side by side and each one's runner takes the whole machine. The run
|
|
12
12
|
* therefore serves its own pool of one token per core, as a gateway-granted executor serves its children, and every
|
|
13
|
-
* task inherits it: `bounded-exec`
|
|
14
|
-
*
|
|
13
|
+
* task inherits it: `bounded-exec` takes from it as from any parent pool, FIFO, the head taking `min(want, free)` once
|
|
14
|
+
* one token is free, and a Cargo that Nx's own `nx:run-commands` starts reads its jobserver fifo through the
|
|
15
|
+
* `CARGO_MAKEFLAGS` the pool exports, so the runners of one run together stay within the cores.
|
|
15
16
|
*
|
|
16
17
|
* The run serves it only when nothing else budgets it: it inherits no pool, and the gateway's control socket does
|
|
17
|
-
* not exist. Only `ENOENT` proves the gateway absent
|
|
18
|
-
*
|
|
18
|
+
* not exist. Only `ENOENT` proves the gateway absent; a socket that exists but does not answer may be a live,
|
|
19
|
+
* saturated gateway, and a run budgeting itself beside it would count the host twice.
|
|
19
20
|
*/
|
|
20
21
|
/** The pools this process serves, by Nx run id, until that run's `postTasksExecution`. */
|
|
21
22
|
const pools = new Map();
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAkBlC,OAAO,EAKL,yBAAyB,EAiB1B,MAAM,sBAAsB,CAAC;AAsB9B,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAkBlC,OAAO,EAKL,yBAAyB,EAiB1B,MAAM,sBAAsB,CAAC;AAsB9B,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC,gEAAgE;AAChE,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAmyBlD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,MAAM,EACnB,SAAS,UAAsB,GAC9B,MAAM,EAAE,CAKV;AAkID,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAEvG;AAED,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC;AAeF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,uBAAuB,CAOxE,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,uBAAuB,CAI1E,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { runtimeInput, shellWord } from './runtime-input.js';
|
|
|
20
20
|
import { isNonSourceDirectory } from './source-directories.js';
|
|
21
21
|
import { postTasksExecution as postTaskResults, preTasksExecution as preTaskResults } from './task-results.js';
|
|
22
22
|
import { SHARD_TIMINGS_EXECUTOR, SHARD_TIMINGS_TARGET, timingsShardedSuite } from './test-timings.js';
|
|
23
|
+
import { assertUpstreamBasePrecondition } from './test-walk-policy.js';
|
|
23
24
|
import { isBuildOutputTargetName, isTestRunnerTargetName, PLATFORM_TARGET_GLOBS, RELEASE_CONFIGURATION, } from './workspace-config-policy.js';
|
|
24
25
|
import { globIndexedFiles } from './workspace-index.js';
|
|
25
26
|
export { CARGO_TEST_COMPILE_TARGET };
|
|
@@ -841,6 +842,9 @@ function isBuildOutputPackageJson(packageJsonPath) {
|
|
|
841
842
|
* (`run-cpu-pool.ts`), and closes it when the run ends.
|
|
842
843
|
*/
|
|
843
844
|
export const preTasksExecution = async (options, context) => {
|
|
845
|
+
// Before any task is hashed: a workspace that declares the test-walk check
|
|
846
|
+
// must be able to name its upstream base, or the run fails with that reason.
|
|
847
|
+
assertUpstreamBasePrecondition(context.workspaceRoot);
|
|
844
848
|
preTaskResults(options, context);
|
|
845
849
|
await preProducerReceipts(options, context);
|
|
846
850
|
await serveRunCpuPool(context);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** One test file's installation:
|
|
1
|
+
/** One test file's installation: taken on first use and shared by its fixtures, retired by the file's `afterAll`. */
|
|
2
2
|
export interface TestFileInstallation {
|
|
3
3
|
/** The `node_modules` a fixture workspace links. */
|
|
4
4
|
readonly nodeModules: () => Promise<string>;
|
|
@@ -6,9 +6,10 @@ export interface TestFileInstallation {
|
|
|
6
6
|
readonly retire: () => Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* The installation one test file owns:
|
|
10
|
-
* TypeScript the fixtures stand for) resolves,
|
|
11
|
-
* per file, at module scope: Bun runs many test files in one process, and
|
|
9
|
+
* The installation one test file owns: the copy of the closure `censusRoot` (the workspace whose Nx, plugin and
|
|
10
|
+
* TypeScript the fixtures stand for) resolves, kept as `name` in `censusRoot`'s tool cache and proved on first use.
|
|
11
|
+
* Call once per file, at module scope, with a name no other file uses: Bun runs many test files in one process, and
|
|
12
|
+
* each must own its copy. Two runs of one file at once share it, and a copy one of them makes again fails the other.
|
|
12
13
|
*/
|
|
13
|
-
export declare function ownedInstallation(censusRoot: string,
|
|
14
|
+
export declare function ownedInstallation(censusRoot: string, name: string): TestFileInstallation;
|
|
14
15
|
//# sourceMappingURL=owned-installation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owned-installation.d.ts","sourceRoot":"","sources":["../src/owned-installation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"owned-installation.d.ts","sourceRoot":"","sources":["../src/owned-installation.ts"],"names":[],"mappings":"AAsYA,qHAAqH;AACrH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAWxF"}
|