Darwin round 2: no archive links, a reinstall that confirms the stop
- Tool archives: entries are created through an os.Root, which refuses any path out of the staging directory; no symbolic or hard link from an archive is ever made. Node's npm and npx links are made afterwards with fixed relative targets, its corepack link is left out, and any other link refuses the archive (TestFetchMakesNoLinksFromTheArchive, with the chained-link archive; both real archives still unpack). - Reinstall: a loaded agent is booted out (a refused bootout stops the installer at once) and the installer waits, bounded, until launchd no longer has it and the state lock is free; otherwise it changes nothing and says so (runner.mac.still_running).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 files changed,
+341
−66
cmd/equipo-runner/install_mac.go+56 −6cmd/equipo-runner/install_mac_test.go+57 −1docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+1 −0internal/equipo/copy.go+2 −0internal/runner/mac/tools.go+40 −22internal/runner/mac/tools_test.go+45 −2scripts/runner-reference-allowlist.json+140 −35
Intent
diff --git a/cmd/equipo-runner/install_mac.go b/cmd/equipo-runner/install_mac.go| index efca8293..777b7e3e 100644 |
| --- a/cmd/equipo-runner/install_mac.go |
| +++ b/cmd/equipo-runner/install_mac.go |
| @@ -36,7 +36,9 @@ type macInstallHost struct { |
| npmCI func(ctx context.Context, npm, prefix string) error |
| enrol func(ctx context.Context, cfg runner.Config, out io.Writer) error |
| // launchctl runs launchctl; firstLaunch runs xcodebuild -runFirstLaunch. |
| - launchctl func(ctx context.Context, args ...string) error |
| + launchctl func(ctx context.Context, args ...string) error |
| + // stopWait bounds the wait for a runner to stop (a minute). |
| + stopWait time.Duration |
| firstLaunch func(ctx context.Context) |
| } |
| @@ -107,6 +109,14 @@ func installMac(ctx context.Context, args []string, h macInstallHost, out, errou |
| conf := filepath.Join(h.home, ".config", "equipo-runner") |
| logs := filepath.Join(h.home, "Library", "Logs", "equipo-runner") |
| agents := filepath.Join(h.home, "Library", "LaunchAgents") |
| + // A runner installed before is stopped first: nothing it uses is |
| + // replaced under it, and its state lock is free for the enrolment |
| + // check below (an existing, valid enrolment is kept as it is). If it |
| + // does not stop, nothing at all is changed. |
| + domain := "gui/" + strconv.Itoa(account.UID) |
| + if !stopRunner(ctx, h, domain+"/"+mac.AgentLabel, filepath.Join(share, "state")) { |
| + return fail("runner.mac.still_running") |
| + } |
| for _, d := range []string{lib, filepath.Join(share, "state"), filepath.Join(share, "work"), filepath.Join(share, "scratch"), conf, logs} { |
| if err := os.MkdirAll(d, 0700); err != nil { |
| return fail("runner.install.destination") |
| @@ -115,11 +125,6 @@ func installMac(ctx context.Context, args []string, h macInstallHost, out, errou |
| if err := os.MkdirAll(agents, 0755); err != nil { |
| return fail("runner.install.destination") |
| } |
| - // A runner installed before is stopped first: nothing it uses is |
| - // replaced under it, and its state lock is free for the enrolment |
| - // check below (an existing, valid enrolment is kept as it is). |
| - domain := "gui/" + strconv.Itoa(account.UID) |
| - _ = h.launchctl(ctx, "bootout", domain+"/"+mac.AgentLabel) |
| binary := filepath.Join(lib, "equipo-runner") |
| if err := copyPrivate(h.self, binary, 0700); err != nil { |
| return fail("runner.install.destination") |
| @@ -258,3 +263,48 @@ func copyPrivate(src, dst string, mode os.FileMode) error { |
| } |
| return os.Rename(tmp.Name(), dst) |
| } |
| + |
| +// stopRunner stops a runner installed before and confirms it stopped: |
| +// launchd no longer has the agent, and the runner's state lock is free. |
| +// It changes nothing itself; false means do not change anything. |
| +func stopRunner(ctx context.Context, h macInstallHost, service, state string) bool { |
| + if h.launchctl(ctx, "print", service) != nil { |
| + // Not loaded. Its lock must still be free: a runner started by |
| + // hand holds it too. |
| + return lockFree(state) |
| + } |
| + if h.launchctl(ctx, "bootout", service) != nil { |
| + return false |
| + } |
| + wait := h.stopWait |
| + if wait <= 0 { |
| + wait = time.Minute |
| + } |
| + deadline := time.Now().Add(wait) |
| + for { |
| + if h.launchctl(ctx, "print", service) != nil && lockFree(state) { |
| + return true |
| + } |
| + if time.Now().After(deadline) { |
| + return false |
| + } |
| + select { |
| + case <-ctx.Done(): |
| + return false |
| + case <-time.After(250 * time.Millisecond): |
| + } |
| + } |
| +} |
| + |
| +// lockFree reports whether no runner holds the state lock (a state dir |
| +// not made yet is free). |
| +func lockFree(state string) bool { |
| + if _, err := os.Stat(state); os.IsNotExist(err) { |
| + return true |
| + } |
| + lock, err := runner.LockState(state) |
| + if err != nil { |
| + return false |
| + } |
| + return lock.Close() == nil |
| +} |
diff --git a/cmd/equipo-runner/install_mac_test.go b/cmd/equipo-runner/install_mac_test.go| index 839673b7..d99a361b 100644 |
| --- a/cmd/equipo-runner/install_mac_test.go |
| +++ b/cmd/equipo-runner/install_mac_test.go |
| @@ -14,6 +14,7 @@ import ( |
| "slices" |
| "strings" |
| "testing" |
| + "time" |
| "amadan.net/oficina/equipo/internal/equipo" |
| "amadan.net/oficina/equipo/internal/runner" |
| @@ -33,6 +34,10 @@ type macRig struct { |
| // URLs asked for. |
| archives map[string][]byte |
| fetched []string |
| + // loaded is whether launchd has the agent; stuck keeps it loaded |
| + // through a bootout; bootoutErr is what bootout answers. |
| + loaded, stuck bool |
| + bootoutErr error |
| } |
| func newMacRig(t *testing.T) *macRig { |
| @@ -84,8 +89,22 @@ func newMacRig(t *testing.T) *macRig { |
| }, |
| launchctl: func(_ context.Context, args ...string) error { |
| x.calls = append(x.calls, "launchctl "+strings.Join(args, " ")) |
| + switch args[0] { |
| + case "print": |
| + if !x.loaded { |
| + return errors.New("could not find service") |
| + } |
| + case "bootout": |
| + if x.bootoutErr != nil { |
| + return x.bootoutErr |
| + } |
| + x.loaded = x.stuck |
| + case "bootstrap": |
| + x.loaded = true |
| + } |
| return nil |
| }, |
| + stopWait: 300 * time.Millisecond, |
| firstLaunch: func(context.Context) { x.calls = append(x.calls, "firstLaunch") }, |
| } |
| // Stand-ins for the pinned Node and ripgrep archives, pinned the same |
| @@ -193,7 +212,7 @@ func TestInstallMac(t *testing.T) { |
| if err != nil || !bytes.Equal(raw, mac.LaunchAgent(filepath.Join(lib, "equipo-runner"), env, filepath.Join(x.home, "Library/Logs/equipo-runner"))) { |
| t.Fatalf("plist %v", err) |
| } |
| - want := []string{"launchctl bootout gui/502/io.amadan.equipo-runner", "npm " + lib + "/tools/node-v1/bin/npm " + lib + "/srt", "firstLaunch", "launchctl bootstrap gui/502 " + plist} |
| + want := []string{"launchctl print gui/502/io.amadan.equipo-runner", "npm " + lib + "/tools/node-v1/bin/npm " + lib + "/srt", "firstLaunch", "launchctl bootstrap gui/502 " + plist} |
| if !slices.Equal(x.calls, want) { |
| t.Fatalf("calls %v", x.calls) |
| } |
| @@ -252,6 +271,7 @@ func TestEnvFileAndExits(t *testing.T) { |
| // the running runner held (here the test holds it until bootout). |
| func TestInstallMacAgain(t *testing.T) { |
| x := newMacRig(t) |
| + x.loaded = true |
| state := filepath.Join(x.home, ".local/share/equipo-runner/state") |
| held, err := runner.LockState(state) |
| if err != nil { |
| @@ -297,3 +317,39 @@ func TestInstallMacEnrolledAsPrimary(t *testing.T) { |
| t.Fatalf("%d %q %v", code, errout, x.calls) |
| } |
| } |
| + |
| +// A runner that does not stop changes nothing: a bootout that fails, an |
| +// agent launchd still has after the wait, or a state lock still held |
| +// (a runner started by hand) all stop the installer before it touches |
| +// anything, with words saying so. |
| +func TestInstallMacWhenTheRunnerWillNotStop(t *testing.T) { |
| + for name, set := range map[string]func(*macRig) error{ |
| + "bootout fails": func(x *macRig) error { x.loaded, x.bootoutErr = true, errors.New("Boot-out failed: 5"); return nil }, |
| + "agent stays": func(x *macRig) error { x.loaded, x.stuck = true, true; return nil }, |
| + "lock still held": func(x *macRig) error { |
| + x.loaded = true |
| + _, err := runner.LockState(filepath.Join(x.home, ".local/share/equipo-runner/state")) |
| + return err |
| + }, |
| + "held, not loaded": func(x *macRig) error { |
| + _, err := runner.LockState(filepath.Join(x.home, ".local/share/equipo-runner/state")) |
| + return err |
| + }, |
| + } { |
| + x := newMacRig(t) |
| + if err := set(x); err != nil { |
| + t.Fatal(err) |
| + } |
| + code, _, errout := x.install() |
| + if code != 1 || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.mac.still_running")) { |
| + t.Fatalf("%s: %d %q", name, code, errout) |
| + } |
| + if _, err := os.Stat(filepath.Join(x.home, ".local/lib")); !os.IsNotExist(err) || len(x.fetched) != 0 || x.enrolled != nil { |
| + t.Fatalf("%s: changed something", name) |
| + } |
| + // A refused bootout is the answer: no waiting on it. |
| + if name == "bootout fails" && x.calls[len(x.calls)-1] != "launchctl bootout gui/502/io.amadan.equipo-runner" { |
| + t.Fatalf("waited after a failed bootout: %v", x.calls) |
| + } |
| + } |
| +} |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 79ddce74..b08cc925 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -5815,6 +5815,7 @@ records remain unchanged. |
| | `runner.mac.user` | Run the installer as a Standard user named equipo-yourname, such as equipo-paul. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.home` | This user can get into another person's home folder (%s). An administrator can close it with: sudo chmod 700 %s | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.homes_unknown` | Equipo could not check the other home folders on this Mac, so it stopped. Ask an administrator to check that /Users can be listed, then paste the command again. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `runner.mac.still_running` | The runner already on this Mac did not stop, so nothing was changed. Log out of this user and back in, then paste the command again. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.needs_primary` | This Mac can only run checks for your main runner. Add your main runner first, then open this Mac's link again. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.no_srt` | The checks sandbox could not be downloaded and installed. Checks will run outside the sandbox and say so. Run the install command again to retry. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.tap` | Open this link and add this Mac to your team: | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 0faa2fa0..08bf331b 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -271,6 +271,8 @@ var pageCopy = map[string]string{ |
| "runner.mac.home": "This user can get into another person's home folder (%s). An administrator can close it with: sudo chmod 700 %s", |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context): runner.mac.homes_unknown |
| "runner.mac.homes_unknown": "Equipo could not check the other home folders on this Mac, so it stopped. Ask an administrator to check that /Users can be listed, then paste the command again.", |
| + // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context): runner.mac.still_running |
| + "runner.mac.still_running": "The runner already on this Mac did not stop, so nothing was changed. Log out of this user and back in, then paste the command again.", |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context): runner.mac.no_srt |
| "runner.mac.no_srt": "The checks sandbox could not be downloaded and installed. Checks will run outside the sandbox and say so. Run the install command again to retry.", |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context): runner.mac.tap |
diff --git a/internal/runner/mac/tools.go b/internal/runner/mac/tools.go| index 0d2272d8..d2710256 100644 |
| --- a/internal/runner/mac/tools.go |
| +++ b/internal/runner/mac/tools.go |
| @@ -12,6 +12,7 @@ import ( |
| "os" |
| "path" |
| "path/filepath" |
| + "slices" |
| "strings" |
| ) |
| @@ -27,6 +28,12 @@ type Tool struct { |
| // Root is the archive's top directory, unpacked whole; Binary the |
| // program inside it. |
| Root, Binary string |
| + // No symbolic or hard link in an archive is ever created. The links |
| + // a tool needs are made afterwards with fixed targets (Links: name to |
| + // relative target, under Root); the archive's own links at those |
| + // names, and at SkipLinks, are left out; any other is refused. |
| + Links map[string]string |
| + SkipLinks []string |
| } |
| // What srt 0.0.81 needs on macOS (its README, "Platform-Specific |
| @@ -40,7 +47,10 @@ var ( |
| Node = Tool{Name: "node", Version: "v22.23.4", |
| URL: "https://nodejs.org/dist/v22.23.4/node-v22.23.4-darwin-arm64.tar.gz", |
| SHA256: "c9e1dbc748b33ed2d14f42445191ecaf14c56259c7a9a26d0042c49ec2b66428", |
| - Root: "node-v22.23.4-darwin-arm64", Binary: "bin/node"} |
| + Root: "node-v22.23.4-darwin-arm64", Binary: "bin/node", |
| + // npm runs `npm ci` for srt; corepack is not needed. |
| + Links: map[string]string{"bin/npm": "../lib/node_modules/npm/bin/npm-cli.js", "bin/npx": "../lib/node_modules/npm/bin/npx-cli.js"}, |
| + SkipLinks: []string{"bin/corepack"}} |
| // SRTTools are fetched by the installer in this order. |
| SRTTools = []Tool{Node, Ripgrep} |
| ) |
| @@ -78,7 +88,7 @@ func Fetch(ctx context.Context, t Tool, dir string, get func(ctx context.Context |
| return "", err |
| } |
| defer os.RemoveAll(tmp) |
| - if err := untar(raw, tmp, t.Root); err != nil { |
| + if err := untar(raw, tmp, t); err != nil { |
| return "", err |
| } |
| if info, err := os.Stat(filepath.Join(tmp, t.Root, filepath.FromSlash(t.Binary))); err != nil || !info.Mode().IsRegular() || info.Mode().Perm()&0100 == 0 { |
| @@ -91,39 +101,46 @@ func Fetch(ctx context.Context, t Tool, dir string, get func(ctx context.Context |
| return bin, nil |
| } |
| -// untar unpacks a .tar.gz whose every entry is under root: regular files |
| -// and directories, and symbolic links that stay inside root. |
| -func untar(raw []byte, into, root string) error { |
| +// untar unpacks a .tar.gz whose every entry is under t.Root: regular |
| +// files and directories only, created through an os.Root, which refuses |
| +// any path that would leave the staging directory, links included. The |
| +// archive's links at t.Links or t.SkipLinks are left out; any other link |
| +// is refused. t.Links are then made with their fixed targets. |
| +func untar(raw []byte, into string, t Tool) error { |
| z, err := gzip.NewReader(bytes.NewReader(raw)) |
| if err != nil { |
| return ErrTool |
| } |
| + root, err := os.OpenRoot(into) |
| + if err != nil { |
| + return err |
| + } |
| + defer root.Close() |
| tr := tar.NewReader(z) |
| for { |
| h, err := tr.Next() |
| if err == io.EOF { |
| - return nil |
| + break |
| } |
| if err != nil { |
| return ErrTool |
| } |
| name := path.Clean(h.Name) |
| - if path.IsAbs(name) || (name != root && !strings.HasPrefix(name, root+"/")) { |
| + if path.IsAbs(name) || strings.HasPrefix(name, "../") || (name != t.Root && !strings.HasPrefix(name, t.Root+"/")) { |
| return ErrTool |
| } |
| - dst := filepath.Join(into, filepath.FromSlash(name)) |
| switch h.Typeflag { |
| case tar.TypeDir: |
| - if err := os.MkdirAll(dst, 0700); err != nil { |
| - return err |
| + if err := root.MkdirAll(name, 0700); err != nil { |
| + return ErrTool |
| } |
| case tar.TypeReg: |
| - if err := os.MkdirAll(filepath.Dir(dst), 0700); err != nil { |
| - return err |
| + if err := root.MkdirAll(path.Dir(name), 0700); err != nil { |
| + return ErrTool |
| } |
| - f, err := os.OpenFile(dst, os.O_CREATE|os.O_EXCL|os.O_WRONLY, os.FileMode(h.Mode)&0700|0400) |
| + f, err := root.OpenFile(name, os.O_CREATE|os.O_EXCL|os.O_WRONLY, os.FileMode(h.Mode)&0700|0400) |
| if err != nil { |
| - return err |
| + return ErrTool |
| } |
| _, err = io.Copy(f, io.LimitReader(tr, maxToolArchive*4)) |
| if cerr := f.Close(); err == nil { |
| @@ -133,18 +150,19 @@ func untar(raw []byte, into, root string) error { |
| return err |
| } |
| case tar.TypeSymlink: |
| - target := path.Clean(path.Join(path.Dir(name), h.Linkname)) |
| - if path.IsAbs(h.Linkname) || (target != root && !strings.HasPrefix(target, root+"/")) { |
| + rel := strings.TrimPrefix(name, t.Root+"/") |
| + if _, fixed := t.Links[rel]; !fixed && !slices.Contains(t.SkipLinks, rel) { |
| return ErrTool |
| } |
| - if err := os.MkdirAll(filepath.Dir(dst), 0700); err != nil { |
| - return err |
| - } |
| - if err := os.Symlink(h.Linkname, dst); err != nil { |
| - return err |
| - } |
| default: |
| + // Hard links, devices, fifos: never. |
| + return ErrTool |
| + } |
| + } |
| + for name, target := range t.Links { |
| + if err := root.Symlink(target, path.Join(t.Root, name)); err != nil { |
| return ErrTool |
| } |
| } |
| + return nil |
| } |
diff --git a/internal/runner/mac/tools_test.go b/internal/runner/mac/tools_test.go| index 4c23f85d..1226a8ff 100644 |
| --- a/internal/runner/mac/tools_test.go |
| +++ b/internal/runner/mac/tools_test.go |
| @@ -32,7 +32,7 @@ func TestToolPins(t *testing.T) { |
| if !NodeSupported(Node.Version) { |
| t.Fatal("the pinned Node is older than srt needs") |
| } |
| - if len(SRTTools) != 2 || SRTTools[0] != Node || SRTTools[1] != Ripgrep { |
| + if len(SRTTools) != 2 || SRTTools[0].Name != Node.Name || SRTTools[1].Name != Ripgrep.Name { |
| t.Fatalf("srt's macOS needs: %+v", SRTTools) |
| } |
| } |
| @@ -76,7 +76,7 @@ func pinned(raw []byte) Tool { |
| // not match leaves nothing behind. A matching one is unpacked whole, its |
| // program executable, and a second install does not download again. |
| func TestFetchChecksTheDigest(t *testing.T) { |
| - good := archive(t, entry{name: "rg-1/", dir: true}, entry{name: "rg-1/rg", body: "#!/bin/sh\n"}, entry{name: "rg-1/doc/README.md", body: "x"}, entry{name: "rg-1/bin", link: "doc"}) |
| + good := archive(t, entry{name: "rg-1/", dir: true}, entry{name: "rg-1/rg", body: "#!/bin/sh\n"}, entry{name: "rg-1/doc/README.md", body: "x"}) |
| tool := pinned(good) |
| dir := t.TempDir() |
| served := 0 |
| @@ -131,6 +131,49 @@ func TestFetchKeepsToTheRoot(t *testing.T) { |
| } |
| } |
| +// No link in an archive is ever made. A chain of links that each look |
| +// harmless on paper (d/x to its parent, then d/x/y to its parent, which |
| +// on disk is outside the root) and a file written through them are |
| +// refused, and nothing lands outside. The links a tool needs are made |
| +// afterwards with fixed targets; the archive's own at those names are |
| +// left out. |
| +func TestFetchMakesNoLinksFromTheArchive(t *testing.T) { |
| + outside := t.TempDir() |
| + chain := archive(t, entry{name: "rg-1/rg", body: "x"}, entry{name: "rg-1/d/", dir: true}, entry{name: "rg-1/d/x", link: ".."}, entry{name: "rg-1/d/x/y", link: ".."}, entry{name: "rg-1/d/x/y/" + filepath.Base(outside) + "/evil", body: "x"}) |
| + dir := filepath.Join(filepath.Dir(outside), "staging-"+filepath.Base(outside)) |
| + if _, err := Fetch(context.Background(), pinned(chain), dir, func(context.Context, string, int64) ([]byte, error) { return chain, nil }); !errors.Is(err, ErrTool) { |
| + t.Fatalf("chained links: %v", err) |
| + } |
| + defer os.RemoveAll(dir) |
| + if _, err := os.Stat(filepath.Join(outside, "evil")); !os.IsNotExist(err) { |
| + t.Fatal("a file landed outside the root") |
| + } |
| + var hard bytes.Buffer |
| + z := gzip.NewWriter(&hard) |
| + tw := tar.NewWriter(z) |
| + _ = tw.WriteHeader(&tar.Header{Name: "rg-1/rg", Mode: 0755, Size: 1, Typeflag: tar.TypeReg}) |
| + _, _ = tw.Write([]byte("x")) |
| + _ = tw.WriteHeader(&tar.Header{Name: "rg-1/also", Typeflag: tar.TypeLink, Linkname: "rg-1/rg"}) |
| + _ = tw.Close() |
| + _ = z.Close() |
| + if _, err := Fetch(context.Background(), pinned(hard.Bytes()), t.TempDir(), func(context.Context, string, int64) ([]byte, error) { return hard.Bytes(), nil }); !errors.Is(err, ErrTool) { |
| + t.Fatalf("hard link: %v", err) |
| + } |
| + node := archive(t, entry{name: "node-1/bin/node", body: "#!/bin/sh\n"}, entry{name: "node-1/lib/npm-cli.js", body: "x"}, entry{name: "node-1/bin/npm", link: "/etc/passwd"}, entry{name: "node-1/bin/corepack", link: "../../.."}) |
| + tool := pinned(node) |
| + tool.Root, tool.Binary, tool.Links, tool.SkipLinks = "node-1", "bin/node", map[string]string{"bin/npm": "../lib/npm-cli.js"}, []string{"bin/corepack"} |
| + dir = t.TempDir() |
| + if _, err := Fetch(context.Background(), tool, dir, func(context.Context, string, int64) ([]byte, error) { return node, nil }); err != nil { |
| + t.Fatal(err) |
| + } |
| + if target, err := os.Readlink(filepath.Join(dir, "node-1/bin/npm")); err != nil || target != "../lib/npm-cli.js" { |
| + t.Fatalf("npm link %q %v", target, err) |
| + } |
| + if _, err := os.Lstat(filepath.Join(dir, "node-1/bin/corepack")); !os.IsNotExist(err) { |
| + t.Fatal("a skipped link was made") |
| + } |
| +} |
| + |
| // With the real archives at hand (EQUIPO_TOOL_ARCHIVES: a directory |
| // holding them under their release names), the pins match and both |
| // unpack. Skipped otherwise: CI does not download them. |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index 97cc352c..f1457444 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -11962,13 +11962,6 @@ |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| }, |
| - { |
| - "path": "internal/runner/mac/tools.go", |
| - "line_sha256": "7a8cbd4a6ba86b59edcc97d6c8c0ec435510e5e17fb08dc0f88e640b25972dba", |
| - "match": "node", |
| - "count": 2, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| { |
| "path": "internal/runner/mac/tools.go", |
| "line_sha256": "919069cdf769d42335d370a5c280db93a5ec435dfe749848e5381f3b48c9b604", |
| @@ -12032,13 +12025,6 @@ |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| }, |
| - { |
| - "path": "internal/runner/mac/tools_test.go", |
| - "line_sha256": "638f2658cef710bc429c6d1e96bef92831d0cfee0223df16659599158e1808a7", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| { |
| "path": "internal/runner/mac/tools_test.go", |
| "line_sha256": "6f2052143eef3237dfa9127aaacb69654c123171a296acce48d457021748c1f4", |
| @@ -12249,27 +12235,6 @@ |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| }, |
| - { |
| - "path": "cmd/equipo-runner/install_mac_test.go", |
| - "line_sha256": "aa31e89835c64ee9af93ec3edc913f3be69107008695f9f27be74df70fa8c506", |
| - "match": "equipo-runner", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "cmd/equipo-runner/install_mac_test.go", |
| - "line_sha256": "aa31e89835c64ee9af93ec3edc913f3be69107008695f9f27be74df70fa8c506", |
| - "match": "node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "cmd/equipo-runner/install_mac_test.go", |
| - "line_sha256": "aa31e89835c64ee9af93ec3edc913f3be69107008695f9f27be74df70fa8c506", |
| - "match": "npm", |
| - "count": 2, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| { |
| "path": "cmd/equipo-runner/install_mac_test.go", |
| "line_sha256": "f33b494398db4ef39fe58e521efddc4a520662b11256141d67bab2d3d3038044", |
| @@ -12325,5 +12290,145 @@ |
| "match": "equipo-runner", |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac_test.go", |
| + "line_sha256": "1f92c80bbad30ab0b1a3d652465db27d0d67a794d4bf960d70f133bd314f7cad", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac_test.go", |
| + "line_sha256": "42ef1bcf8ae748213c1a3ad806e7f141011592571a877caed6fd1e912bef6742", |
| + "match": "equipo-runner", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac_test.go", |
| + "line_sha256": "f0e083b02cfc71db1d3066bdea73d2602e0fab1f50aff3f1a56a6fd753b658fb", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac_test.go", |
| + "line_sha256": "f0e083b02cfc71db1d3066bdea73d2602e0fab1f50aff3f1a56a6fd753b658fb", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac_test.go", |
| + "line_sha256": "f0e083b02cfc71db1d3066bdea73d2602e0fab1f50aff3f1a56a6fd753b658fb", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools.go", |
| + "line_sha256": "15803bcbbf5c69d949e512fb40bc20d47e3b09d214028f7cf733aaacaca0c4b0", |
| + "match": "node", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools.go", |
| + "line_sha256": "15803bcbbf5c69d949e512fb40bc20d47e3b09d214028f7cf733aaacaca0c4b0", |
| + "match": "npm", |
| + "count": 4, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools.go", |
| + "line_sha256": "9762f066dc15e46065725902e70b1d60473228dfdf52720d341e3063fcb051e2", |
| + "match": "node", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools.go", |
| + "line_sha256": "97a96c897fd25962bc13ef5bc71b2e14070a94ba46872e3404915bcbe8299029", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "0272d245a299f54d9254768ed1eef6df678615f77cfca6dbf6efa95e16a7a487", |
| + "match": "node", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "0272d245a299f54d9254768ed1eef6df678615f77cfca6dbf6efa95e16a7a487", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "317eabae3fa232321a388fbb9d82c791a7207f6f8b17542011ec8d753c2c2ecc", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "317eabae3fa232321a388fbb9d82c791a7207f6f8b17542011ec8d753c2c2ecc", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "383bcc11eb5554eed20cacab0552b8b022ca71d86f30d4a266859417456f8ebd", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "85253de1fd395720c7b94c51c4c481b0a213c2b46116be7949fdc4c30a021725", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "879b49555ae7e80d560325d5a956f0756167d96a56ca64fa66526aecd251783a", |
| + "match": "node", |
| + "count": 6, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "879b49555ae7e80d560325d5a956f0756167d96a56ca64fa66526aecd251783a", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "ac170076aa290d0bc270ea7d85ac43be3137bc27adf44bb454ac591c0172dae0", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "d9f15487823bf3c9e1180405f97c40896f67084908411cd09002be2fa6e13fe7", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/tools_test.go", |
| + "line_sha256": "e6fcbb4c76012b122ff3a09ac469a663e457b018023b600fced27de32c1eb49d", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| } |
| ] |