rbs 4.0.3 → 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.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +37 -0
  3. data/.github/workflows/bundle-update.yml +1 -1
  4. data/.github/workflows/c-check.yml +14 -6
  5. data/.github/workflows/comments.yml +2 -2
  6. data/.github/workflows/dependabot.yml +2 -2
  7. data/.github/workflows/jruby.yml +79 -0
  8. data/.github/workflows/milestone.yml +13 -2
  9. data/.github/workflows/ruby.yml +43 -3
  10. data/.github/workflows/rust.yml +13 -10
  11. data/.github/workflows/truffleruby.yml +54 -0
  12. data/.github/workflows/typecheck.yml +5 -2
  13. data/.github/workflows/wasm.yml +55 -0
  14. data/.github/workflows/windows.yml +5 -2
  15. data/.gitignore +8 -0
  16. data/CHANGELOG.md +84 -4
  17. data/Dockerfile.jruby +53 -0
  18. data/README.md +3 -3
  19. data/Rakefile +105 -3
  20. data/Steepfile +9 -0
  21. data/config.yml +24 -0
  22. data/core/array.rbs +243 -180
  23. data/core/builtin.rbs +7 -6
  24. data/core/class.rbs +5 -3
  25. data/core/enumerable.rbs +109 -109
  26. data/core/enumerator/product.rbs +5 -5
  27. data/core/enumerator.rbs +28 -28
  28. data/core/file.rbs +24 -1018
  29. data/core/file_constants.rbs +463 -0
  30. data/core/file_stat.rbs +534 -0
  31. data/core/float.rbs +0 -24
  32. data/core/hash.rbs +117 -101
  33. data/core/integer.rbs +21 -58
  34. data/core/io.rbs +25 -7
  35. data/core/kernel.rbs +26 -11
  36. data/core/match_data.rbs +1 -1
  37. data/core/module.rbs +88 -74
  38. data/core/numeric.rbs +3 -0
  39. data/core/object_space/weak_key_map.rbs +7 -7
  40. data/core/pathname.rbs +0 -10
  41. data/core/ractor.rbs +0 -10
  42. data/core/range.rbs +23 -23
  43. data/core/rbs/ops.rbs +154 -0
  44. data/core/rbs/unnamed/argf.rbs +3 -3
  45. data/core/ruby_vm.rbs +40 -0
  46. data/core/rubygems/errors.rbs +4 -1
  47. data/core/rubygems/requirement.rbs +0 -10
  48. data/core/rubygems/rubygems.rbs +4 -1
  49. data/core/rubygems/specification.rbs +8 -0
  50. data/core/rubygems/version.rbs +0 -160
  51. data/core/set.rbs +3 -3
  52. data/core/struct.rbs +16 -16
  53. data/core/thread.rbs +9 -14
  54. data/docs/CONTRIBUTING.md +2 -1
  55. data/docs/inline.md +65 -7
  56. data/docs/rbs_by_example.md +20 -20
  57. data/docs/release.md +69 -0
  58. data/docs/syntax.md +2 -2
  59. data/docs/wasm_serialization.md +80 -0
  60. data/ext/rbs_extension/ast_translation.c +1298 -956
  61. data/ext/rbs_extension/ast_translation.h +4 -0
  62. data/ext/rbs_extension/class_constants.c +2 -0
  63. data/ext/rbs_extension/class_constants.h +1 -0
  64. data/ext/rbs_extension/extconf.rb +1 -0
  65. data/ext/rbs_extension/legacy_location.c +11 -6
  66. data/ext/rbs_extension/main.c +139 -4
  67. data/include/rbs/ast.h +323 -298
  68. data/include/rbs/defines.h +13 -0
  69. data/include/rbs/lexer.h +1 -0
  70. data/include/rbs/serialize.h +39 -0
  71. data/lib/rbs/annotate/rdoc_annotator.rb +27 -31
  72. data/lib/rbs/ast/ruby/annotations.rb +42 -0
  73. data/lib/rbs/ast/ruby/comment_block.rb +6 -4
  74. data/lib/rbs/ast/ruby/declarations.rb +11 -1
  75. data/lib/rbs/ast/ruby/helpers/location_helper.rb +1 -1
  76. data/lib/rbs/ast/ruby/members.rb +40 -1
  77. data/lib/rbs/buffer.rb +48 -11
  78. data/lib/rbs/cli.rb +3 -5
  79. data/lib/rbs/collection/config/lockfile_generator.rb +14 -1
  80. data/lib/rbs/collection/sources/git.rb +6 -0
  81. data/lib/rbs/definition_builder/method_builder.rb +12 -6
  82. data/lib/rbs/environment.rb +10 -3
  83. data/lib/rbs/inline_parser.rb +54 -28
  84. data/lib/rbs/namespace.rb +47 -11
  85. data/lib/rbs/parser_aux.rb +4 -2
  86. data/lib/rbs/prototype/rbi.rb +193 -25
  87. data/lib/rbs/prototype/runtime.rb +2 -0
  88. data/lib/rbs/resolver/type_name_resolver.rb +12 -14
  89. data/lib/rbs/rewriter.rb +70 -0
  90. data/lib/rbs/test/type_check.rb +6 -1
  91. data/lib/rbs/type_name.rb +33 -13
  92. data/lib/rbs/unit_test/type_assertions.rb +9 -0
  93. data/lib/rbs/version.rb +1 -1
  94. data/lib/rbs/wasm/deserializer.rb +213 -0
  95. data/lib/rbs/wasm/location.rb +61 -0
  96. data/lib/rbs/wasm/parser.rb +137 -0
  97. data/lib/rbs/wasm/runtime.rb +196 -0
  98. data/lib/rbs/wasm/serialization_schema.rb +110 -0
  99. data/lib/rbs.rb +14 -2
  100. data/lib/rbs_jars.rb +39 -0
  101. data/lib/rdoc_plugin/parser.rb +5 -0
  102. data/rbs.gemspec +32 -2
  103. data/sig/annotate/rdoc_annotater.rbs +12 -9
  104. data/sig/ast/ruby/annotations.rbs +49 -0
  105. data/sig/ast/ruby/members.rbs +21 -1
  106. data/sig/buffer.rbs +19 -1
  107. data/sig/collection/config/lockfile_generator.rbs +2 -0
  108. data/sig/inline_parser.rbs +2 -0
  109. data/sig/manifest.yaml +0 -1
  110. data/sig/namespace.rbs +20 -0
  111. data/sig/parser.rbs +10 -0
  112. data/sig/prototype/rbi.rbs +33 -4
  113. data/sig/resolver/type_name_resolver.rbs +2 -4
  114. data/sig/rewriter.rbs +45 -0
  115. data/sig/typename.rbs +15 -0
  116. data/sig/unit_test/type_assertions.rbs +4 -0
  117. data/sig/wasm/deserializer.rbs +66 -0
  118. data/sig/wasm/serialization_schema.rbs +13 -0
  119. data/src/ast.c +186 -162
  120. data/src/lexer.c +220 -193
  121. data/src/lexer.re +2 -1
  122. data/src/lexstate.c +10 -1
  123. data/src/parser.c +55 -5
  124. data/src/serialize.c +958 -0
  125. data/src/util/rbs_allocator.c +14 -8
  126. data/stdlib/abbrev/0/array.rbs +1 -1
  127. data/stdlib/csv/0/csv.rbs +5 -5
  128. data/stdlib/delegate/0/delegator.rbs +2 -1
  129. data/stdlib/digest/0/digest.rbs +11 -5
  130. data/stdlib/erb/0/erb.rbs +1 -1
  131. data/stdlib/etc/0/etc.rbs +18 -4
  132. data/stdlib/fileutils/0/fileutils.rbs +21 -21
  133. data/stdlib/ipaddr/0/ipaddr.rbs +0 -5
  134. data/stdlib/json/0/json.rbs +6 -6
  135. data/stdlib/monitor/0/monitor.rbs +2 -2
  136. data/stdlib/openssl/0/openssl.rbs +46 -40
  137. data/stdlib/resolv/0/resolv.rbs +1 -1
  138. data/stdlib/shellwords/0/shellwords.rbs +1 -1
  139. data/stdlib/stringio/0/stringio.rbs +32 -10
  140. data/stdlib/strscan/0/string_scanner.rbs +74 -55
  141. data/stdlib/tempfile/0/manifest.yaml +3 -0
  142. data/stdlib/timeout/0/timeout.rbs +0 -5
  143. data/stdlib/tsort/0/cyclic.rbs +1 -1
  144. data/stdlib/tsort/0/interfaces.rbs +8 -8
  145. data/stdlib/tsort/0/tsort.rbs +9 -9
  146. data/stdlib/uri/0/generic.rbs +0 -5
  147. data/stdlib/zlib/0/gzip_reader.rbs +2 -2
  148. data/stdlib/zlib/0/zstream.rbs +0 -1
  149. data/wasm/README.md +60 -0
  150. data/wasm/rbs_wasm.c +423 -0
  151. metadata +28 -5
  152. data/.vscode/extensions.json +0 -5
  153. data/.vscode/settings.json +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77f310d0293781c4da3d3835ee34be5b310dc4aace7b75db580060432f5dd10c
