Skip to content

Commit

Permalink
Don't use symlink directory in the path of the program name
Browse files Browse the repository at this point in the history
This is a workaround for the issue that the argv0 program path
containing a symlink directory in the path causes `Bundle.main` to
crash.
  • Loading branch information
kateinoigakukun committed May 27, 2024
1 parent 133488c commit f1de3b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions IntegrationTests/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { SwiftRuntime } from "javascript-kit-swift"
import { WASI as NodeWASI } from "wasi"
import { WASI as MicroWASI, useAll } from "uwasi"
import * as fs from "fs/promises"
import path from "path";

const WASI = {
MicroWASI: ({ programName }) => {
const wasi = new MicroWASI({
args: [programName],
args: [path.basename(programName)],
env: {},
features: [useAll()],
})
Expand All @@ -21,7 +22,7 @@ const WASI = {
},
Node: ({ programName }) => {
const wasi = new NodeWASI({
args: [programName],
args: [path.basename(programName)],
env: {},
preopens: {
"/": "./",
Expand Down

0 comments on commit f1de3b4

Please sign in to comment.