ruby_wasm 2.5.1-aarch64-linux-musl
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.clang-format +8 -0
- data/CONTRIBUTING.md +128 -0
- data/Gemfile +17 -0
- data/LICENSE +21 -0
- data/NOTICE +1293 -0
- data/README.md +154 -0
- data/Rakefile +164 -0
- data/Steepfile +24 -0
- data/benchmarks/vm_deep_call.rb +55 -0
- data/docs/api.md +2 -0
- data/docs/cheat_sheet.md +195 -0
- data/docs/faq.md +25 -0
- data/exe/rbwasm +7 -0
- data/ext/.gitignore +2 -0
- data/ext/README.md +11 -0
- data/ext/extinit.c.erb +32 -0
- data/lib/ruby_wasm/3.1/ruby_wasm.so +0 -0
- data/lib/ruby_wasm/3.2/ruby_wasm.so +0 -0
- data/lib/ruby_wasm/3.3/ruby_wasm.so +0 -0
- data/lib/ruby_wasm/build/build_params.rb +3 -0
- data/lib/ruby_wasm/build/downloader.rb +18 -0
- data/lib/ruby_wasm/build/executor.rb +191 -0
- data/lib/ruby_wasm/build/product/baseruby.rb +37 -0
- data/lib/ruby_wasm/build/product/crossruby.rb +360 -0
- data/lib/ruby_wasm/build/product/libyaml.rb +70 -0
- data/lib/ruby_wasm/build/product/openssl.rb +93 -0
- data/lib/ruby_wasm/build/product/product.rb +39 -0
- data/lib/ruby_wasm/build/product/ruby_source.rb +103 -0
- data/lib/ruby_wasm/build/product/wasi_vfs.rb +45 -0
- data/lib/ruby_wasm/build/product/zlib.rb +70 -0
- data/lib/ruby_wasm/build/product.rb +8 -0
- data/lib/ruby_wasm/build/target.rb +24 -0
- data/lib/ruby_wasm/build/toolchain/wit_bindgen.rb +31 -0
- data/lib/ruby_wasm/build/toolchain.rb +193 -0
- data/lib/ruby_wasm/build.rb +92 -0
- data/lib/ruby_wasm/cli.rb +347 -0
- data/lib/ruby_wasm/packager/component_adapter/wasi_snapshot_preview1.command.wasm +0 -0
- data/lib/ruby_wasm/packager/component_adapter/wasi_snapshot_preview1.reactor.wasm +0 -0
- data/lib/ruby_wasm/packager/component_adapter.rb +14 -0
- data/lib/ruby_wasm/packager/core.rb +333 -0
- data/lib/ruby_wasm/packager/file_system.rb +160 -0
- data/lib/ruby_wasm/packager.rb +96 -0
- data/lib/ruby_wasm/rake_task.rb +60 -0
- data/lib/ruby_wasm/util.rb +15 -0
- data/lib/ruby_wasm/version.rb +3 -0
- data/lib/ruby_wasm.rb +34 -0
- data/package-lock.json +9777 -0
- data/package.json +12 -0
- data/rakelib/check.rake +37 -0
- data/rakelib/ci.rake +152 -0
- data/rakelib/doc.rake +29 -0
- data/rakelib/format.rake +35 -0
- data/rakelib/gem.rake +22 -0
- data/rakelib/packaging.rake +165 -0
- data/rakelib/version.rake +40 -0
- data/sig/open_uri.rbs +4 -0
- data/sig/ruby_wasm/build.rbs +327 -0
- data/sig/ruby_wasm/cli.rbs +51 -0
- data/sig/ruby_wasm/ext.rbs +26 -0
- data/sig/ruby_wasm/packager.rbs +122 -0
- data/sig/ruby_wasm/util.rbs +5 -0
- data/tools/clang-format-diff.sh +18 -0
- data/tools/exe/rbminify +12 -0
- data/tools/lib/syntax_tree/minify_ruby.rb +63 -0
- metadata +114 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ba75f9f051d43ab4d956fda7ccbef75d85205c0985dd8bfd6c45d419dc8e325a
|
4
|
+
data.tar.gz: 426e8a8c99c59ea95748586fa10eba6ee943b64393bc31678ee2a2583afb3edf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4b3c9ceb1c8e00dc7b0059036d8e7d3b3cb58a40e1b2aa112024150284285fbd3aa6a606f6dd8cf31302944a4ab8dc6c057bf8494d7a0d9ac871fbf434a504b7
|
7
|
+
data.tar.gz: 29a96037f3895b292b7ec0f9fc6525c879043e51981b12c6df646c1f0f7dd86a9666f1ba077f3938d68fdc3a16777ed8d82ac60ccbfa57f4a7162f8b4f529f05
|
data/.clang-format
ADDED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
# How to Contribute
|
2
|
+
|
3
|
+
Thank you for your interest in contributing to ruby.wasm!
|
4
|
+
This document describes development setup and pointers for diving into this project.
|
5
|
+
|
6
|
+
## Install dependencies
|
7
|
+
|
8
|
+
```console
|
9
|
+
$ git clone https://github.com/ruby/ruby.wasm
|
10
|
+
$ cd ruby.wasm
|
11
|
+
$ ./bin/setup
|
12
|
+
# Compile extension library
|
13
|
+
$ bundle exec rake compile
|
14
|
+
$ rake --tasks
|
15
|
+
```
|
16
|
+
|
17
|
+
## Building and Testing [`ruby-wasm-wasi`](./packages/npm-packages/ruby-wasm-wasi)
|
18
|
+
|
19
|
+
```console
|
20
|
+
# Download a prebuilt Ruby release (if you don't need to re-build Ruby)
|
21
|
+
$ rake build:download_prebuilt
|
22
|
+
|
23
|
+
# Build Ruby (if you need to build Ruby by yourself)
|
24
|
+
$ rake build:head-wasm32-unknown-wasip1-full
|
25
|
+
|
26
|
+
# Build npm package
|
27
|
+
$ rake npm:ruby-head-wasm-wasi
|
28
|
+
# Test npm package
|
29
|
+
$ rake npm:ruby-head-wasm-wasi:check
|
30
|
+
```
|
31
|
+
|
32
|
+
If you need to re-build Ruby, please clean `./rubies` directory, and run `rake npm:ruby-head-wasm-wasi` again.
|
33
|
+
|
34
|
+
## Building CRuby from source
|
35
|
+
|
36
|
+
If you want to build CRuby for WebAssembly from source yourself, follow the below instructions.
|
37
|
+
|
38
|
+
> **Warning**
|
39
|
+
> If you just want to build npm packages, you don't need to build CRuby from source.
|
40
|
+
> You can download a prebuilt Ruby release by `rake build:download_prebuilt`.
|
41
|
+
|
42
|
+
### For WASI target
|
43
|
+
|
44
|
+
You can build CRuby for WebAssembly/WASI on Linux (x86_64) or macOS (x86_64, arm64).
|
45
|
+
For WASI target, dependencies are automatically downloaded on demand, so you don't need to install them manually.
|
46
|
+
|
47
|
+
To select a build profile, see [profiles section in README](https://github.com/ruby/ruby.wasm#profiles).
|
48
|
+
|
49
|
+
```console
|
50
|
+
# Build only a specific combination of ruby version, profile, and target
|
51
|
+
$ rake build:head-wasm32-unknown-wasip1-full
|
52
|
+
# Clean up the build directory
|
53
|
+
$ rake build:head-wasm32-unknown-wasip1-full:clean
|
54
|
+
# Force to re-execute "make install"
|
55
|
+
$ rake build:head-wasm32-unknown-wasip1-full:remake
|
56
|
+
|
57
|
+
# Output is in the `rubies` directory
|
58
|
+
$ tree -L 3 rubies/head-wasm32-unknown-wasip1-full
|
59
|
+
rubies/head-wasm32-unknown-wasip1-full/
|
60
|
+
├── usr
|
61
|
+
│ └── local
|
62
|
+
│ ├── bin
|
63
|
+
│ ├── include
|
64
|
+
│ ├── lib
|
65
|
+
│ └── share
|
66
|
+
```
|
67
|
+
|
68
|
+
### For Emscripten target
|
69
|
+
|
70
|
+
To build CRuby for WebAssembly/Emscripten, you need to install [Emscripten](https://emscripten.org).
|
71
|
+
Please follow the official instructions to install.
|
72
|
+
|
73
|
+
```console
|
74
|
+
# Build only a specific combination of ruby version, profile, and target
|
75
|
+
$ rake build:head-wasm32-unknown-emscripten-full
|
76
|
+
# Output is in the `rubies` directory
|
77
|
+
$ tree -L 3 rubies/head-wasm32-unknown-emscripten-full
|
78
|
+
rubies/head-wasm32-unknown-emscripten-full
|
79
|
+
└── usr
|
80
|
+
└── local
|
81
|
+
├── bin
|
82
|
+
├── include
|
83
|
+
├── lib
|
84
|
+
└── share
|
85
|
+
```
|
86
|
+
|
87
|
+
## Code Formatting
|
88
|
+
|
89
|
+
This project uses multiple code formatters for each language.
|
90
|
+
To format all files, run `rake format`.
|
91
|
+
Please make sure to run this command before submitting a pull request.
|
92
|
+
|
93
|
+
## Re-bindgen from `.wit` files
|
94
|
+
|
95
|
+
If you update [`*.wit`](https://github.com/WebAssembly/component-model/blob/ed90add27ae845b2e2b9d7db38a966d9f78aa4c0/design/mvp/WIT.md), which describe the interface of a WebAssembly module, either imported or exported, you need to re-generate glue code from `*.wit`.
|
96
|
+
|
97
|
+
To re-generate them, you need to install the Rust compiler `rustc` and Cargo, then run `rake check:bindgen`.
|
98
|
+
|
99
|
+
The rake task installs [`wit-bindgen`](https://github.com/bytecodealliance/wit-bindgen) on demand, then just execute it for each generated code
|
100
|
+
|
101
|
+
If you see `missing executable: cargo`, please make sure `cargo` is installed correctly in your `PATH`.
|
102
|
+
|
103
|
+
## Release Process
|
104
|
+
|
105
|
+
To bump up npm package version, please follow the below steps:
|
106
|
+
|
107
|
+
```
|
108
|
+
$ rake 'bump_version[0.6.0]'
|
109
|
+
$ git commit -m"Bump version to 0.6.0"
|
110
|
+
$ git tag 0.6.0
|
111
|
+
$ git push origin 0.6.0
|
112
|
+
$ for pkg in pkg/ruby_wasm-*; do gem push $pkg; done
|
113
|
+
$ (cd packages/gems/js/ && gem build && gem push js-*.gem)
|
114
|
+
```
|
115
|
+
|
116
|
+
## Release Channels
|
117
|
+
|
118
|
+
Each npm package in this project provides two release channels: `latest` and `next`. The `latest` channel is for stable releases, and `next` channel is for pre-release.
|
119
|
+
|
120
|
+
e.g. For [`@ruby/wasm-wasi`](https://www.npmjs.com/package/@ruby/wasm-wasi)
|
121
|
+
|
122
|
+
```console
|
123
|
+
$ npm install --save @ruby/wasm-wasi@latest
|
124
|
+
# or if you want the nightly snapshot
|
125
|
+
$ npm install --save @ruby/wasm-wasi@next
|
126
|
+
# or you can specify the exact snapshot version
|
127
|
+
$ npm install --save @ruby/wasm-wasi@2.5.1-2024-04-21-a
|
128
|
+
```
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gemspec
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem "rake"
|
9
|
+
gem "rake-compiler"
|
10
|
+
gem "rb_sys", "0.9.97"
|
11
|
+
end
|
12
|
+
|
13
|
+
group :check do
|
14
|
+
gem "webrick"
|
15
|
+
gem "syntax_tree", "~> 3.5"
|
16
|
+
gem "steep"
|
17
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Yuta Saito
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|