4
- data.tar.gz: 8d982db360beced794afa05c156c40db8b368f7b2d0b0180ad61434d3c1eb0a9
3
+ metadata.gz: 0cb4ca04de969abdc9d7f58e67fb98a0ce0d39e6669dab1be23241ba08a1b883
4
+ data.tar.gz: c758f606ee5737b64c45fd4da9c99f6522f1a62a0b8a37b4023d37fcb69b6d59
5
5
  SHA512:
6
- metadata.gz: 87d0a52295c6167fb791c2ff843dee5a9b7c1d4cc9d13fe5ccf8c12abcc7ed507497021e691dd0cd1a134ff886c9ba29461f03f2a26fc3402af1c78bc36ec62f
7
- data.tar.gz: 40381f1988f06a3262de9367042ad0e04864f7c9f0a1556f30dc01003874db8018a77b10c613e090993738d3787861ccb84417631a4cc57c3998ca99c831eb8b
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/
@@ -11,7 +11,7 @@ jobs:
11
11
 
12
12
  steps:
13
13
  - name: Checkout repository
14
- uses: actions/checkout@v6
14
+ uses: actions/checkout@v7
15
15
 
16
16
  - name: Set up Ruby
17
17
  uses: ruby/setup-ruby@v1
@@ -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@v6
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
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
28
- sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main"
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.3.tar.gz > re2c-4.3.tar.gz
39
- tar xf re2c-4.3.tar.gz
40
- cd re2c-4.3
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@v6
16
+ - uses: actions/checkout@v7
17
17
  - uses: ruby/setup-ruby@v1
