mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
* refactor(tooling): organize test runtime and maintenance owners * test(tooling): preserve relocated runtime fixture dependency edges * refactor(tooling): preserve xterm routing owner checks * ci(tooling): include routing owner in sparse checkout * test(tooling): preserve copied workflow dependency closures * fix(tooling): normalize hashed JSON assets in release parity * fix(tooling): distinguish asset aliases from literal references * fix(tooling): frame normalized asset reference payloads * fix(tooling): normalize decoded JSON asset references * refactor(tooling): organize build, CI and release owners * fix(tooling): align moved generator and workflow path contracts * fix(tooling): update generated plugin bundle owner banners * test(tooling): create relocated mobile verifier fixture directories * test(tooling): copy headless detector dependency closure * test(tooling): align native batch policy fixtures with owner path * fix(tooling): link moved reliability command to historical evidence * fix(tooling): preserve nested sandbox owners and canonical guide source * fix(tooling): target release version owners in checkout fixture
55 lines
1.8 KiB
JavaScript
55 lines
1.8 KiB
JavaScript
'use strict'
|
|
|
|
// Probe addon load in fresh runtime process: failed native load can poison process. Usage: <runtime> this.cjs <module> <dir>.
|
|
|
|
const { accessSync, constants, existsSync } = require('node:fs')
|
|
const { join } = require('node:path')
|
|
const { assertNodePtyJobOwnership } = require('./node-pty-job-ownership.cjs')
|
|
const {
|
|
assertWindowsProcessTreeCreationTime
|
|
} = require('../windows/windows-process-tree-creation-time.cjs')
|
|
const { nodePtyNativeModuleName } = require('./native-build-entry.cjs')
|
|
|
|
const NODE_PTY_CONPTY_RUNTIME_FILES = ['conpty.dll', 'OpenConsole.exe']
|
|
|
|
function probeNativeBuildDir(moduleName, dir) {
|
|
if (moduleName === 'node-pty') {
|
|
const nativeName = nodePtyNativeModuleName()
|
|
const addonPath = join(dir, `${nativeName}.node`)
|
|
const native = { dir, module: require(addonPath) }
|
|
assertNodePtyJobOwnership({ nativeName, native, addonPath })
|
|
if (process.platform === 'darwin') {
|
|
accessSync(join(dir, 'spawn-helper'), constants.X_OK)
|
|
}
|
|
if (nativeName === 'conpty') {
|
|
for (const filename of NODE_PTY_CONPTY_RUNTIME_FILES) {
|
|
if (!existsSync(join(dir, 'conpty', filename))) {
|
|
throw new Error(
|
|
`node-pty ConPTY runtime file is missing: ${join(dir, 'conpty', filename)}`
|
|
)
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
if (moduleName === '@vscode/windows-process-tree') {
|
|
assertWindowsProcessTreeCreationTime({
|
|
module: require(join(dir, 'windows_process_tree.node'))
|
|
})
|
|
return
|
|
}
|
|
throw new Error(`no probe for ${moduleName}`)
|
|
}
|
|
|
|
if (require.main === module) {
|
|
const [moduleName, dir] = process.argv.slice(2)
|
|
try {
|
|
probeNativeBuildDir(moduleName, dir)
|
|
} catch (error) {
|
|
console.error(`${moduleName}: ${error instanceof Error ? error.message : String(error)}`)
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
module.exports = { probeNativeBuildDir }
|