@bakers-build/addon-runtime-bwrap 0.10.0 → 0.10.1-next.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.
@@ -1,6 +1,8 @@
1
1
  import type { BbRuntime } from '@bakers-build/conductor/contract';
2
2
  export interface BwrapOptions {
3
3
  readPaths?: string[];
4
+ /** Run clones borrow the parent's objects (`git clone --shared`). */
5
+ shared?: boolean;
4
6
  }
5
7
  export interface BwrapDeps {
6
8
  cachePath: string;
@@ -16,6 +16,8 @@ const SYSTEM = [
16
16
  '/etc/group',
17
17
  '/etc/nsswitch.conf',
18
18
  '/etc/localtime',
19
+ // Debian alternatives: /usr/bin/awk and friends are links into it.
20
+ '/etc/alternatives',
19
21
  ];
20
22
  const launcher = fileURLToPath(new URL(import.meta.url.includes('/dist/') ? '../../launch.mjs' : '../launch.mjs', import.meta.url));
21
23
  const within = (path, root) => path === root || path.startsWith(root + sep);
@@ -32,7 +34,9 @@ function softwarePaths(env) {
32
34
  const target = realpathSync(entry);
33
35
  if (lstatSync(target).isFile()) {
34
36
  accessSync(target, constants.X_OK);
35
- paths.push(target);
37
+ // A Node program such as npm loads its own modules: mount its package, not one file.
38
+ const pkg = /^(.*\/node_modules\/(?:@[^/]+\/)?[^/]+)\//.exec(target);
39
+ paths.push(pkg?.[1] ?? target);
36
40
  }
37
41
  }
38
42
  }
package/dist/src/index.js CHANGED
@@ -17,6 +17,7 @@ export function runtimeBwrap(options = {}) {
17
17
  kind: 'runtime',
18
18
  id: 'bwrap',
19
19
  isolates: true,
20
+ ...(options.shared !== undefined ? { shared: options.shared } : {}),
20
21
  requiredModules: [],
21
22
  createRuntime: async () => {
22
23
  if (process.platform !== 'linux')
@@ -9,6 +9,11 @@
9
9
  "items": { "type": "string", "pattern": "^/" },
10
10
  "default": [],
11
11
  "description": "Additional absolute host paths exposed read-only for coding tools. Never grant the host root or the operator home."
12
+ },
13
+ "shared": {
14
+ "type": "boolean",
15
+ "default": false,
16
+ "description": "Run clones borrow the parent repository's objects (git clone --shared) instead of copying them, for every workspace addon. Faster and smaller, but never prune or repack the parent with -d while a run is open."
12
17
  }
13
18
  }
14
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-runtime-bwrap",
3
- "version": "0.10.0",
3
+ "version": "0.10.1-next.2",
4
4
  "description": "Isolate complete agent runs with an external Bubblewrap sandbox.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,11 +23,11 @@
23
23
  "directory": "bakers-cli/addons/runtime-bwrap"
24
24
  },
25
25
  "peerDependencies": {
26
- "@bakers-build/conductor": "^0.10.0",
27
- "@bakers-build/core": "^0.10.0"
26
+ "@bakers-build/conductor": "^0.10.1-next.2",
27
+ "@bakers-build/core": "^0.10.1-next.2"
28
28
  },
29
29
  "bakersBuild": {
30
- "commit": "5857b00008bc0926fd52fdc8d9366d6d52444e35",
31
- "channel": "latest"
30
+ "commit": "1bc392c2e9aaebacbb1904ad2b55563da8784233",
31
+ "channel": "next"
32
32
  }
33
33
  }