18
18
  with:
19
- ruby-version: "4.0.1"
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@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36 # v3.0.0
17
+ uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
18
18
  id: metadata
19
19
  - name: Checkout repository
20
- uses: actions/checkout@v6
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
- - uses: actions/checkout@v6
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
- uses: actions/github-script@v8
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;
@@ -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.2', '3.3', '3.4', '4.0', head]
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@v6
43
+ - uses: actions/checkout@v7
41
44
  - uses: ruby/setup-ruby@v1
42
45
  with:
43
46
  ruby-version: ${{ matrix.ruby }}
@@ -87,7 +90,7 @@ jobs:
87
90
  matrix:
88
91
  ruby: ['4.0', head]
89
92
  steps:
90
- - uses: actions/checkout@v6
93
+ - uses: actions/checkout@v7
91
94
  - name: Install dependencies
92
95
  run: |
93
96
  brew install ruby-build
@@ -116,3 +119,40 @@ jobs:
116
119
  run: |
117
120
  bin/setup
118
121
  - run: bundle exec rake clean compile_c99
122
+
123
+ clang_compile:
124
+ runs-on: macos-latest
125
+ strategy:
126
+ fail-fast: false
127
+ matrix:
128
+ ruby: ['4.0', head]
129
+ steps:
130
+ - uses: actions/checkout@v7
131
+ - name: Install dependencies
132
+ run: |
133
+ brew install ruby-build
134
+ - uses: ruby/setup-ruby@v1
135
+ with:
136
+ ruby-version: ${{ matrix.ruby }}
137
+ bundler: none
138
+ - name: Set working directory as safe
139
+ run: git config --global --add safe.directory $(pwd)
140
+ - name: Update rubygems & bundler
141
+ run: |
142
+ ruby -v
143
+ gem update --system
144
+ - name: install erb
145
+ run: gem install erb
146
+ - name: clang version
147
+ run: clang --version
148
+ - name: bundle config set force_ruby_platform true if head
149
+ if: ${{ contains(matrix.ruby, 'head') }}
150
+ run: |
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
155
+ - name: bin/setup
156
+ run: |
157
+ bin/setup
158
+ - run: bundle exec rake clean compile
@@ -8,12 +8,15 @@ on:
8
8
  paths:
