Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEA builds change the working directory without navigating back, causing issues in build pipelines #130

Open
JupiterPi opened this issue Dec 27, 2024 · 0 comments · May be fixed by #131
Open

Comments

@JupiterPi
Copy link

What version of pkg are you using?

6.1.1

What version of Node.js are you using?

v20.18.1

What operating system are you using?

Windows

What CPU architecture are you using?

arm64

What Node versions, OSs and CPU architectures are you building for?

node20-x64, node20-arm64

Describe the Bug

When executing a SEA build (like npx pkg --sea source.js) via JavaScript call (require("pkg").exec()), the current working is changed to the tmp directory, but there's no navigation back to the previous directory. This is probably unintentional and breaks build scripts that execute commands relative to the working directory after executing the SEA build. (It's only an issue using the JavaScript API, since the changed working directory doesn't matter when calling it from a terminal.)

Expected Behavior

After executing the pkg --sea build, the working directory should be the same as before.

To Reproduce

console.log(process.cwd());  // C:\Users\...\myproject
await require("pkg").exec(["--sea", "source.js"]);
console.log(process.cwd());  // C:\Users\...\AppData\Local\Temp\pkg-sea\1735260464250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant