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
Bump swc #9574
base: v2
Are you sure you want to change the base?
Conversation
Even in release builds, there is a segfault now in the EnvReplacer, the stack trace does many Usually, this is only a problem (and has happened for a long time) in non-release builds. But only on Linux and Windows, macOS works fine. |
9109912
to
dd8513d
Compare
The same asset also works fine in a standalone Rust projects (with the exact code as the JSTransformer, just without the Node process). |
Not really an area I have any experience in, but a quick search shows that is possible to increase the stack size with some linker flags: https://www.reddit.com/r/rust/comments/872fc4/how_to_increase_the_stack_size/ Is that worth experimenting with? EDIT: read something else that mentioned threads on linux specifically have a smaller stack, maybe we need to increase the Rayon thread stack size (that's where this code is running, right?): https://docs.rs/rayon/latest/rayon/struct.ThreadPoolBuilder.html#method.stack_size |
I want to try bisecting which swc version introduced this, because not much changed regarding the AST depth So increasing the stack size would maybe just be a workaround until some future version. |
As it turns out, this also occurs in Deno and Turbopack: swc-project/swc#8840 |
9022329
to
214a0b2
Compare
I've rebased onto v2 and bumped swc again (but not much changed ac92e7a) and now Windows CI appears to work (even without your PR), but maybe it's also not deterministic |
And indeed, now it's failing again |
Ugh yeah. It's definitely non deterministic. The I think the CI failure is happening on something other than the |
Does
But EnvReplacer also runs in that case? I don't quite understand what you mean
I think Rust simply doesn't emit "nice" panics for stack traces. You get get a segfault/invalid instruction. |
You'd need to compile with debugging information to get nice stack traces (debug=true in the Cargo profile). Though that might affect the outcome, we had an internal rayon panic we saw quite a bit internally go away when we started building the canary release with debuginfo (even though it gets extracted to a separate file and stripped from the binary). |
Weirdly I couldn't reproduce even with And yeah it looks like you're right about stack overflows not reporting a back trace. I should have known better than to trust gpt lol. |
Bump swc
This reverts commit d4dba2c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if my review is enough here but this LGTM.
No, Github doesn't see it as a approving review... |
Closes #9632
Closes #9607
There's a major breaking change, the LHS of assignments is now a special enum.
There's one place which I haven't been able to fix yet. Putting this up in case someone else wants to bump swc sooner rather than later for some reason