-
Notifications
You must be signed in to change notification settings - Fork 132
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
Spago fails to build on Windows and Node v 21.7 #1219
Comments
The 0.21.x line is the legacy codebase, which is not maintained anymore. Would you be able to give this a try with |
|
Good to know that the new spago works! It's not alpha in the sense that "things are changing all the time" anymore, but more like "it still has paper cuts that we should fix before calling it ready for general usage" We are using it in production at work, but YMMV. And if you do use it, please report weird things as soon as possible so we can get them fixed 🙂 |
That said, I'll close this ticket as it doesn't affect the new spago (which is now living in this repo) |
I ran into this problem as well on Windows 10 and it seems to affect the new version of spago. I'm using The problematic call is this one // spago/bin/bundle.js:85269
var spawn$prime = function() {
return function(command2) {
return function(args) {
return function(opts) {
return function() {
return spawn2(command2, args, opts);
};
};
};
};
}; It's probably connected to this |
Can confirm this also happens on spago 0.93.40 |
I'll reopen this since it seems to be a recurring issue - we should try to find a way to replicate this in CI so we can issue a reasonable fix. |
Is there any workaround we could do other than downgrade the system nodejs? Anywhere we could pass a |
We are using Node 22 in CI: spago/.github/workflows/build.yml Lines 38 to 41 in b13857d
So I wonder if there's something else at play here? |
I can confirm I am running Node v22.9.0, and have this issue, so maybe that isn't it. |
I don't think the issue has been brought up here, but maybe this has to do with the args passed to the spawn command? https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2 Could be related, and has caused similar issues for other projects in windows since the patch rolled out in all release lines, including purescript-lsp-server on my machine, which recently got fixed. |
Here's the command, arguments to the command, and other options (including full environment variables and stack trace) of the https://gist.github.com/AZMCode/616ac8a95ee5e1a93d4a92ce573d5658 Edit: Actually maybe this has to do with the path conversion Git Bash performs. I'll test that when I get the chance |
Can confirm the bug doesn't happen outside of Git Bash Should I open a new bug report? Edit: Turns out I did test it with spago@next. This happens even when running outside of git bash |
The issue starts right here The desicion is taken to report a Note that enabling the By the looks of what you're trying to execute, however, (Literally just 'purs.cmd' and the like) this shouldn't be an issue and the spawn flag could be enabled |
The |
In all honesty, I've given fixing it a good whirl, and I'm out of my depth here. I sure hope this error is eventually worked out so I can actually use purescript on my PC. I think the |
Ran into this trying to repro the CI failures on #1285. It's definitely caused by trying to invoke A proper fix would probably be doing some additional windows checks in
This was on a fresh Windows 10 virtualbox image. version things
Hacky workaround if this is totally blocking your use of spagoI was able to temporarily bypass this by editing return bind37(execa(cmd)(args)(function(v) {
return {
cleanup: v.cleanup,
preferLocal: v.preferLocal,
stripFinalNewline: v.stripFinalNewline,
extendEnv: v.extendEnv,
env: v.env,
encoding: v.encoding,
argv0: v.argv0,
ipc: v.ipc,
stdioExtra: v.stdioExtra,
detached: v.detached,
uid: v.uid,
gid: v.gid,
timeout: v.timeout,
maxBuffer: v.maxBuffer,
windowsVerbatimArguments: v.windowsVerbatimArguments,
windowsHide: v.windowsHide,
windowsEnableCmdEcho: v.windowsEnableCmdEcho,
cwd: opts.cwd,
+ shell: new Just(true),
stdin: stdinOpt,
stdout: new Just(pipe2),
stderr: new Just(pipe2)
};
}))(function(subprocess) { This unblocks being able to run |
Thanks for the effort, but applying a similar fix (I did it at the execa bindings level), I stumbled upon another bug. I could definitely give it a shot, but I'd have to bootstrap the compiler and it's a bit of a headache. I've just ended up using codespaces due to other personal reasons, so this problem is not as bad for me now. |
On linux everything works fine, but on my Windows machine, spago fails to build on Node 21.7 with
It works just fine on 21.6:
I'm not convinced the error is in spago itself, but in Node.js 21.7 I am able to do
npx purs --version
just fine (my machine is on purs version 0.15.15 and spago version 0.21.0)The text was updated successfully, but these errors were encountered: