Skip to content
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

Support RubyGems / Bundler #358

Merged
merged 44 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
647b2eb
Initial RubyGems/Bundler support
kateinoigakukun Dec 6, 2023
9fdc2a5
Remove experimental binary-editing approach
kateinoigakukun Jan 2, 2024
9ad2242
Skip build of extensions of default gems
kateinoigakukun Jan 2, 2024
d1ef66a
Add `--target` option to rbwasm build command
kateinoigakukun Jan 2, 2024
82cd043
Add `--remake` option to rbwasm build command
kateinoigakukun Jan 2, 2024
339e91b
Repair crossruby build from rake
kateinoigakukun Jan 2, 2024
1ad13f9
Use rbwasm build for npm package instead of rake build system
kateinoigakukun Jan 2, 2024
bf32ca9
Explicitly specify Gemfile for webrick
kateinoigakukun Jan 2, 2024
a03a243
Print CLI help to stderr
kateinoigakukun Jan 2, 2024
779ec3c
Migrate all rake tasks to use rbwasm build
kateinoigakukun Jan 2, 2024
eecb8ab
Fix tasks/ci.rake for build source aliases
kateinoigakukun Jan 2, 2024
ed134ad
rake format
kateinoigakukun Jan 2, 2024
f4fd002
Fix `rake ci:*` tasks
kateinoigakukun Jan 3, 2024
5be8b84
Write to logger instead of stderr directly
kateinoigakukun Jan 3, 2024
8695087
Defer loading of ruby_wasm.so until it is needed
kateinoigakukun Jan 3, 2024
20b769f
Set the build directory for the toolchain
kateinoigakukun Jan 3, 2024
a9e0a08
`rake compile` before build
kateinoigakukun Jan 3, 2024
56aa83a
Fix `rake check:type`
kateinoigakukun Jan 3, 2024
c166dfa
Add error message when gem compilation is skipped
kateinoigakukun Jan 3, 2024
d7b7c65
rake in bundle exec
kateinoigakukun Jan 3, 2024
4e1dd12
Remove local path from Cargo.toml
kateinoigakukun Jan 3, 2024
2a80008
Fix paths to .wit files in check.rake
kateinoigakukun Jan 3, 2024
a9623e2
Install ruby-bundler package in builder
kateinoigakukun Jan 3, 2024
acf5e12
Pin ruby/ruby master version
kateinoigakukun Jan 3, 2024
ad90910
Build ext library on builder container
kateinoigakukun Jan 3, 2024
2b3e757
Remove required_ruby_version from js.gemspec to allow host Ruby to in…
kateinoigakukun Jan 3, 2024
9a58a85
Remove ruby-wasm-wasi from the list of packages to test
kateinoigakukun Jan 3, 2024
fbe64ab
Fix packaging task for standalone packages
kateinoigakukun Jan 3, 2024
3cc776c
Prefer apt-installed nodejs instead of emsdk's old one.
kateinoigakukun Jan 3, 2024
1c56f89
`bundle install` on host machine before running test
kateinoigakukun Jan 3, 2024
7042418
Trigger build of ruby for emscripten in npm package
kateinoigakukun Jan 3, 2024
4421643
Restore build:*:remake, reconfigure, and clean tasks
kateinoigakukun Jan 3, 2024
07fe183
Install ruby before testing to allow host to use Ruby and Bundler
kateinoigakukun Jan 3, 2024
eef3f6b
Exclude stack-size option from ldflags when building for emscripten
kateinoigakukun Jan 3, 2024
989ef45
Exclude -g flags for Emscripten build
kateinoigakukun Jan 3, 2024
60391fa
Add --reconfigure and --clean options to CLI
kateinoigakukun Jan 3, 2024
21fd9af
rake format
kateinoigakukun Jan 3, 2024
9d8c66d
Remove stub wit-bindgen-ruby for now
kateinoigakukun Jan 3, 2024
2bdc25a
Pack fs only when target is wasi
kateinoigakukun Jan 3, 2024
09b4087
Move `rbwasm build` invocation to rake task
kateinoigakukun Jan 3, 2024
cf92cd9
Setup ruby to build ci matrix
kateinoigakukun Jan 3, 2024
53b5862
rake format
kateinoigakukun Jan 3, 2024
ad53e0c
Revert adding ruby tarball to gem package
kateinoigakukun Jan 3, 2024
7d551b0
Fix npm package build
kateinoigakukun Jan 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ jobs:
entries: ${{ steps.set-matrix.outputs.entries }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- run: rake ci:pin_build_manifest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -112,18 +116,33 @@ jobs:
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- run: ./bin/setup
- name: Setup builder container
run: |
docker run -dit -v "$GITHUB_WORKSPACE:/home/me/build" -w /home/me/build \
-e "ENABLE_GITHUB_ACTIONS_MARKUP=true" \
-e "RUBYWASM_UID=$(id -u)" -e "RUBYWASM_GID=$(id -g)" \
-e "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" \
--name builder \
${{ steps.builder-image.outputs.imageid }} /bin/sh
echo 'docker exec -u me builder "$@"' > ./build-exec
chmod +x ./build-exec
- run: ./build-exec bundle config set --local without check
- run: ./build-exec ./bin/setup
- run: ./build-exec bundle exec rake compile
- name: Pre-release configuration
run: rake ${{ matrix.entry.prerelease }}[${{ inputs.prerel_name }}]
run: ./build-exec bundle exec rake ${{ matrix.entry.prerelease }}[${{ inputs.prerel_name }}]
if: ${{ inputs.prerel_name != '' && matrix.entry.prerelease != '' }}
- name: rake ${{ matrix.entry.task }}
run: docker run -v "$GITHUB_WORKSPACE:/home/me/build" -w /home/me/build -e "ENABLE_GITHUB_ACTIONS_MARKUP=true" -e "RUBYWASM_UID=$(id -u)" -e "RUBYWASM_GID=$(id -g)" -e "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" ${{ steps.builder-image.outputs.imageid }} rake --verbose ${{ matrix.entry.task }}
run: ./build-exec rake --verbose ${{ matrix.entry.task }}
- uses: ruby/setup-ruby@v1
if: ${{ matrix.entry.test != '' }}
with:
ruby-version: "3.2"
bundler-cache: false
- name: rake ${{ matrix.entry.test }}
run: rake ${{ matrix.entry.test }}
run: |
bundle install --with=check --without=development
rake ${{ matrix.entry.test }}
if: ${{ matrix.entry.test != '' }}
- uses: actions/upload-artifact@v4
if: ${{ matrix.entry.artifact }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ dist
/build
/rubies
/release
/tmp
/target
/Gemfile.lock
/lib/ruby_wasm/ruby_wasm.so

.cache
compile_commands.json

html

build_manifest.json

vendor/bundle
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ To select a build profile, see [profiles section in README](https://github.com/r

```console
# Build only a specific combination of ruby version, profile, and target
$ rake build:head-wasm32-unknown-wasi-full-js
$ rake build:head-wasm32-unknown-wasi-full
# Clean up the build directory
$ rake build:head-wasm32-unknown-wasi-full-js:clean
$ rake build:head-wasm32-unknown-wasi-full:clean
# Force to re-execute "make install"
$ rake build:head-wasm32-unknown-wasi-full-js:remake
$ rake build:head-wasm32-unknown-wasi-full:remake

# Output is in the `rubies` directory
$ tree -L 3 rubies/head-wasm32-unknown-wasi-full-js
Expand Down
Loading