pinokiod 7.4.2 → 7.4.3
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/kernel/bin/ffmpeg.js
CHANGED
|
@@ -9,28 +9,11 @@ class Ffmpeg {
|
|
|
9
9
|
return CONDA_SPEC
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
condaInstallFlags() {
|
|
13
|
-
if (this.kernel.platform === "win32") {
|
|
14
|
-
return `-y --solver=classic ${CONDA_CHANNEL_FLAGS}`
|
|
15
|
-
}
|
|
16
|
-
return `-y ${CONDA_CHANNEL_FLAGS}`
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
solverRepairCommands() {
|
|
20
|
-
if (this.kernel.platform !== "win32") {
|
|
21
|
-
return []
|
|
22
|
-
}
|
|
23
|
-
return [
|
|
24
|
-
`conda install -y --solver=classic ${CONDA_CHANNEL_FLAGS} "conda-libmamba-solver>=25.4.0" libmamba libmambapy libsolv libarchive`
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
12
|
async install(req, ondata) {
|
|
29
13
|
await this.kernel.bin.exec({
|
|
30
14
|
message: [
|
|
31
15
|
"conda clean -y --all",
|
|
32
|
-
|
|
33
|
-
`conda install ${this.condaInstallFlags()} ${this.cmd()}`
|
|
16
|
+
`conda install -y ${CONDA_CHANNEL_FLAGS} ${this.cmd()}`
|
|
34
17
|
]
|
|
35
18
|
}, ondata)
|
|
36
19
|
}
|
|
@@ -7,20 +7,9 @@ const LEGACY_FFMPEG_HOOK_NAMES = [
|
|
|
7
7
|
'zz_pinokio_ffmpeg.ps1',
|
|
8
8
|
]
|
|
9
9
|
|
|
10
|
-
const TRANSIENT_REMOVE_ERRORS = new Set([
|
|
11
|
-
'EBUSY',
|
|
12
|
-
'ENOTEMPTY',
|
|
13
|
-
'EPERM',
|
|
14
|
-
'EACCES',
|
|
15
|
-
])
|
|
16
|
-
|
|
17
10
|
const REMOVE_RETRY_COUNT = 5
|
|
18
11
|
const REMOVE_RETRY_DELAY_MS = 100
|
|
19
12
|
|
|
20
|
-
function delay(ms) {
|
|
21
|
-
return new Promise((resolve) => setTimeout(resolve, ms))
|
|
22
|
-
}
|
|
23
|
-
|
|
24
13
|
async function pathExists(target) {
|
|
25
14
|
return fs.promises.access(target).then(() => true).catch(() => false)
|
|
26
15
|
}
|
|
@@ -84,29 +73,6 @@ async function hasCleanupTargets(kernel) {
|
|
|
84
73
|
await hasAnyPath(legacyFfmpegRuntimePaths(kernel))
|
|
85
74
|
}
|
|
86
75
|
|
|
87
|
-
function isTransientRemoveError(error) {
|
|
88
|
-
return error && TRANSIENT_REMOVE_ERRORS.has(error.code)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
async function retryTransient(operation) {
|
|
92
|
-
let lastError
|
|
93
|
-
for (let attempt = 0; attempt <= REMOVE_RETRY_COUNT; attempt += 1) {
|
|
94
|
-
try {
|
|
95
|
-
return await operation()
|
|
96
|
-
} catch (error) {
|
|
97
|
-
if (error && error.code === 'ENOENT') {
|
|
98
|
-
return null
|
|
99
|
-
}
|
|
100
|
-
lastError = error
|
|
101
|
-
if (!isTransientRemoveError(error) || attempt === REMOVE_RETRY_COUNT) {
|
|
102
|
-
break
|
|
103
|
-
}
|
|
104
|
-
await delay(REMOVE_RETRY_DELAY_MS * (attempt + 1))
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
throw lastError
|
|
108
|
-
}
|
|
109
|
-
|
|
110
76
|
async function removeLegacyPath(target, ondata) {
|
|
111
77
|
const existed = await pathExists(target)
|
|
112
78
|
if (!existed) {
|
|
@@ -114,12 +80,12 @@ async function removeLegacyPath(target, ondata) {
|
|
|
114
80
|
}
|
|
115
81
|
|
|
116
82
|
try {
|
|
117
|
-
await
|
|
83
|
+
await fs.promises.rm(target, {
|
|
118
84
|
recursive: true,
|
|
119
85
|
force: true,
|
|
120
86
|
maxRetries: REMOVE_RETRY_COUNT,
|
|
121
87
|
retryDelay: REMOVE_RETRY_DELAY_MS,
|
|
122
|
-
})
|
|
88
|
+
})
|
|
123
89
|
} catch (error) {
|
|
124
90
|
if (ondata) {
|
|
125
91
|
const reason = error && (error.code || error.message) ? error.code || error.message : String(error)
|
package/package.json
CHANGED
package/test/ffmpeg-bin.test.js
CHANGED
|
@@ -34,14 +34,13 @@ test('FFmpeg bin installs pinned ffmpeg into base Conda on Windows', async () =>
|
|
|
34
34
|
assert.equal(calls.length, 1)
|
|
35
35
|
assert.deepEqual(calls[0].message, [
|
|
36
36
|
'conda clean -y --all',
|
|
37
|
-
'conda install -y --
|
|
38
|
-
'conda install -y --solver=classic --override-channels -c conda-forge ffmpeg=8.1.2',
|
|
37
|
+
'conda install -y --override-channels -c conda-forge ffmpeg=8.1.2',
|
|
39
38
|
])
|
|
40
39
|
assert.equal(calls[0].env, undefined)
|
|
41
40
|
assert.equal(calls[0].message.some((command) => /ffmpeg-env|conda create|-p /.test(command)), false)
|
|
42
41
|
})
|
|
43
42
|
|
|
44
|
-
test('FFmpeg bin installs pinned ffmpeg into base Conda
|
|
43
|
+
test('FFmpeg bin installs pinned ffmpeg into base Conda consistently across platforms', async () => {
|
|
45
44
|
const calls = []
|
|
46
45
|
const kernel = createKernel('darwin')
|
|
47
46
|
kernel.bin.exec = async (payload) => {
|