9
9
  - ".github/workflows/rust.yml"
10
10
  - "rust/**"
11
- - "include/**"
12
- - "src/**"
11
+ # `merge_group` has no `paths` filter, so this runs on every queue entry.
12
+ merge_group: {}
13
13
 
14
14
  env:
15
15
  RUSTFLAGS: "-D warnings"
16
16
 
17
+ permissions:
18
+ contents: read
19
+
17
20
  jobs:
18
21
  test:
19
22
  name: cargo:test
@@ -23,7 +26,7 @@ jobs:
23
26
  matrix:
24
27
  os: [ubuntu-latest, macos-latest, windows-latest]
25
28
  steps:
26
- - uses: actions/checkout@v6
29
+ - uses: actions/checkout@v7
27
30
  - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
28
31
  - name: Set up Ruby
29
32
  uses: ruby/setup-ruby@v1
@@ -42,7 +45,7 @@ jobs:
42
45
  run: |
43
46
  rustup update --no-self-update stable
44
47
  rustup default stable
45
- - uses: actions/cache@v5
48
+ - uses: actions/cache@v6
46
49
  with:
47
50
  path: |
48
51
  ~/.cargo/registry
@@ -61,7 +64,7 @@ jobs:
61
64
  runs-on: ubuntu-latest
62
65
  continue-on-error: true
63
66
  steps:
64
- - uses: actions/checkout@v6
67
+ - uses: actions/checkout@v7
65
68
  - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
66
69
  - name: Set up git identity
67
70
  run: |
@@ -84,7 +87,7 @@ jobs:
84
87
  run: |
85
88
  rustup update --no-self-update stable
86
89
  rustup default stable
87
- - uses: actions/cache@v5
90
+ - uses: actions/cache@v6
88
91
  with:
89
92
  path: |
90
93
  ~/.cargo/registry
@@ -103,7 +106,7 @@ jobs:
103
106
  runs-on: ubuntu-latest
104
107
  continue-on-error: true
105
108
  steps:
106
- - uses: actions/checkout@v6
109
+ - uses: actions/checkout@v7
107
110
  - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
108
111
  - name: Set up git identity
109
112
  run: |
@@ -126,7 +129,7 @@ jobs:
126
129
  run: |
127
130
  rustup update --no-self-update stable
128
131
  rustup default stable
129
- - uses: actions/cache@v5
132
+ - uses: actions/cache@v6
130
133
  with:
131
134
  path: |
132
135
  ~/.cargo/registry
@@ -144,7 +147,7 @@ jobs:
144
147
  name: cargo:lint
145
148
  runs-on: ubuntu-latest
146
149
  steps:
147
- - uses: actions/checkout@v6
150
+ - uses: actions/checkout@v7
148
151
  - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
149
152
  - name: Set up Ruby
150
153
  uses: ruby/setup-ruby@v1
@@ -164,7 +167,7 @@ jobs:
164
167
  rustup update --no-self-update stable
165
168
  rustup default stable
166
169
  rustup component add --toolchain stable clippy rustfmt
167
- - uses: actions/cache@v5
170
+ - uses: actions/cache@v6
168
171
  with:
169
172
  path: |
170
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@v6
19
+ - uses: actions/checkout@v7
17
20
  - uses: ruby/setup-ruby@v1
18
21
  with:
19
- ruby-version: "3.4"
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: ['3.4', ucrt, mswin]
19
+ ruby: ['4.0', ucrt, mswin]
17
20
  steps:
18
- - uses: actions/checkout@v6
21
+ - uses: actions/checkout@v7
19
22
  - name: load ruby
20
23
  uses: ruby/setup-ruby@v1
21
24
  with:
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