ruby_wasm 2.5.0 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +7 -7
- data/Cargo.lock +91 -6
- data/Gemfile +1 -1
- data/README.md +9 -9
- data/Rakefile +9 -7
- data/docs/cheat_sheet.md +8 -8
- data/ext/ruby_wasm/Cargo.toml +3 -1
- data/ext/ruby_wasm/src/lib.rs +198 -8
- data/lib/ruby_wasm/build/executor.rb +4 -0
- data/lib/ruby_wasm/build/product/crossruby.rb +59 -25
- data/lib/ruby_wasm/build/product/libyaml.rb +5 -3
- data/lib/ruby_wasm/build/product/openssl.rb +7 -2
- data/lib/ruby_wasm/build/product/product.rb +3 -3
- data/lib/ruby_wasm/build/product/ruby_source.rb +3 -3
- data/lib/ruby_wasm/build/product/wasi_vfs.rb +1 -1
- data/lib/ruby_wasm/build/product/zlib.rb +3 -1
- data/lib/ruby_wasm/build/target.rb +24 -0
- data/lib/ruby_wasm/build/toolchain/wit_bindgen.rb +2 -2
- data/lib/ruby_wasm/build/toolchain.rb +1 -1
- data/lib/ruby_wasm/build.rb +7 -3
- data/lib/ruby_wasm/cli.rb +147 -11
- data/lib/ruby_wasm/feature_set.rb +30 -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 +199 -5
- data/lib/ruby_wasm/packager/file_system.rb +5 -3
- data/lib/ruby_wasm/packager.rb +22 -82
- data/lib/ruby_wasm/rake_task.rb +1 -0
- data/lib/ruby_wasm/version.rb +1 -1
- data/lib/ruby_wasm.rb +2 -0
- data/package-lock.json +5571 -7015
- data/package.json +3 -3
- data/rakelib/check.rake +23 -10
- data/rakelib/ci.rake +3 -3
- data/rakelib/packaging.rake +44 -15
- data/sig/ruby_wasm/build.rbs +38 -28
- data/sig/ruby_wasm/cli.rbs +27 -3
- data/sig/ruby_wasm/ext.rbs +25 -2
- data/sig/ruby_wasm/feature_set.rbs +12 -0
- data/sig/ruby_wasm/packager.rbs +44 -7
- metadata +9 -10
- data/builders/wasm32-unknown-emscripten/Dockerfile +0 -43
- data/builders/wasm32-unknown-emscripten/entrypoint.sh +0 -7
- data/builders/wasm32-unknown-wasi/Dockerfile +0 -47
- data/builders/wasm32-unknown-wasi/entrypoint.sh +0 -7
@@ -1,43 +0,0 @@
|
|
1
|
-
FROM emscripten/emsdk:3.1.31
|
2
|
-
|
3
|
-
ARG NODE_MAJOR_VERSION=20
|
4
|
-
|
5
|
-
RUN set -eux; \
|
6
|
-
apt-get update; \
|
7
|
-
apt-get install -y ca-certificates curl gnupg; \
|
8
|
-
mkdir -p /etc/apt/keyrings; \
|
9
|
-
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
|
10
|
-
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
|
11
|
-
apt-get update; \
|
12
|
-
apt-get install ruby ruby-dev ruby-bundler nodejs \
|
13
|
-
bison make autoconf git curl build-essential \
|
14
|
-
libyaml-dev zlib1g-dev gosu \
|
15
|
-
libclang-13-dev -y; \
|
16
|
-
apt-get clean; \
|
17
|
-
rm -r /var/lib/apt/lists/*
|
18
|
-
|
19
|
-
# Prefer apt-installed nodejs instead of emsdk's old one.
|
20
|
-
ENV PATH=/usr/bin:$PATH
|
21
|
-
|
22
|
-
ENV RUSTUP_HOME=/usr/local/rustup \
|
23
|
-
CARGO_HOME=/usr/local/cargo \
|
24
|
-
PATH=/usr/local/cargo/bin:$PATH \
|
25
|
-
RUST_VERSION=1.75
|
26
|
-
|
27
|
-
RUN set -eux pipefail; \
|
28
|
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
|
29
|
-
sh -s -- -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \
|
30
|
-
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
|
31
|
-
|
32
|
-
ENV BUNDLE_PATH=/usr/local/gems
|
33
|
-
RUN set -eux; \
|
34
|
-
mkdir -p $BUNDLE_PATH; \
|
35
|
-
chmod -R 777 $BUNDLE_PATH
|
36
|
-
|
37
|
-
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
38
|
-
RUN chmod +x /usr/local/bin/entrypoint.sh
|
39
|
-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
40
|
-
# Build with non-root user because `@npmcli/promise-spawn` sets `uid` and `gid` to cwd owner when the current user is root.
|
41
|
-
# This permission demotion results in EACCES error at reading `$HOME/.node_modules` in `resolve` package, which is used by `@rollup/plugin-node-resolve`.
|
42
|
-
# * https://github.com/npm/cli/blob/32336f6efe06bd52de1dc67c0f812d4705533ef2/node_modules/%40npmcli/promise-spawn/lib/index.js#L13
|
43
|
-
RUN adduser --disabled-password --gecos '' me
|
@@ -1,47 +0,0 @@
|
|
1
|
-
FROM debian:bullseye
|
2
|
-
|
3
|
-
ARG WASI_PRESET_ARGS_VERSION=0.1.1
|
4
|
-
ARG NODE_MAJOR_VERSION=20
|
5
|
-
|
6
|
-
RUN set -eux; \
|
7
|
-
apt-get update; \
|
8
|
-
apt-get install -y ca-certificates curl gnupg; \
|
9
|
-
mkdir -p /etc/apt/keyrings; \
|
10
|
-
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
|
11
|
-
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
|
12
|
-
apt-get update; \
|
13
|
-
apt-get install ruby ruby-dev ruby-bundler nodejs \
|
14
|
-
bison make autoconf git curl build-essential \
|
15
|
-
libyaml-dev zlib1g-dev gosu \
|
16
|
-
libclang-13-dev -y; \
|
17
|
-
apt-get clean; \
|
18
|
-
rm -r /var/lib/apt/lists/*
|
19
|
-
|
20
|
-
RUN set -eux pipefail; \
|
21
|
-
wasi_preset_args_url="https://github.com/kateinoigakukun/wasi-preset-args/releases/download/v${WASI_PRESET_ARGS_VERSION}/wasi-preset-args-x86_64-unknown-linux-gnu.zip"; \
|
22
|
-
curl -LO "$wasi_preset_args_url"; \
|
23
|
-
unzip wasi-preset-args-x86_64-unknown-linux-gnu.zip; \
|
24
|
-
mv wasi-preset-args /usr/local/bin/wasi-preset-args
|
25
|
-
|
26
|
-
ENV RUSTUP_HOME=/usr/local/rustup \
|
27
|
-
CARGO_HOME=/usr/local/cargo \
|
28
|
-
PATH=/usr/local/cargo/bin:$PATH \
|
29
|
-
RUST_VERSION=1.75
|
30
|
-
|
31
|
-
RUN set -eux pipefail; \
|
32
|
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
|
33
|
-
sh -s -- -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \
|
34
|
-
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
|
35
|
-
|
36
|
-
ENV BUNDLE_PATH=/usr/local/gems
|
37
|
-
RUN set -eux; \
|
38
|
-
mkdir -p $BUNDLE_PATH; \
|
39
|
-
chmod -R 777 $BUNDLE_PATH
|
40
|
-
|
41
|
-
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
42
|
-
RUN chmod +x /usr/local/bin/entrypoint.sh
|
43
|
-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
44
|
-
# Build with non-root user because `@npmcli/promise-spawn` sets `uid` and `gid` to cwd owner when the current user is root.
|
45
|
-
# This permission demotion results in EACCES error at reading `$HOME/.node_modules` in `resolve` package, which is used by `@rollup/plugin-node-resolve`.
|
46
|
-
# * https://github.com/npm/cli/blob/32336f6efe06bd52de1dc67c0f812d4705533ef2/node_modules/%40npmcli/promise-spawn/lib/index.js#L13
|
47
|
-
RUN adduser --disabled-password --gecos '' me
|