rbs 4.1.0.pre.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dockerignore +37 -0
- data/.github/workflows/bundle-update.yml +1 -1
- data/.github/workflows/c-check.yml +14 -6
- data/.github/workflows/comments.yml +2 -2
- data/.github/workflows/dependabot.yml +2 -2
- data/.github/workflows/jruby.yml +79 -0
- data/.github/workflows/milestone.yml +13 -2
- data/.github/workflows/ruby.yml +16 -4
- data/.github/workflows/rust.yml +13 -8
- data/.github/workflows/truffleruby.yml +54 -0
- data/.github/workflows/typecheck.yml +5 -2
- data/.github/workflows/wasm.yml +55 -0
- data/.github/workflows/windows.yml +8 -2
- data/.gitignore +8 -0
- data/CHANGELOG.md +88 -0
- data/Dockerfile.jruby +53 -0
- data/README.md +3 -3
- data/Rakefile +103 -1
- data/Steepfile +9 -0
- data/core/array.rbs +243 -180
- data/core/builtin.rbs +6 -6
- data/core/enumerable.rbs +109 -109
- data/core/enumerator/product.rbs +5 -5
- data/core/enumerator.rbs +28 -28
- data/core/file.rbs +24 -1018
- data/core/file_constants.rbs +463 -0
- data/core/file_stat.rbs +534 -0
- data/core/float.rbs +0 -24
- data/core/hash.rbs +117 -101
- data/core/integer.rbs +21 -58
- data/core/io.rbs +25 -7
- data/core/match_data.rbs +1 -1
- data/core/module.rbs +88 -74
- data/core/numeric.rbs +3 -0
- data/core/object_space/weak_key_map.rbs +7 -7
- data/core/pathname.rbs +0 -10
- data/core/ractor.rbs +0 -10
- data/core/range.rbs +23 -23
- data/core/rbs/ops.rbs +154 -0
- data/core/rbs/unnamed/argf.rbs +3 -3
- data/core/rubygems/errors.rbs +4 -1
- data/core/rubygems/requirement.rbs +0 -10
- data/core/rubygems/rubygems.rbs +4 -1
- data/core/rubygems/specification.rbs +8 -0
- data/core/rubygems/version.rbs +0 -160
- data/core/set.rbs +3 -3
- data/core/struct.rbs +16 -16
- data/core/thread.rbs +9 -14
- data/docs/CONTRIBUTING.md +2 -1
- data/docs/inline.md +36 -6
- data/docs/rbs_by_example.md +20 -20
- data/docs/release.md +69 -0
- data/docs/syntax.md +2 -2
- data/docs/wasm_serialization.md +80 -0
- data/ext/rbs_extension/ast_translation.c +1294 -973
- data/ext/rbs_extension/ast_translation.h +4 -0
- data/ext/rbs_extension/legacy_location.c +11 -6
- data/ext/rbs_extension/main.c +139 -4
- data/include/rbs/ast.h +9 -1
- data/include/rbs/serialize.h +39 -0
- data/lib/rbs/ast/ruby/comment_block.rb +6 -4
- data/lib/rbs/ast/ruby/helpers/location_helper.rb +1 -1
- data/lib/rbs/ast/ruby/members.rb +12 -1
- data/lib/rbs/buffer.rb +48 -11
- data/lib/rbs/collection/sources/git.rb +6 -0
- data/lib/rbs/definition_builder/method_builder.rb +12 -6
- data/lib/rbs/environment.rb +4 -3
- data/lib/rbs/inline_parser.rb +5 -3
- data/lib/rbs/namespace.rb +47 -11
- data/lib/rbs/parser_aux.rb +4 -2
- data/lib/rbs/prototype/rbi.rb +193 -25
- data/lib/rbs/prototype/runtime.rb +2 -0
- data/lib/rbs/resolver/type_name_resolver.rb +12 -14
- data/lib/rbs/type_name.rb +33 -13
- data/lib/rbs/unit_test/type_assertions.rb +9 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/wasm/deserializer.rb +213 -0
- data/lib/rbs/wasm/location.rb +61 -0
- data/lib/rbs/wasm/parser.rb +137 -0
- data/lib/rbs/wasm/runtime.rb +196 -0
- data/lib/rbs/wasm/serialization_schema.rb +110 -0
- data/lib/rbs.rb +13 -2
- data/lib/rbs_jars.rb +39 -0
- data/lib/rdoc_plugin/parser.rb +5 -0
- data/rbs.gemspec +32 -2
- data/sig/ast/ruby/members.rbs +6 -1
- data/sig/buffer.rbs +19 -1
- data/sig/namespace.rbs +20 -0
- data/sig/parser.rbs +10 -0
- data/sig/prototype/rbi.rbs +33 -4
- data/sig/resolver/type_name_resolver.rbs +2 -4
- data/sig/typename.rbs +15 -0
- data/sig/unit_test/type_assertions.rbs +4 -0
- data/sig/wasm/deserializer.rbs +66 -0
- data/sig/wasm/serialization_schema.rbs +13 -0
- data/src/ast.c +78 -78
- data/src/lexer.c +97 -93
- data/src/lexer.re +1 -1
- data/src/lexstate.c +9 -1
- data/src/serialize.c +958 -0
- data/src/util/rbs_allocator.c +14 -8
- data/stdlib/abbrev/0/array.rbs +1 -1
- data/stdlib/csv/0/csv.rbs +5 -5
- data/stdlib/delegate/0/delegator.rbs +2 -1
- data/stdlib/digest/0/digest.rbs +11 -5
- data/stdlib/erb/0/erb.rbs +1 -1
- data/stdlib/etc/0/etc.rbs +18 -4
- data/stdlib/fileutils/0/fileutils.rbs +21 -21
- data/stdlib/ipaddr/0/ipaddr.rbs +0 -5
- data/stdlib/json/0/json.rbs +6 -6
- data/stdlib/monitor/0/monitor.rbs +2 -2
- data/stdlib/openssl/0/openssl.rbs +44 -38
- data/stdlib/resolv/0/resolv.rbs +1 -1
- data/stdlib/shellwords/0/shellwords.rbs +1 -1
- data/stdlib/stringio/0/stringio.rbs +32 -10
- data/stdlib/strscan/0/string_scanner.rbs +74 -55
- data/stdlib/tempfile/0/manifest.yaml +3 -0
- data/stdlib/timeout/0/timeout.rbs +0 -5
- data/stdlib/tsort/0/cyclic.rbs +1 -1
- data/stdlib/tsort/0/interfaces.rbs +8 -8
- data/stdlib/tsort/0/tsort.rbs +9 -9
- data/stdlib/uri/0/generic.rbs +0 -5
- data/stdlib/zlib/0/gzip_reader.rbs +2 -2
- data/stdlib/zlib/0/zstream.rbs +0 -1
- data/wasm/README.md +60 -0
- data/wasm/rbs_wasm.c +423 -0
- metadata +26 -5
- data/.vscode/extensions.json +0 -5
- data/.vscode/settings.json +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0cb4ca04de969abdc9d7f58e67fb98a0ce0d39e6669dab1be23241ba08a1b883
|
|
4
|
+
data.tar.gz: c758f606ee5737b64c45fd4da9c99f6522f1a62a0b8a37b4023d37fcb69b6d59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26dbbd5af3941363c80a282d63dfda59d0aba521bea2c75e45c3dd58336a18920d859ef426b0c8bab67535be7e3651f8f2f83a78ed068477dd5ccf8adb09df4c
|
|
7
|
+
data.tar.gz: 0a5c85aa87e7ddb72519953952bb0bec098c8322cd379fb0e5e8dfb6ac0b1a8f4df70ee225cb3361b719d0b506b5d9eff0c43db08ce235d7ac233adb320d9d8a
|
data/.dockerignore
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Keep the build context small. .git is intentionally NOT ignored: rbs.gemspec
|
|
2
|
+
# builds its file list with `git ls-files`.
|
|
3
|
+
#
|
|
4
|
+
# Safe to ignore here: untracked/generated paths, and tracked paths the gemspec
|
|
5
|
+
# already rejects (so `gem build` does not expect them on disk). Do NOT ignore a
|
|
6
|
+
# tracked path the gemspec ships — `gem build` would fail with "... are not
|
|
7
|
+
# files". .vscode/ and benchmark/ are tracked but rejected by the gemspec.
|
|
8
|
+
.vscode/
|
|
9
|
+
benchmark/
|
|
10
|
+
|
|
11
|
+
# Editor / tooling / worktree copies (untracked; each is a full repo clone)
|
|
12
|
+
.claude/
|
|
13
|
+
trees/
|
|
14
|
+
.devcontainer/
|
|
15
|
+
.idea/
|
|
16
|
+
.ruby-lsp/
|
|
17
|
+
.yardoc/
|
|
18
|
+
doc/
|
|
19
|
+
datasets/
|
|
20
|
+
tmp/
|
|
21
|
+
|
|
22
|
+
# Build artifact — rebuilt inside the image by `rake wasm:jruby_setup`
|
|
23
|
+
lib/rbs/wasm/*.wasm
|
|
24
|
+
*.gem
|
|
25
|
+
ext/**/*.o
|
|
26
|
+
ext/**/*.so
|
|
27
|
+
ext/**/*.bundle
|
|
28
|
+
*.log
|
|
29
|
+
|
|
30
|
+
# Local scratch / experiment files
|
|
31
|
+
flamegraph.html
|
|
32
|
+
gc.html
|
|
33
|
+
foo.rbs
|
|
34
|
+
sorted.json
|
|
35
|
+
string.json
|
|
36
|
+
Gemfile-*
|
|
37
|
+
gemfiles/
|
|
@@ -7,11 +7,14 @@ on:
|
|
|
7
7
|
pull_request: {}
|
|
8
8
|
merge_group: {}
|
|
9
9
|
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
10
13
|
jobs:
|
|
11
14
|
format-check:
|
|
12
15
|
runs-on: ubuntu-latest
|
|
13
16
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
17
|
+
- uses: actions/checkout@v7
|
|
15
18
|
- uses: ruby/setup-ruby@v1
|
|
16
19
|
with:
|
|
17
20
|
ruby-version: "4.0"
|
|
@@ -24,8 +27,13 @@ jobs:
|
|
|
24
27
|
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool
|
|
25
28
|
- name: Install clang-format from LLVM
|
|
26
29
|
run: |
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
# The codename must match the `runs-on` image: `ubuntu-latest` is 24.04 (noble).
|
|
31
|
+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key \
|
|
32
|
+
| sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
|
|
33
|
+
# Written directly rather than through `apt-add-repository`, which cannot
|
|
34
|
+
# parse `[signed-by=...]` inside a one-line `deb` shortcut.
|
|
35
|
+
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" \
|
|
36
|
+
| sudo tee /etc/apt/sources.list.d/llvm.list
|
|
29
37
|
sudo apt-get update
|
|
30
38
|
sudo apt-get install -y clang-format-20
|
|
31
39
|
sudo ln -sf /usr/bin/clang-format-20 /usr/local/bin/clang-format
|
|
@@ -35,9 +43,9 @@ jobs:
|
|
|
35
43
|
- name: Install Re2c
|
|
36
44
|
run: |
|
|
37
45
|
cd /tmp
|
|
38
|
-
curl -L https://github.com/skvadrik/re2c/archive/refs/tags/4.
|
|
39
|
-
tar xf re2c-4.
|
|
40
|
-
cd re2c-4.
|
|
46
|
+
curl -L https://github.com/skvadrik/re2c/archive/refs/tags/4.5.1.tar.gz > re2c-4.5.1.tar.gz
|
|
47
|
+
tar xf re2c-4.5.1.tar.gz
|
|
48
|
+
cd re2c-4.5.1
|
|
41
49
|
cmake --preset=linux-gcc-release-ootree-skeleton-fast
|
|
42
50
|
cmake --build --preset=linux-gcc-release-ootree-skeleton-fast --parallel="$(nproc)"
|
|
43
51
|
sudo ln -sf "$(pwd)"/.build/linux-gcc-release-ootree-skeleton-fast/re2c /usr/local/bin/re2c
|
|
@@ -13,10 +13,10 @@ jobs:
|
|
|
13
13
|
# env:
|
|
14
14
|
# RUBY_COMMIT: v4.0.0-preview2
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v7
|
|
17
17
|
- uses: ruby/setup-ruby@v1
|
|
18
18
|
with:
|
|
19
|
-
ruby-version: "4.0.
|
|
19
|
+
ruby-version: "4.0.6"
|
|
20
20
|
bundler: none
|
|
21
21
|
- name: Install dependencies
|
|
22
22
|
run: |
|
|
@@ -14,10 +14,10 @@ jobs:
|
|
|
14
14
|
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
|
|
15
15
|
steps:
|
|
16
16
|
- name: Dependabot metadata
|
|
17
|
-
uses: dependabot/fetch-metadata@
|
|
17
|
+
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
|
|
18
18
|
id: metadata
|
|
19
19
|
- name: Checkout repository
|
|
20
|
-
uses: actions/checkout@
|
|
20
|
+
uses: actions/checkout@v7
|
|
21
21
|
with:
|
|
22
22
|
fetch-depth: 0
|
|
23
23
|
- name: Abort if blocker files are changed
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: JRuby
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
paths:
|
|
9
|
+
- ".github/workflows/jruby.yml"
|
|
10
|
+
- "include/**"
|
|
11
|
+
- "src/**"
|
|
12
|
+
- "wasm/**"
|
|
13
|
+
- "lib/**"
|
|
14
|
+
- "sig/**"
|
|
15
|
+
- "core/**"
|
|
16
|
+
- "stdlib/**"
|
|
17
|
+
- "test/**"
|
|
18
|
+
- "Rakefile"
|
|
19
|
+
- "rbs.gemspec"
|
|
20
|
+
# `merge_group` has no `paths` filter, so this runs on every queue entry.
|
|
21
|
+
merge_group: {}
|
|
22
|
+
|
|
23
|
+
permissions:
|
|
24
|
+
contents: read
|
|
25
|
+
|
|
26
|
+
env:
|
|
27
|
+
# Keep in sync with .github/workflows/wasm.yml.
|
|
28
|
+
WASI_SDK_VERSION: "33"
|
|
29
|
+
WASI_SDK_RELEASE: "33.0"
|
|
30
|
+
|
|
31
|
+
jobs:
|
|
32
|
+
test:
|
|
33
|
+
name: jruby
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v7
|
|
37
|
+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
38
|
+
|
|
39
|
+
# Build the .wasm and fetch the Chicory jars with CRuby + the WASI SDK,
|
|
40
|
+
# then run RBS itself on JRuby against those artifacts.
|
|
41
|
+
- name: Set up Ruby (to assemble the WebAssembly runtime)
|
|
42
|
+
uses: ruby/setup-ruby@v1
|
|
43
|
+
with:
|
|
44
|
+
ruby-version: ruby
|
|
45
|
+
bundler: none
|
|
46
|
+
- name: Update rubygems & bundler
|
|
47
|
+
run: gem update --system
|
|
48
|
+
- name: Install gems
|
|
49
|
+
run: |
|
|
50
|
+
bundle config set --local without libs:profilers
|
|
51
|
+
bundle install --jobs 4 --retry 3
|
|
52
|
+
- name: Install the WASI SDK
|
|
53
|
+
run: |
|
|
54
|
+
url="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_RELEASE}-x86_64-linux.tar.gz"
|
|
55
|
+
mkdir -p "$HOME/wasi-sdk"
|
|
56
|
+
curl -sSL "$url" | tar xz --strip-components=1 -C "$HOME/wasi-sdk"
|
|
57
|
+
echo "WASI_SDK_PATH=$HOME/wasi-sdk" >> "$GITHUB_ENV"
|
|
58
|
+
- name: Build rbs_parser.wasm
|
|
59
|
+
run: bundle exec rake wasm:jruby_setup
|
|
60
|
+
|
|
61
|
+
- name: Set up JRuby
|
|
62
|
+
uses: ruby/setup-ruby@v1
|
|
63
|
+
with:
|
|
64
|
+
ruby-version: jruby
|
|
65
|
+
bundler: none
|
|
66
|
+
- name: Install runtime and test gems
|
|
67
|
+
# rdoc 8.0.0 added a runtime dependency on rbs, which pulls the released
|
|
68
|
+
# C-extension rbs gem and fails to build on JRuby. Pin rdoc below 8 until
|
|
69
|
+
# a -java rbs gem is published.
|
|
70
|
+
run: |
|
|
71
|
+
gem install prism rake rake-compiler test-unit rspec minitest json-schema pry --no-document
|
|
72
|
+
gem install rdoc -v "< 8" --no-document
|
|
73
|
+
# jar-dependencies resolves through the JVM, so download the Chicory/ASM
|
|
74
|
+
# jars into ~/.m2 here on JRuby (jar-dependencies is not available in the
|
|
75
|
+
# CRuby step above).
|
|
76
|
+
- name: Download the Chicory and ASM jars
|
|
77
|
+
run: jruby -S rake wasm:install_jars
|
|
78
|
+
- name: Run the test suite on JRuby
|
|
79
|
+
run: jruby -S rake test
|
|
@@ -3,16 +3,26 @@ name: Check milestone
|
|
|
3
3
|
on:
|
|
4
4
|
pull_request:
|
|
5
5
|
types: [opened, edited, labeled, unlabeled, milestoned, demilestoned, synchronize]
|
|
6
|
+
merge_group: {}
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
6
10
|
|
|
7
11
|
jobs:
|
|
8
12
|
check:
|
|
9
13
|
runs-on: ubuntu-latest
|
|
10
14
|
|
|
11
15
|
steps:
|
|
12
|
-
|
|
16
|
+
# The milestone is a property of the pull request, so there is nothing to
|
|
17
|
+
# check once it enters the merge queue. This job still has to run there
|
|
18
|
+
# because `check` is a required status check -- it just reports success
|
|
19
|
+
# without doing anything.
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
|
+
if: github.event_name == 'pull_request'
|
|
13
22
|
|
|
14
23
|
- name: Extract RBS::Version
|
|
15
24
|
id: version
|
|
25
|
+
if: github.event_name == 'pull_request'
|
|
16
26
|
run: |
|
|
17
27
|
# Extract version string from lib/rbs/version.rb
|
|
18
28
|
version=$(ruby -e 'load "lib/rbs/version.rb"; print RBS::VERSION')
|
|
@@ -27,7 +37,8 @@ jobs:
|
|
|
27
37
|
echo "RBS::VERSION = $version (major=$major, minor=$minor, patch=$patch)"
|
|
28
38
|
|
|
29
39
|
- name: Check milestone
|
|
30
|
-
|
|
40
|
+
if: github.event_name == 'pull_request'
|
|
41
|
+
uses: actions/github-script@v9
|
|
31
42
|
with:
|
|
32
43
|
script: |
|
|
33
44
|
const pr = context.payload.pull_request;
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -7,13 +7,16 @@ on:
|
|
|
7
7
|
pull_request: {}
|
|
8
8
|
merge_group: {}
|
|
9
9
|
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
10
13
|
jobs:
|
|
11
14
|
test:
|
|
12
15
|
runs-on: "ubuntu-latest"
|
|
13
16
|
strategy:
|
|
14
17
|
fail-fast: false
|
|
15
18
|
matrix:
|
|
16
|
-
ruby: ['3.
|
|
19
|
+
ruby: ['3.3', '3.4', '4.0', head]
|
|
17
20
|
rubyopt: [""]
|
|
18
21
|
job:
|
|
19
22
|
- test
|
|
@@ -37,7 +40,7 @@ jobs:
|
|
|
37
40
|
env:
|
|
38
41
|
RANDOMIZE_STDLIB_TEST_ORDER: "true"
|
|
39
42
|
steps:
|
|
40
|
-
- uses: actions/checkout@
|
|
43
|
+
- uses: actions/checkout@v7
|
|
41
44
|
- uses: ruby/setup-ruby@v1
|
|
42
45
|
with:
|
|
43
46
|
ruby-version: ${{ matrix.ruby }}
|
|
@@ -63,6 +66,9 @@ jobs:
|
|
|
63
66
|
if: ${{ contains(matrix.ruby, 'head') }}
|
|
64
67
|
run: |
|
|
65
68
|
bundle config set force_ruby_platform true
|
|
69
|
+
- name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head
|
|
70
|
+
if: ${{ contains(matrix.ruby, 'head') }}
|
|
71
|
+
run: bundle config set --local version system
|
|
66
72
|
- name: Skip installing type checkers
|
|
67
73
|
if: ${{ ! contains(matrix.job, 'typecheck_test') }}
|
|
68
74
|
run: |
|
|
@@ -84,7 +90,7 @@ jobs:
|
|
|
84
90
|
matrix:
|
|
85
91
|
ruby: ['4.0', head]
|
|
86
92
|
steps:
|
|
87
|
-
- uses: actions/checkout@
|
|
93
|
+
- uses: actions/checkout@v7
|
|
88
94
|
- name: Install dependencies
|
|
89
95
|
run: |
|
|
90
96
|
brew install ruby-build
|
|
@@ -106,6 +112,9 @@ jobs:
|
|
|
106
112
|
if: ${{ contains(matrix.ruby, 'head') }}
|
|
107
113
|
run: |
|
|
108
114
|
bundle config set force_ruby_platform true
|
|
115
|
+
- name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head
|
|
116
|
+
if: ${{ contains(matrix.ruby, 'head') }}
|
|
117
|
+
run: bundle config set --local version system
|
|
109
118
|
- name: bin/setup
|
|
110
119
|
run: |
|
|
111
120
|
bin/setup
|
|
@@ -118,7 +127,7 @@ jobs:
|
|
|
118
127
|
matrix:
|
|
119
128
|
ruby: ['4.0', head]
|
|
120
129
|
steps:
|
|
121
|
-
- uses: actions/checkout@
|
|
130
|
+
- uses: actions/checkout@v7
|
|
122
131
|
- name: Install dependencies
|
|
123
132
|
run: |
|
|
124
133
|
brew install ruby-build
|
|
@@ -140,6 +149,9 @@ jobs:
|
|
|
140
149
|
if: ${{ contains(matrix.ruby, 'head') }}
|
|
141
150
|
run: |
|
|
142
151
|
bundle config set force_ruby_platform true
|
|
152
|
+
- name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head
|
|
153
|
+
if: ${{ contains(matrix.ruby, 'head') }}
|
|
154
|
+
run: bundle config set --local version system
|
|
143
155
|
- name: bin/setup
|
|
144
156
|
run: |
|
|
145
157
|
bin/setup
|
data/.github/workflows/rust.yml
CHANGED
|
@@ -8,10 +8,15 @@ on:
|
|
|
8
8
|
paths:
|
|
9
9
|
- ".github/workflows/rust.yml"
|
|
10
10
|
- "rust/**"
|
|
11
|
+
# `merge_group` has no `paths` filter, so this runs on every queue entry.
|
|
12
|
+
merge_group: {}
|
|
11
13
|
|
|
12
14
|
env:
|
|
13
15
|
RUSTFLAGS: "-D warnings"
|
|
14
16
|
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
15
20
|
jobs:
|
|
16
21
|
test:
|
|
17
22
|
name: cargo:test
|
|
@@ -21,7 +26,7 @@ jobs:
|
|
|
21
26
|
matrix:
|
|
22
27
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
23
28
|
steps:
|
|
24
|
-
- uses: actions/checkout@
|
|
29
|
+
- uses: actions/checkout@v7
|
|
25
30
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
26
31
|
- name: Set up Ruby
|
|
27
32
|
uses: ruby/setup-ruby@v1
|
|
@@ -40,7 +45,7 @@ jobs:
|
|
|
40
45
|
run: |
|
|
41
46
|
rustup update --no-self-update stable
|
|
42
47
|
rustup default stable
|
|
43
|
-
- uses: actions/cache@
|
|
48
|
+
- uses: actions/cache@v6
|
|
44
49
|
with:
|
|
45
50
|
path: |
|
|
46
51
|
~/.cargo/registry
|
|
@@ -59,7 +64,7 @@ jobs:
|
|
|
59
64
|
runs-on: ubuntu-latest
|
|
60
65
|
continue-on-error: true
|
|
61
66
|
steps:
|
|
62
|
-
- uses: actions/checkout@
|
|
67
|
+
- uses: actions/checkout@v7
|
|
63
68
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
64
69
|
- name: Set up git identity
|
|
65
70
|
run: |
|
|
@@ -82,7 +87,7 @@ jobs:
|
|
|
82
87
|
run: |
|
|
83
88
|
rustup update --no-self-update stable
|
|
84
89
|
rustup default stable
|
|
85
|
-
- uses: actions/cache@
|
|
90
|
+
- uses: actions/cache@v6
|
|
86
91
|
with:
|
|
87
92
|
path: |
|
|
88
93
|
~/.cargo/registry
|
|
@@ -101,7 +106,7 @@ jobs:
|
|
|
101
106
|
runs-on: ubuntu-latest
|
|
102
107
|
continue-on-error: true
|
|
103
108
|
steps:
|
|
104
|
-
- uses: actions/checkout@
|
|
109
|
+
- uses: actions/checkout@v7
|
|
105
110
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
106
111
|
- name: Set up git identity
|
|
107
112
|
run: |
|
|
@@ -124,7 +129,7 @@ jobs:
|
|
|
124
129
|
run: |
|
|
125
130
|
rustup update --no-self-update stable
|
|
126
131
|
rustup default stable
|
|
127
|
-
- uses: actions/cache@
|
|
132
|
+
- uses: actions/cache@v6
|
|
128
133
|
with:
|
|
129
134
|
path: |
|
|
130
135
|
~/.cargo/registry
|
|
@@ -142,7 +147,7 @@ jobs:
|
|
|
142
147
|
name: cargo:lint
|
|
143
148
|
runs-on: ubuntu-latest
|
|
144
149
|
steps:
|
|
145
|
-
- uses: actions/checkout@
|
|
150
|
+
- uses: actions/checkout@v7
|
|
146
151
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
147
152
|
- name: Set up Ruby
|
|
148
153
|
uses: ruby/setup-ruby@v1
|
|
@@ -162,7 +167,7 @@ jobs:
|
|
|
162
167
|
rustup update --no-self-update stable
|
|
163
168
|
rustup default stable
|
|
164
169
|
rustup component add --toolchain stable clippy rustfmt
|
|
165
|
-
- uses: actions/cache@
|
|
170
|
+
- uses: actions/cache@v6
|
|
166
171
|
with:
|
|
167
172
|
path: |
|
|
168
173
|
~/.cargo/registry
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: TruffleRuby
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request: {}
|
|
8
|
+
merge_group: {}
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: "ubuntu-latest"
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
ruby: ['truffleruby']
|
|
20
|
+
job:
|
|
21
|
+
- test
|
|
22
|
+
env:
|
|
23
|
+
RANDOMIZE_STDLIB_TEST_ORDER: "true"
|
|
24
|
+
# TruffleRuby warns and falls back to US-ASCII unless the locale is UTF-8.
|
|
25
|
+
LANG: "en_US.UTF-8"
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v7
|
|
28
|
+
- uses: ruby/setup-ruby@v1
|
|
29
|
+
with:
|
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
|
31
|
+
bundler: none
|
|
32
|
+
- name: Set working directory as safe
|
|
33
|
+
run: git config --global --add safe.directory $(pwd)
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: |
|
|
36
|
+
sudo apt-get update
|
|
37
|
+
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3
|
|
38
|
+
- name: Update rubygems & bundler
|
|
39
|
+
run: |
|
|
40
|
+
ruby -v
|
|
41
|
+
gem update --system
|
|
42
|
+
- name: install erb
|
|
43
|
+
run: gem install erb
|
|
44
|
+
- name: bundle config
|
|
45
|
+
run: |
|
|
46
|
+
# Profilers and the typecheck tooling are not needed for the smoke test,
|
|
47
|
+
# and some of them do not support TruffleRuby.
|
|
48
|
+
bundle config set --local without 'profilers typecheck_test'
|
|
49
|
+
- name: bin/setup
|
|
50
|
+
run: |
|
|
51
|
+
bin/setup
|
|
52
|
+
- name: Run test
|
|
53
|
+
run: |
|
|
54
|
+
bundle exec rake ${{ matrix.job }}
|
|
@@ -7,16 +7,19 @@ on:
|
|
|
7
7
|
pull_request: {}
|
|
8
8
|
merge_group: {}
|
|
9
9
|
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
10
13
|
jobs:
|
|
11
14
|
steep:
|
|
12
15
|
runs-on: "ubuntu-latest"
|
|
13
16
|
strategy:
|
|
14
17
|
fail-fast: false
|
|
15
18
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v7
|
|
17
20
|
- uses: ruby/setup-ruby@v1
|
|
18
21
|
with:
|
|
19
|
-
ruby-version: "
|
|
22
|
+
ruby-version: "4.0"
|
|
20
23
|
bundler: none
|
|
21
24
|
- name: Set working directory as safe
|
|
22
25
|
run: git config --global --add safe.directory $(pwd)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: WebAssembly
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
paths:
|
|
9
|
+
- ".github/workflows/wasm.yml"
|
|
10
|
+
- "Rakefile"
|
|
11
|
+
- "include/**"
|
|
12
|
+
- "src/**"
|
|
13
|
+
- "wasm/**"
|
|
14
|
+
# `merge_group` has no `paths` filter, so this runs on every queue entry.
|
|
15
|
+
merge_group: {}
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
env:
|
|
21
|
+
# Pinned so the smoke test is reproducible. Bump together when upgrading.
|
|
22
|
+
WASI_SDK_VERSION: "33"
|
|
23
|
+
WASI_SDK_RELEASE: "33.0"
|
|
24
|
+
WASMTIME_VERSION: "v47.0.2"
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
build:
|
|
28
|
+
name: wasm:check
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v7
|
|
32
|
+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
33
|
+
- name: Set up Ruby
|
|
34
|
+
uses: ruby/setup-ruby@v1
|
|
35
|
+
with:
|
|
36
|
+
ruby-version: ruby
|
|
37
|
+
bundler: none
|
|
38
|
+
- name: Update rubygems & bundler
|
|
39
|
+
run: gem update --system
|
|
40
|
+
- name: Install gems
|
|
41
|
+
run: |
|
|
42
|
+
bundle config set --local without libs:profilers
|
|
43
|
+
bundle install --jobs 4 --retry 3
|
|
44
|
+
- name: Install the WASI SDK
|
|
45
|
+
run: |
|
|
46
|
+
url="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_RELEASE}-x86_64-linux.tar.gz"
|
|
47
|
+
mkdir -p "$HOME/wasi-sdk"
|
|
48
|
+
curl -sSL "$url" | tar xz --strip-components=1 -C "$HOME/wasi-sdk"
|
|
49
|
+
echo "WASI_SDK_PATH=$HOME/wasi-sdk" >> "$GITHUB_ENV"
|
|
50
|
+
- name: Install wasmtime
|
|
51
|
+
uses: bytecodealliance/actions/wasmtime/setup@v1
|
|
52
|
+
with:
|
|
53
|
+
version: ${{ env.WASMTIME_VERSION }}
|
|
54
|
+
- name: Build and smoke-test the WebAssembly module
|
|
55
|
+
run: bundle exec rake wasm:check
|
|
@@ -7,15 +7,18 @@ on:
|
|
|
7
7
|
pull_request: {}
|
|
8
8
|
merge_group: {}
|
|
9
9
|
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
10
13
|
jobs:
|
|
11
14
|
compile:
|
|
12
15
|
runs-on: "windows-latest"
|
|
13
16
|
strategy:
|
|
14
17
|
fail-fast: false
|
|
15
18
|
matrix:
|
|
16
|
-
ruby: ['
|
|
19
|
+
ruby: ['4.0', ucrt, mswin]
|
|
17
20
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
21
|
+
- uses: actions/checkout@v7
|
|
19
22
|
- name: load ruby
|
|
20
23
|
uses: ruby/setup-ruby@v1
|
|
21
24
|
with:
|
|
@@ -35,6 +38,9 @@ jobs:
|
|
|
35
38
|
bundled_gems = JSON.parse(res)["gems"].map{_1["gem"]}
|
|
36
39
|
system "gem uninstall #{bundled_gems.join(" ")} --force", exception: true
|
|
37
40
|
'
|
|
41
|
+
- name: Ignore Gemfile.lock's BUNDLED WITH on dev Ruby
|
|
42
|
+
if: ${{ matrix.ruby == 'ucrt' || matrix.ruby == 'mswin' }}
|
|
43
|
+
run: bundle config set --local version system
|
|
38
44
|
- name: bundle install
|
|
39
45
|
run: |
|
|
40
46
|
bundle config set without profilers libs
|
data/.gitignore
CHANGED
|
@@ -29,3 +29,11 @@ ext/rbs_extension/.cache
|
|
|
29
29
|
# Rust crate vendored RBS source (managed by rake rust:rbs:sync or rust:rbs:symlink)
|
|
30
30
|
rust/ruby-rbs-sys/vendor/rbs/
|
|
31
31
|
rust/ruby-rbs/vendor/rbs/
|
|
32
|
+
|
|
33
|
+
# Compiled WebAssembly module (built by rake wasm:build)
|
|
34
|
+
wasm/*.wasm
|
|
35
|
+
|
|
36
|
+
# JRuby runtime artifact (built by rake wasm:jruby_setup, bundled in the -java
|
|
37
|
+
# gem). The require_jar file lib/rbs_jars.rb is committed; the Chicory/ASM jars
|
|
38
|
+
# themselves live in ~/.m2 (jar-dependencies), not here.
|
|
39
|
+
lib/rbs/wasm/*.wasm
|