@git.zone/tsrust 1.12.0 → 1.13.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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/mod_cargo/classes.cargorunner.d.ts +1 -0
- package/dist_ts/mod_cargo/classes.cargorunner.js +47 -39
- package/dist_ts/mod_cargo/classes.targetcache.d.ts +10 -0
- package/dist_ts/mod_cargo/classes.targetcache.js +94 -75
- package/dist_ts/mod_cargo/classes.targetguard.d.ts +4 -0
- package/dist_ts/mod_cargo/classes.targetguard.js +83 -0
- package/dist_ts/mod_cli/classes.tsrustcli.js +119 -114
- package/dist_ts/mod_matrix/classes.nativematrixbuilder.d.ts +1 -0
- package/dist_ts/mod_matrix/classes.nativematrixbuilder.js +20 -4
- package/dist_ts/plugins.d.ts +6 -1
- package/dist_ts/plugins.js +7 -2
- package/package.json +4 -4
- package/readme.md +12 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/mod_cargo/classes.cargorunner.ts +52 -43
- package/ts/mod_cargo/classes.targetcache.ts +78 -79
- package/ts/mod_cargo/classes.targetguard.ts +63 -0
- package/ts/mod_cli/classes.tsrustcli.ts +141 -136
- package/ts/mod_matrix/classes.nativematrixbuilder.ts +20 -3
- package/ts/plugins.ts +6 -0
- package/readme.hints.md +0 -27
|
@@ -969,8 +969,7 @@ export class NativeMatrixBuilder {
|
|
|
969
969
|
});
|
|
970
970
|
await this.assertInstalledTsrustVersion(workerWorkspace);
|
|
971
971
|
if (this.plan.verificationCommand) {
|
|
972
|
-
|
|
973
|
-
await this.commandRunner.execute(command, args, {
|
|
972
|
+
await this.commandRunner.execute('/bin/sh', this.workerVerificationArgs(workerArg), {
|
|
974
973
|
cwd: workerWorkspace,
|
|
975
974
|
timeoutMs: this.remainingBuildTimeout(buildDeadline, workerArg.host),
|
|
976
975
|
environment: workerEnvironment,
|
|
@@ -1012,6 +1011,24 @@ export class NativeMatrixBuilder {
|
|
|
1012
1011
|
];
|
|
1013
1012
|
}
|
|
1014
1013
|
|
|
1014
|
+
private workerVerificationArgs(workerArg: IResolvedMatrixWorker): string[] {
|
|
1015
|
+
const bootstrap = "import { ToolchainManager } from './node_modules/@git.zone/tsrust/dist_ts/mod_toolchain/index.js'; await new ToolchainManager().ensureInstalled();";
|
|
1016
|
+
return [
|
|
1017
|
+
'-c',
|
|
1018
|
+
[
|
|
1019
|
+
'set -eu',
|
|
1020
|
+
'if cargo --version >/dev/null 2>&1; then exec "$@"; fi',
|
|
1021
|
+
`node --input-type=module -e ${shellQuote(bootstrap)}`,
|
|
1022
|
+
// Toolchain installation owns its managed home. Verification keeps the
|
|
1023
|
+
// worker's private Cargo registry/cache while using the managed proxies.
|
|
1024
|
+
'matrix_cargo_home="$CARGO_HOME"',
|
|
1025
|
+
`${new ToolchainManager().getEnvPrefix(workerArg.hostTriple)}export CARGO_HOME="$matrix_cargo_home" && exec "$@"`,
|
|
1026
|
+
].join('\n'),
|
|
1027
|
+
'tsrust-matrix-verification',
|
|
1028
|
+
...this.plan.verificationCommand!,
|
|
1029
|
+
];
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1015
1032
|
private async assertWorkerSource(
|
|
1016
1033
|
workspaceArg: string,
|
|
1017
1034
|
gitCommitArg: string,
|
|
@@ -1257,7 +1274,7 @@ export class NativeMatrixBuilder {
|
|
|
1257
1274
|
.map(shellQuote)
|
|
1258
1275
|
.join(' '),
|
|
1259
1276
|
...(this.plan.verificationCommand ? [
|
|
1260
|
-
['run_matrix_worker', ...this.
|
|
1277
|
+
['run_matrix_worker', '/bin/sh', ...this.workerVerificationArgs(remoteArg.worker)].map(shellQuote).join(' '),
|
|
1261
1278
|
'test "$(git rev-parse HEAD)" = "$expected_commit"',
|
|
1262
1279
|
'test -z "$(git status --porcelain=v1 --untracked-files=all)"',
|
|
1263
1280
|
`test -z "$(git ls-files -v | grep -v '^H ' || true)"`,
|
package/ts/plugins.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import fsPromises from 'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as net from 'node:net';
|
|
4
|
+
import * as crypto from 'node:crypto';
|
|
5
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
1
6
|
import * as early from '@push.rocks/early';
|
|
2
7
|
import * as smartconfig from '@push.rocks/smartconfig';
|
|
3
8
|
import * as smartcli from '@push.rocks/smartcli';
|
|
@@ -6,6 +11,7 @@ import * as smartpath from '@push.rocks/smartpath';
|
|
|
6
11
|
import * as smartshell from '@push.rocks/smartshell';
|
|
7
12
|
|
|
8
13
|
export {
|
|
14
|
+
fsPromises, path, net, crypto, AsyncLocalStorage,
|
|
9
15
|
early,
|
|
10
16
|
smartconfig,
|
|
11
17
|
smartcli,
|
package/readme.hints.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# tsrust hints
|
|
2
|
-
|
|
3
|
-
## Architecture
|
|
4
|
-
- Follows tsbuild patterns for the `cli.js` entry point and TypeScript module layout.
|
|
5
|
-
- Uses smartcli for CLI dispatch, smartshell for Cargo execution, native `child_process.execFile` for Git snapshots, and smol-toml for TOML parsing.
|
|
6
|
-
- `mod_artifact` owns strict multi-host assembly; `mod_provenance` owns byte-preserving, hash-bound sidecars and Git source snapshots.
|
|
7
|
-
- `mod_matrix` owns local/SSH worker scheduling, exact Git-bundle transport, capability checks, configured verification commands, smoke execution, and artifact collection. It delegates final publication to `mod_artifact`.
|
|
8
|
-
|
|
9
|
-
## Key patterns
|
|
10
|
-
- smartshell `.exec()` streams output to terminal (non-silent)
|
|
11
|
-
- smartshell `.execSilent()` captures output without printing
|
|
12
|
-
- Cargo workspace detection: check for `[workspace]` section in Cargo.toml
|
|
13
|
-
- Binary targets: look for `[[bin]]` entries in member crate Cargo.toml files
|
|
14
|
-
- New builds never append provenance to binaries. Keep legacy `ProvenanceStamper` reads for tsrust 1.7/1.8 artifacts, but use `ProvenanceStore` sidecars for all writes.
|
|
15
|
-
- Host target precedence is CLI, exact host, OS family, legacy targets, then native. Assembly uses the union of all configured targets unless repeated CLI `--target` values define an explicit matrix, and rejects dirty or incomplete matrices.
|
|
16
|
-
- Assembly owns only `dist_rust/`, `.nogit/tsrust-assembly*`, and transient `.nogit/.tsrust-assembly-*.tmp` owner records. Its atomically linked owner lock, serialized recovery claim, v2 phase journal, and digest manifest recover readable, owner-consistent transactions; committed v1 state is validated and migrated before completion, while malformed or inconsistent state fails closed.
|
|
17
|
-
- Matrix configuration commits logical host keys, transport selection, environment-variable names, optional explicitly forwarded worker-variable names, and optional smoke arguments. SSH destinations, values, and dedicated temporary roots remain operator-local.
|
|
18
|
-
- Project-controlled worker commands run with synthetic per-run home directories and a restricted baseline. Committed `matrix.forwardEnvironment` requests must be granted separately through operator-owned `TSRUST_MATRIX_ALLOWED_ENVIRONMENT`; never expose transport-only `HOME` or `SSH_AUTH_SOCK` to workload commands.
|
|
19
|
-
- Exact-commit bundle transport accepts regular self-contained files only. Reject submodules, tracked symlinks, checkout filters, and external-content pointer records before cloning workers.
|
|
20
|
-
- Matrix workers build isolated exact-commit clones. Failed local and remote workspaces are retained for diagnostics, capped at three runs per root; successful remote cleanup requires the exact path, commit, token, and regular owner marker.
|
|
21
|
-
- Optional `matrix.verificationCommand` runs as literal executable/arguments after frozen installation and before each worker's artifact build. It shares the worker deadline, environment restrictions and process-group lifecycle; failure or tracked-source mutation prevents assembly. Successful build results report `verifiedWorkers`; capability-only checks do not run verification.
|
|
22
|
-
- SSH builds use login shells for builder PATH setup and a heartbeat watchdog that kills the owned remote process group if the coordinator disconnects. Commands that deliberately create a new session or process group are outside that ownership boundary.
|
|
23
|
-
- SSH transport uses stdin/stdout streams, not scp. Artifact output is byte-bounded both remotely and locally; bundle input is streamed under the shared worker deadline. Every transfer validates expected architecture and the exact random workspace owner marker in the same connection.
|
|
24
|
-
- Matrix execution assumes the reviewed commit, dependency graph, lifecycle scripts, builders, toolchains, registries, and SSH configuration are trusted. Correctness checks are not same-UID sandboxing.
|
|
25
|
-
- Artifact assembly persists and revalidates an exact staged digest manifest before initial publication and committed-transaction recovery.
|
|
26
|
-
- Revalidate source compatibility and the clean Git snapshot around bundle creation so capability checks cannot leave a stale source decision.
|
|
27
|
-
- Failed matrix workspaces are not pruned automatically. Inspect and remove only the exact diagnostic paths printed by the failed invocation before retrying.
|