Skip to content

feat(rolldown): support compile to wasi#467

Merged
Brooooooklyn merged 1 commit intomainfrom
wasi
Apr 16, 2024
Merged

feat(rolldown): support compile to wasi#467
Brooooooklyn merged 1 commit intomainfrom
wasi

Conversation

@Brooooooklyn
Copy link
Member

This pull request is working on adding a wasi compile target for the rolldown itself.

@netlify
Copy link

netlify bot commented Mar 8, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit da6100a
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/661e7ff27dd5bc00077bd9b7

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 20, 2024

CodSpeed Performance Report

Merging #467 will not alter performance

Comparing wasi (da6100a) with main (07a175b)

Summary

✅ 6 untouched benchmarks

@Brooooooklyn
Copy link
Member Author

Test with this branch, you can run the following commands:

  • rustup target add wasm32-wasi-preview1-threads
  • pnpm --filter=rolldown build-binding:release --target wasm32-wasi-preview1-threads
  • pnpm --filter=rolldown build-node
  • NAPI_RS_FORCE_WASI=1 pnpm --filter=@example/basic build

There is a weird error at this moment:

Error [RuntimeError]: unreachable
    at rust_panic (wasm://wasm/0b2ab492:wasm-function[4980]:0x31a06b)
    at _ZN3std9panicking20rust_panic_with_hook17h3f09aea7b2ed8bbbE (wasm://wasm/0b2ab492:wasm-function[313]:0x37887)
    at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17ha537cf0f5d20bf0bE (wasm://wasm/0b2ab492:wasm-function[5000]:0x31b198)
    at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17h9f64aa6f1c5a364cE (wasm://wasm/0b2ab492:wasm-function[4999]:0x31b0fe)
    at rust_begin_unwind (wasm://wasm/0b2ab492:wasm-function[1226]:0xe85e5)
    at _ZN4core9panicking9panic_fmt17h02a8c9b024bafa78E (wasm://wasm/0b2ab492:wasm-function[67]:0x3dd1)
    at _ZN5alloc7raw_vec17capacity_overflow17h8b23895888f87993E (wasm://wasm/0b2ab492:wasm-function[71]:0x40a8)
    at _ZN12oxc_resolver25ResolverGeneric$LT$Fs$GT$15load_extensions17hb54a1cb9ebda3a08E (wasm://wasm/0b2ab492:wasm-function[173]:0x15afa)
    at _ZN12oxc_resolver25ResolverGeneric$LT$Fs$GT$12load_as_file17ha8065311eab60283E (wasm://wasm/0b2ab492:wasm-function[175]:0x162ca)
    at _ZN12oxc_resolver25ResolverGeneric$LT$Fs$GT$25load_as_file_or_directory17h2b59a006b80b355cE (wasm://wasm/0b2ab492:wasm-function[230]:0x24da9)

Node.js v20.11.1
/home/lyn/workspace/github/rolldown/examples/basic-vue:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @example/basic@ build: `node build.js`
Exit status 1

@codecov
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 18.91892% with 30 lines in your changes are missing coverage. Please review.

Project coverage is 78.02%. Comparing base (07a175b) to head (da6100a).

Files Patch % Lines
...own_binding/src/utils/normalize_binding_options.rs 0.00% 18 Missing ⚠️
crates/rolldown_binding/src/bundler.rs 0.00% 8 Missing ⚠️
crates/rolldown/src/bundler.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #467      +/-   ##
==========================================
- Coverage   78.31%   78.02%   -0.30%     
==========================================
  Files         137      137              
  Lines        6849     6871      +22     
==========================================
- Hits         5364     5361       -3     
- Misses       1485     1510      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Brooooooklyn and the rest of your teammates on Graphite Graphite

@Brooooooklyn Brooooooklyn force-pushed the wasi branch 2 times, most recently from 30ae271 to 5d0443c Compare April 16, 2024 13:21
@Brooooooklyn Brooooooklyn requested a review from hyf0 April 16, 2024 13:22
@Brooooooklyn Brooooooklyn marked this pull request as ready for review April 16, 2024 13:25
@Brooooooklyn Brooooooklyn changed the title feat(binding): support compile to wasi feat(rolldown): support compile to wasi Apr 16, 2024
@hyf0 hyf0 linked an issue Apr 16, 2024 that may be closed by this pull request
hyf0
hyf0 previously approved these changes Apr 16, 2024
Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cooler!

@Brooooooklyn Brooooooklyn merged commit da45d40 into main Apr 16, 2024
@Brooooooklyn Brooooooklyn deleted the wasi branch April 16, 2024 13:47
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 this pull request may close these issues.

WASI support

2 participants