pinokiod 8.2.2 → 8.2.4

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.
@@ -3,7 +3,7 @@ const test = require('node:test')
3
3
 
4
4
  const Node = require('../kernel/bin/node')
5
5
 
6
- function createNode({ nodeVersion = '24.18.0', pnpmVersion = '11.9.0', hasNode = true, hasPnpm = true } = {}) {
6
+ function createNode({ nodeVersion = '24.22.1', pnpmVersion = '11.9.0', hasNode = true, hasPnpm = true } = {}) {
7
7
  const node = new Node()
8
8
  const conda = new Set()
9
9
  if (hasNode) conda.add('nodejs')
@@ -23,12 +23,12 @@ function createNode({ nodeVersion = '24.18.0', pnpmVersion = '11.9.0', hasNode =
23
23
  }
24
24
 
25
25
  test('Node bin pins Node.js 24 LTS and matching pnpm', () => {
26
- assert.equal(createNode().cmd(), 'nodejs=24.18.0 pnpm=11.9.0')
26
+ assert.equal(createNode().cmd(), 'nodejs=24.22.1 pnpm=11.9.0')
27
27
  })
28
28
 
29
29
  test('Node.installed accepts exactly the pinned Node.js and pnpm versions', async () => {
30
30
  assert.equal(await createNode().installed(), true)
31
- assert.equal(await createNode({ nodeVersion: '24.18.0-h654b19f_0' }).installed(), true)
31
+ assert.equal(await createNode({ nodeVersion: '24.22.1-h654b19f_0' }).installed(), true)
32
32
  assert.equal(await createNode({ pnpmVersion: '11.9.0-h7c87c79_0' }).installed(), true)
33
33
  assert.equal(await createNode({ nodeVersion: '22.21.1' }).installed(), false)
34
34
  assert.equal(await createNode({ nodeVersion: '26.4.0' }).installed(), false)
@@ -377,3 +377,49 @@ test('redactEnvArgs summarizes protected argv env values', () => {
377
377
  truncated: false
378
378
  })
379
379
  })
380
+
381
+
382
+ test('new venv bootstrap failure prevents app commands even with chain:*', { skip: process.platform === 'win32' }, async t => {
383
+ const root = await fs.mkdtemp(path.join(os.tmpdir(), 'pinokio-venv-bootstrap-'))
384
+ t.after(() => fs.rm(root, { recursive: true, force: true }))
385
+ const kernel = createKernel(root)
386
+ kernel.bin = { path: (...parts) => path.join(root, 'bin', ...parts) }
387
+ const shell = createShell(kernel)
388
+ shell.shell = 'bash'
389
+ shell.env = {}
390
+ shell.conda_hook = () => ':'
391
+ const fakeBin = path.join(root, 'fake-bin')
392
+ await fs.mkdir(fakeBin)
393
+ await fs.writeFile(path.join(fakeBin, 'python'), '#!/bin/sh\nif [ "$1" = "-m" ]; then mkdir -p "$3/bin"; touch "$3/bin/activate"; exit 0; fi\nexit 19\n', { mode: 0o755 })
394
+ const params = await shell.activate({ path: root, conda: { skip: true }, venv: 'env', chain: '*', message: `touch '${root}/app-ran'` })
395
+ const result = require('node:child_process').spawnSync('bash', ['--noprofile', '--norc', '-c', shell.build(params)], { env: { ...process.env, PATH: fakeBin + ':' + process.env.PATH }, encoding: 'utf8' })
396
+ assert.notEqual(result.status, 0, result.stderr)
397
+ assert.equal(await fs.access(path.join(root, 'app-ran')).then(() => true, () => false), false)
398
+ })
399
+
400
+ test('existing app environments do not run the creation-only pip bootstrap', async t => {
401
+ const root = await fs.mkdtemp(path.join(os.tmpdir(), 'pinokio-existing-env-'))
402
+ t.after(() => fs.rm(root, { recursive: true, force: true }))
403
+ await fs.mkdir(path.join(root, 'env'))
404
+ const shell = createShell(createKernel(root))
405
+ shell.shell = 'bash'
406
+ const params = await shell.activate({ path: root, conda: { skip: true }, venv: 'env', message: 'echo app' })
407
+ assert.doesNotMatch(shell.build(params), /pip.*install/)
408
+ })
409
+
410
+
411
+ test('existing venv with outdated pip cannot bypass the guard on a retry', { skip: process.platform === 'win32' }, async t => {
412
+ const root = await fs.mkdtemp(path.join(os.tmpdir(), 'pinokio-venv-retry-'))
413
+ t.after(() => fs.rm(root, { recursive: true, force: true }))
414
+ await fs.mkdir(path.join(root, 'env/bin'), { recursive: true })
415
+ await fs.writeFile(path.join(root, 'env/bin/activate'), '')
416
+ const fakeBin = path.join(root, 'fake-bin')
417
+ await fs.mkdir(fakeBin)
418
+ await fs.writeFile(path.join(fakeBin, 'python'), '#!/bin/sh\nexit 19\n', { mode: 0o755 })
419
+ const shell = createShell(createKernel(root))
420
+ shell.shell = 'bash'
421
+ const params = await shell.activate({ path: root, conda: { skip: true }, venv: 'env', chain: '*', message: `touch '${root}/app-ran'` })
422
+ const result = require('node:child_process').spawnSync('bash', ['--noprofile', '--norc', '-c', shell.build(params)], { env: { ...process.env, PATH: fakeBin + ':' + process.env.PATH }, encoding: 'utf8' })
423
+ assert.notEqual(result.status, 0, result.stderr)
424
+ assert.equal(await fs.access(path.join(root, 'app-ran')).then(() => true, () => false), false)
425
+ })
@@ -16,13 +16,13 @@ function createUV(version) {
16
16
  return uv
17
17
  }
18
18
 
19
- test('UV bin pins uv to 0.11.23', () => {
20
- assert.equal(createUV('0.11.23').cmd(), 'uv=0.11.23')
19
+ test('UV bin pins uv to 0.13.4', () => {
20
+ assert.equal(createUV('0.13.4').cmd(), 'uv=0.13.4')
21
21
  })
22
22
 
23
- test('UV.installed accepts exactly uv 0.11.23', async () => {
24
- assert.equal(await createUV('0.11.23').installed(), true)
25
- assert.equal(await createUV('0.11.23-h1234567_0').installed(), true)
23
+ test('UV.installed accepts exactly uv 0.13.4', async () => {
24
+ assert.equal(await createUV('0.13.4').installed(), true)
25
+ assert.equal(await createUV('0.13.4-h1234567_0').installed(), true)
26
26
  assert.equal(await createUV('0.11.22').installed(), false)
27
27
  assert.equal(await createUV('0.12.0').installed(), false)
28
28
  assert.equal(await createUV(null).installed(), false)