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
fix(plugin-runner): More details on pointer conversion failures #6378
Conversation
|
You can build by yourself and replace node binding to check the cause. This PR is not required |
@kdy1 : Thanks for this hint. Sounds like a good approach. I guess that the steps performed in swc/.github/workflows/publish-node.yml Line 54 in 410ec6f
|
You need |
Thanks for the hint on the swc/.github/workflows/publish-node.yml Line 62 in 410ec6f
|
I'm sorry, but I didn't get what you are saying. Can you explain in other words? (sorry for my bad English, I'm not an English native) |
We are trying to build the SWC binaries such that they can be used within the NodeJs package, that is, to copy them in the end into I think that having a list of steps to perform (starting with a fork of the SWC repo with some modifications) for such debugging endeavors would be helpful for the community as a whole. At least, I would appreciate it ;) I am on a recent Linux machine with Ubuntu and 64bit. |
One problem I am facing at the moment is that the SWC crates are used from the registry and not from the monorepo itself. (I am neither English nor Rust native ;)) |
The snippet
from the |
By patching the Cargo.toml as indicated above, I was able to use my own SWC binary. The plugin runner now fails with:
This is the adjusted output proposed by this pull request. |
cc @kwonoj Any thoughts? I think it's |
Yes, seems like it's some kind overflow peeking by number only, but to confirm we need to see if host created number larger than u32 really. I'm not sure either if memory interop supposed to create 64 as allocation happens in wasm runtime would create wasm's memory boundary. |
Would it make sense to use The code uses
Also here:
|
Are you facing it with next dev server? |
I mean, a long-running process |
I am facing the problem when instrumenting a larger JS bundle with https://github.com/kwonoj/swc-plugin-coverage-instrument . I am invoking that plugin programatically. I am doing some additional transformations on the resulting AST. |
The process is short lived. |
I'm aware of the memory issue, but I didn't think someone would process a such big input |
How big is it? What's the sum of all inputs to swc within a single process? |
The file that is passed to SWC has 500KB (only) and is a small react application that was bundled using Vite/ESbuild. I would have bundles of 100MBs and more to work on. |
(The size of the bundles to work on is actually the reason to use SWC instead of Babel). |
Hmm... Then it's not the issue I was aware of |
What do you think about changing the pointers from |
At least, the real cause of the problem is no longer masked then:
|
Wasm64 would be the the best thing to have :D |
I think it's fine, but I want to ask @kwonoj about opinions |
I think it is no harm to try, at least it shouldn't be a breaking changes. But as discussed above, if the input size is real culprit we don't have lot of options to solve it. wasm64 is probably not available in a short timeframe. |
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.
swc-bump:
- swc_common
@stahlbauer Please allow editing PR |
@kdy1 : You should have the permissions now. Thanks. |
As a follow-up, I have created the following ticket: #6404 |
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.
CI failed
@kdy1: I will have a look. |
Description: This change set provides (1) additional debug infos in cases when conversions of pointers between the Rust world and the WASM world fail, and (2) fixes an existing misleading error message.
Related issue (if exists): This should help to make progress addressing #6249.