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.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/.clang-format +8 -0
  3. data/CONTRIBUTING.md +128 -0
  4. data/Gemfile +17 -0
  5. data/LICENSE +21 -0
  6. data/NOTICE +1293 -0
  7. data/README.md +154 -0
  8. data/Rakefile +164 -0
  9. data/Steepfile +24 -0
  10. data/benchmarks/vm_deep_call.rb +55 -0
  11. data/docs/api.md +2 -0
  12. data/docs/cheat_sheet.md +195 -0
  13. data/docs/faq.md +25 -0
  14. data/exe/rbwasm +7 -0
  15. data/ext/.gitignore +2 -0
  16. data/ext/README.md +11 -0
  17. data/ext/extinit.c.erb +32 -0
  18. data/lib/ruby_wasm/3.1/ruby_wasm.so +0 -0
  19. data/lib/ruby_wasm/3.2/ruby_wasm.so +0 -0
  20. data/lib/ruby_wasm/3.3/ruby_wasm.so +0 -0
  21. data/lib/ruby_wasm/build/build_params.rb +3 -0
  22. data/lib/ruby_wasm/build/downloader.rb +18 -0
  23. data/lib/ruby_wasm/build/executor.rb +191 -0
  24. data/lib/ruby_wasm/build/product/baseruby.rb +37 -0
  25. data/lib/ruby_wasm/build/product/crossruby.rb +360 -0
  26. data/lib/ruby_wasm/build/product/libyaml.rb +70 -0
  27. data/lib/ruby_wasm/build/product/openssl.rb +93 -0
  28. data/lib/ruby_wasm/build/product/product.rb +39 -0
  29. data/lib/ruby_wasm/build/product/ruby_source.rb +103 -0
  30. data/lib/ruby_wasm/build/product/wasi_vfs.rb +45 -0
  31. data/lib/ruby_wasm/build/product/zlib.rb +70 -0
  32. data/lib/ruby_wasm/build/product.rb +8 -0
  33. data/lib/ruby_wasm/build/target.rb +24 -0
  34. data/lib/ruby_wasm/build/toolchain/wit_bindgen.rb +31 -0
  35. data/lib/ruby_wasm/build/toolchain.rb +193 -0
  36. data/lib/ruby_wasm/build.rb +92 -0
  37. data/lib/ruby_wasm/cli.rb +347 -0
  38. data/lib/ruby_wasm/packager/component_adapter/wasi_snapshot_preview1.command.wasm +0 -0
  39. data/lib/ruby_wasm/packager/component_adapter/wasi_snapshot_preview1.reactor.wasm +0 -0
  40. data/lib/ruby_wasm/packager/component_adapter.rb +14 -0
  41. data/lib/ruby_wasm/packager/core.rb +333 -0
  42. data/lib/ruby_wasm/packager/file_system.rb +160 -0
  43. data/lib/ruby_wasm/packager.rb +96 -0
  44. data/lib/ruby_wasm/rake_task.rb +60 -0
  45. data/lib/ruby_wasm/util.rb +15 -0
  46. data/lib/ruby_wasm/version.rb +3 -0
  47. data/lib/ruby_wasm.rb +34 -0
  48. data/package-lock.json +9777 -0
  49. data/package.json +12 -0
  50. data/rakelib/check.rake +37 -0
  51. data/rakelib/ci.rake +152 -0
  52. data/rakelib/doc.rake +29 -0
  53. data/rakelib/format.rake +35 -0
  54. data/rakelib/gem.rake +22 -0
  55. data/rakelib/packaging.rake +165 -0
  56. data/rakelib/version.rake +40 -0
  57. data/sig/open_uri.rbs +4 -0
  58. data/sig/ruby_wasm/build.rbs +327 -0
  59. data/sig/ruby_wasm/cli.rbs +51 -0
  60. data/sig/ruby_wasm/ext.rbs +26 -0
  61. data/sig/ruby_wasm/packager.rbs +122 -0
  62. data/sig/ruby_wasm/util.rbs +5 -0
  63. data/tools/clang-format-diff.sh +18 -0
  64. data/tools/exe/rbminify +12 -0
  65. data/tools/lib/syntax_tree/minify_ruby.rb +63 -0
  66. 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
@@ -0,0 +1,8 @@
1
+ ---
2
+ Language: Cpp
3
+ BasedOnStyle: LLVM
4
+ IndentPPDirectives: AfterHash
5
+ ---
6
+ Language: JavaScript
7
+ DisableFormat: true
8
+ ---
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.