From 086c365cf5a8b1b4e79ef197769ca7be9569a6fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 3 Oct 2026 04:47:50 +0000 Subject: [PATCH] chore: sync public mirror from internal --- .github/actions/setup-rust/action.yml | 10 ++++++++++ .repository-projection.json | 6 +++--- scripts/setup-rust-env.test.mjs | 28 +++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 scripts/setup-rust-env.test.mjs diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index 55e048d24..e5dac2adc 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -122,6 +122,16 @@ runs: chmod +x "$cargo_home/bin/rustup" fi + # A copied rustup binary skips rustup-init, which normally creates env. + # Recreate that file after clearing our tool root: a runner login profile + # from an earlier install may still source this exact stable path. + cat > "$cargo_home/env" <> "$GITHUB_ENV" echo "RUSTUP_HOME=$rustup_home" >> "$GITHUB_ENV" echo "$cargo_home/bin" >> "$GITHUB_PATH" diff --git a/.repository-projection.json b/.repository-projection.json index ccb70ba84..94add5f77 100644 --- a/.repository-projection.json +++ b/.repository-projection.json @@ -3,11 +3,11 @@ "projection": "deixic-code", "projectionSchemaVersion": 1, "sourceRepository": "dx-corp/mono", - "sourceSha": "792ca39c3e3492c9d7bc4873dfc75869237ecbc4", + "sourceSha": "286d0a37ebf99fa22738837904ad8e9f2b3b111b", "destinationRepository": "dx-corp/code", - "priorProjectedBase": "7fd521be8426582afe782fce895e6646cc33c762", + "priorProjectedBase": "286f11a74b63db13a1acd5b4734a431f224e002c", "definitionDigest": "82936441c776e3e8edb5d215a75007ec9714a233f489d460075d79d5ef5ba32f", "toolDigest": "f8cb071b0f27267120ccf45a00d0982f45113bd23535bef6a1555b4933f99f13", - "contentDigest": "ab481067715e68db84c8c97cdaf6f3d9d73870c42dcb8a47771e05000490ed23", + "contentDigest": "5d1b37000892e79eded38fcd977ec4da312724f0f21f5c1aedf39ac65a3b440b", "publicationEligible": true } diff --git a/scripts/setup-rust-env.test.mjs b/scripts/setup-rust-env.test.mjs new file mode 100644 index 000000000..aadb9c828 --- /dev/null +++ b/scripts/setup-rust-env.test.mjs @@ -0,0 +1,28 @@ +import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync, mkdirSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { test } from "node:test"; + +test("copied rustup recreates the env file sourced by an existing login profile", () => { + const root = mkdtempSync(join(tmpdir(), "maestro-rust-env-")); + try { + const action = readFileSync(".github/actions/setup-rust/action.yml", "utf8"); + const step = action.split(" run: | # zizmor:")[1].split("\n - name:")[0]; + const script = step.split("\n").slice(1).map((line) => line.startsWith(" ") ? line.slice(8) : line).join("\n") + .replace("cache_root=/tmp/maestro-rust", `cache_root="${root}/cache"`); + const bin = join(root, "bin"); mkdirSync(bin); + writeFileSync(join(bin, "rustup"), "#!/bin/sh\nexit 0\n", {mode: 0o755}); + const env = {...process.env, PATH: `${bin}:${process.env.PATH}`, RUNNER_OS: "Linux", GITHUB_REPOSITORY: "conformance/env", TOOLCHAIN_INPUT: "1.95.0", WORKSPACES_INPUT: ".", GITHUB_ENV: join(root,"env"), GITHUB_PATH: join(root,"path"), GITHUB_OUTPUT: join(root,"output")}; + const cargoHome = join(root,"cache/conformance-env/1.95.0/home/cargo"); + const profile = join(root,"profile"); writeFileSync(profile, `. "${cargoHome}/env"\n`); + for (let run = 0; run < 2; run++) { + execFileSync("bash", ["-c", script], {env, cwd: process.cwd()}); + const output = execFileSync("sh", ["-c", `. "${profile}"; printf runtime-conformance-shell`], {env, encoding: "utf8"}); + assert.equal(output, "runtime-conformance-shell"); + const path = execFileSync("sh", ["-c", `. "${profile}"; . "${profile}"; printf '%s' "$PATH"`], {env, encoding:"utf8"}); + assert.equal(path.split(":").filter((entry) => entry === `${cargoHome}/bin`).length, 1); + } + } finally { rmSync(root, {recursive:true,force:true}); } +});