slopcode 0.2.151 → 0.2.152
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/android-runtime/arm64/bin/slopcode +0 -0
- package/android-runtime/arm64/bin/slopcode-android-host +0 -0
- package/android-runtime/x64/bin/slopcode +0 -0
- package/android-runtime/x64/bin/slopcode-android-host +0 -0
- package/bin/slopcode +21 -0
- package/bundle/index.js +13 -8
- package/bundle/worker.js +12 -8
- package/package.json +12 -12
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/slopcode
CHANGED
|
@@ -18,6 +18,23 @@ function startupLog(phase, extra = {}) {
|
|
|
18
18
|
console.error(JSON.stringify({ event: "android.startup", phase, ms: Date.now() - startupStart, ...extra }))
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function cleanupTempSo() {
|
|
22
|
+
try {
|
|
23
|
+
const tmp = os.tmpdir()
|
|
24
|
+
const files = fs.readdirSync(tmp)
|
|
25
|
+
const now = Date.now()
|
|
26
|
+
for (const file of files) {
|
|
27
|
+
if (/^\.5bfff.*\.so$/.test(file)) {
|
|
28
|
+
const full = path.join(tmp, file)
|
|
29
|
+
try {
|
|
30
|
+
const stat = fs.statSync(full)
|
|
31
|
+
if (now - stat.mtimeMs > 3600000) fs.unlinkSync(full)
|
|
32
|
+
} catch {}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} catch {}
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
function run(target, options = {}) {
|
|
22
39
|
startupLog("launcher.exec", { target: path.basename(target) })
|
|
23
40
|
const result = childProcess.spawnSync(target, options.args || process.argv.slice(2), {
|
|
@@ -29,6 +46,7 @@ function run(target, options = {}) {
|
|
|
29
46
|
process.exit(1)
|
|
30
47
|
}
|
|
31
48
|
if (result.signal === "SIGABRT" && options.fallback) {
|
|
49
|
+
cleanupTempSo()
|
|
32
50
|
console.error("slopcode crashed (SIGABRT), falling back to JS bundle...")
|
|
33
51
|
const bun = childProcess.spawnSync("bun", ["--version"], { encoding: "utf8", timeout: 3000 })
|
|
34
52
|
if (bun.status === 0 && bun.stdout.trim()) {
|
|
@@ -47,6 +65,9 @@ function run(target, options = {}) {
|
|
|
47
65
|
}
|
|
48
66
|
process.exit(typeof fb.status === "number" ? fb.status : 1)
|
|
49
67
|
}
|
|
68
|
+
console.error("slopcode crashed and no bun runtime found in PATH for fallback.")
|
|
69
|
+
console.error("Install bun: curl -fsSL https://bun.sh | bash")
|
|
70
|
+
process.exit(1)
|
|
50
71
|
}
|
|
51
72
|
if (result.signal) {
|
|
52
73
|
try {
|