Skip to content

Commit

Permalink
[GR-45621] Ruby 3.2.2 import
Browse files Browse the repository at this point in the history
PullRequest: truffleruby/3934
  • Loading branch information
eregon committed Aug 15, 2023
2 parents 341e210 + 3408558 commit 66ca27b
Show file tree
Hide file tree
Showing 1,937 changed files with 74,819 additions and 35,585 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

/CHANGELOG.md merge=union

/spec/truffleruby.next-specs merge=union

# Rules for GitHub's Linguist language-classification system. We're abusing the
# 'vendored' attribute to exclude files as a lot of this isn't really vendored,
# and a whole lot of actually vendored code isn't listed! What we want to do is
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ bench/psd.rb/psd_native/ext/psd_native/Makefile
lib/gems/extensions
lib/gems/gems/*/ext/*/Makefile
lib/gems/gems/*/ext/*/.*.time
lib/gems/gems/debug-*/ext/debug/debug_version.h

src/main/c/*/Makefile
!src/main/c/spawn-helper/Makefile
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require:
- ./tool/rubocop-truffleruby/cop/replace_with_primitive_true_and_false_predicates.rb

AllCops:
TargetRubyVersion: 3.1
TargetRubyVersion: 3.2
DisabledByDefault: true
DisplayCopNames: true
ExtraDetails: true
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.3
3.2.2
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

New features:

* Updated to Ruby 3.2.2 (#3039, @eregon, @andrykonchin).

Bug fixes:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ See the [contributor workflow](doc/contributor/workflow.md) document if you wish
We recommend that people trying TruffleRuby on their gems and applications [get in touch with us](#contact) for any help they might need.

TruffleRuby runs Rails and is compatible with many gems, including C extensions.
TruffleRuby is not 100% compatible with MRI 3.1 yet. Please [report](https://github.com/oracle/truffleruby/issues) any compatibility issues you might find.
TruffleRuby is not 100% compatible with MRI 3.2 yet. Please [report](https://github.com/oracle/truffleruby/issues) any compatibility issues you might find.
TruffleRuby [passes around 97% of ruby/spec](https://eregon.me/rubyspec-stats/),
more than any other alternative Ruby implementation.

Expand Down
9 changes: 6 additions & 3 deletions doc/contributor/updating-ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ruby-install ruby $VERSION
rm -rf ~/.rubies/ruby-$VERSION
ruby-build $VERSION ~/.rubies/ruby-$VERSION
ruby-install --no-install-deps -r ~/tmp ruby $VERSION
rm -rf ~/tmp/ruby-$VERSION
```

`ruby-build` does not keep the build directory
Expand Down Expand Up @@ -143,15 +144,17 @@ Update all of these:

* Update `.ruby-version`, `TruffleRuby.LANGUAGE_VERSION`
* Reset `lib/cext/ABI_version.txt` and `lib/cext/ABI_check.txt` to `1` if `RUBY_VERSION` was updated.
* Update `versions.json` (with gem versions provided by `cat ../ruby/gems/bundled_gems`, `ls -l lib/gems/specifications/default` and `jt gem --version`)
* Update `versions.json` (with gem versions provided by `cat ../ruby/gems/bundled_gems | sort`, `ls -l lib/gems/specifications/default` and `grep 'VERSION =' lib/mri/rubygems.rb`)
* Also update version numbers in `src/main/c/Makefile`.
* Copy and paste `-h` and `--help` output to `RubyLauncher` (instructions are in the end of the file `src/launcher/java/org/truffleruby/launcher/RubyLauncher.java`)
* This is a good time to get `jt build` working.
* Copy and paste the TruffleRuby `--help` output to `doc/user/options.md` (e.g., with `jt ruby --help | xsel -b`)
* Update `doc/user/compatibility.md` and `README.md`
* Update `doc/legal/legal.md`
* Update `doc/legal/legal.md`, notably the `Bundled gems` section
* Update method lists - see `spec/truffle/methods_spec.rb`
* Build TruffleRuby (`jt build`).
* Run `jt test gems default-bundled-gems`
* Get `jt test spec/truffle/rubygems/default_gems_list_spec.rb` to pass
* Grep for the old Ruby version with `git grep -F x.y.z`
* Grep for the old Bundler version with `git grep -F x.y.z`
* If `tool/id.def` or `lib/cext/include/truffleruby/internal/id.h` has changed, then run `jt build core-symbols` and check for correctness.
Expand All @@ -160,7 +163,7 @@ Update all of these:

For a new major version:
* Update `TargetRubyVersion` in `.rubocop.yml`
* Update the list of `:next` specs.
* Update `spec/truffleruby.next-specs` and remove `/spec/truffleruby.next-specs merge=union` in `.gitattributes`
* Update the docs for next version specs in [workflow.md](workflow.md).
* Update the versions in the `ruby/spec on CRuby` job of `.github/workflows/ci.yml`.

Expand Down
13 changes: 6 additions & 7 deletions doc/contributor/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,16 @@ exception.
When the spec is fixed the `untag` command will remove the tag and you can
commit the fix and the removal of the tag.

## Running specs for Ruby 3.2 features
## Running specs for Ruby 3.3 features

TruffleRuby currently targets Ruby 3.1. However, we welcome pull requests for
Ruby 3.2 features as long as they don't conflict significantly with
Ruby 3.1 semantics.
TruffleRuby currently targets Ruby 3.2. However, we welcome pull requests for
Ruby 3.3 features as long as they don't conflict significantly with
Ruby 3.2 semantics.

It is possible to run specs for Ruby 3.2 features by setting
`PRETEND_RUBY_VERSION`:
It is possible to run specs for Ruby 3.3 features by setting `PRETEND_RUBY_VERSION`:

```bash
PRETEND_RUBY_VERSION=3.2.0 jt test spec/ruby/.../some_spec.rb
PRETEND_RUBY_VERSION=3.3.0 jt test spec/ruby/.../some_spec.rb
```

This also works for `jt tag`/`jt untag`.
Expand Down
16 changes: 16 additions & 0 deletions doc/legal/bundled_gems
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# gem-name version-to-bundle repository-url [optional-commit-hash-to-test-or-defaults-to-v-version]
minitest 5.16.3 https://github.com/seattlerb/minitest
power_assert 2.0.3 https://github.com/ruby/power_assert
rake 13.0.6 https://github.com/ruby/rake
test-unit 3.5.7 https://github.com/test-unit/test-unit
rexml 3.2.5 https://github.com/ruby/rexml
rss 0.2.9 https://github.com/ruby/rss
net-ftp 0.2.0 https://github.com/ruby/net-ftp
net-imap 0.3.4 https://github.com/ruby/net-imap
net-pop 0.1.2 https://github.com/ruby/net-pop
net-smtp 0.3.3 https://github.com/ruby/net-smtp
matrix 0.4.2 https://github.com/ruby/matrix
prime 0.1.2 https://github.com/ruby/prime
rbs 2.8.2 https://github.com/ruby/rbs
typeprof 0.21.3 https://github.com/ruby/typeprof
debug 1.7.1 https://github.com/ruby/debug
64 changes: 43 additions & 21 deletions doc/legal/legal.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ See `epl-2.0.txt`, `gpl-2.txt`, `lgpl-2.1.txt`.
## MRI

The standard implementation of Ruby is MRI. TruffleRuby contains code from MRI
version 3.1.3, including:
version 3.2.2, including:

* the standard library in `lib/mri`,
* Ruby C extension API in `lib/cext/include` and `src/main/c/cext`,
* C extensions in `src/main/c/{etc,nkf,openssl,psych,rbconfig-sizeof,syslog,zlib}`
* C extensions in `src/main/c/{bigdecimal,date,etc,io-console,nkf,openssl,psych,rbconfig-sizeof,ripper,syslog,zlib}`

MRI is copyright Yukihiro Matsumoto. It is made available under the terms of the
2-clause BSD licence `ruby-bsdl.txt`, or a custom licence `ruby-licence.txt`.
Expand Down Expand Up @@ -96,47 +96,69 @@ are copyright 2013 Brian Shirai and are licensed under the 3-clause BSD license.
In some cases this code is just code from MRI, and covered by their licence. In
some cases we have modified this code.

# Included gems
# Bundled gems

This list is from [bundled_gems](bundled_gems) and `grep licenses lib/gems/specifications/*.gemspec`.
Versions as used in MRI unless otherwise specified.

#### did_you_mean
#### debug

did_you_mean is copyright 2014 Yuki Nishijima and is available under an MIT
licence (see `mit.txt`).
debug is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).

#### matrix

matrix is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).

#### minitest

minitest is copyright Ryan Davis and is available under an MIT licence (see
`mit.txt`).
minitest is copyright Ryan Davis and is available under an MIT licence (see `mit.txt`).

#### net-telnet
#### net-ftp, net-imap, net-pop, net-smtp

net-telnet is under the same copyright and licence as MRI.
These 4 bundled gems are under the same copyright and licence as MRI (see `ruby-bsdl.txt`).

#### power_assert

power_assert copyright Kazuki Tsujimoto, but available under the same licence as
MRI.
power_assert is copyright Kazuki Tsujimoto and is available under the same licence as MRI (see `ruby-bsdl.txt`).

#### Rake
#### prime

Rake is copyright Jim Weirich and is available under an MIT licence (see
`mit.txt`).
prime is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).

#### rake

Rake is copyright Jim Weirich and is available under an MIT licence (see `mit.txt`).

#### rbs

rbs is copyright Soutaro Matsumoto and is available under the same licence as MRI (see `ruby-bsdl.txt`).

#### rexml

rexml is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).

#### rss

rss is under the same copyright and licence as MRI (see `ruby-bsdl.txt`).

#### test-unit

test-unit is copyright Kouhei Sutou, Ryan Davis, and Nathaniel Talbott and is
available under the terms of the GPL 2 (see `gpl-2.txt`), or the same custom
licence as MRI (see `ruby-licence.txt`).
test-unit is copyright Sutou Kouhei, Ryan Davis, and Nathaniel Talbott
and is available under the same licence as MRI (see `ruby-bsdl.txt`).

#### typeprof

typeprof is copyright Yusuke Endoh and is available under an MIT licence (see `mit.txt`).

# Other gems

#### JSON
#### json

The JSON gem is available under the same licence as MRI.
The json gem is available under the same licence as MRI (see `ruby-bsdl.txt`).

#### RDoc

It's part of the standard library, not an included gem, but RDoc is copyright
It's part of the standard library, not a bundled gem. RDoc is copyright
Dave Thomas and Eric Hodel and is available under the terms of the GPL 2 (see
`gpl-2.txt`), or the same custom licence as MRI (see `ruby-licence.txt`). Some
other files in RDoc have different, but compatible, licences detailed in the
Expand Down
2 changes: 1 addition & 1 deletion doc/user/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: /reference-manual/ruby/Compatibility/
# Compatibility

TruffleRuby aims to be fully compatible with the standard implementation of
Ruby, MRI, version 3.1.3, [including C extensions](#c-extension-compatibility).
Ruby, MRI, version 3.2.2, [including C extensions](#c-extension-compatibility).
TruffleRuby is still in development, so it is not 100% compatible yet.

TruffleRuby can run Rails and is compatible with many gems, including C extensions.
Expand Down
7 changes: 5 additions & 2 deletions doc/user/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Usage: truffleruby [switches] [--] [programfile] [arguments]
set warning level; 0=silence, 1=medium, 2=verbose
-x[directory] strip off text before #!ruby line and perhaps cd to directory
--copyright print the copyright
--enable={rubyopt|...}[,...], --disable={rubyopt|...}[,...]
--enable={jit|rubyopt|...}[,...], --disable={jit|rubyopt|...}[,...]
enable or disable features. see below for available features
--external-encoding=encoding, --internal-encoding=encoding
specify the default external or internal character encoding
Expand All @@ -45,7 +45,9 @@ Usage: truffleruby [switches] [--] [programfile] [arguments]
Features:
gems rubygems (only for debugging, default: enabled)
error_highlight error_highlight (default: enabled)
did_you_mean did_you_mean (default: enabled)
syntax_suggest syntax_suggest (default: enabled)
rubyopt RUBYOPT environment variable (default: enabled)
frozen-string-literal
freeze all string literals (default: disabled)
Expand All @@ -66,13 +68,14 @@ Runtime options:
--help Print this help message.
--help:vm Print options for the host VM.
--help:engine Print engine options.
--help:compiler Print engine compiler options.
--help:all Print all options.
--version:graalvm Print GraalVM version information and exit.
--show-version:graalvm Print GraalVM version information and continue execution.
Languages:
[id] [name] [website]
llvm LLVM https://www.graalvm.org/22.1/reference-manual/llvm/
llvm LLVM https://www.graalvm.org/dev/reference-manual/llvm/
ruby Ruby https://www.graalvm.org/ruby/
Tools:
Expand Down
19 changes: 2 additions & 17 deletions exe/gem
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ exec "$(dirname $SELF_PATH)/ruby" "$SELF_PATH" "$@"
# See LICENSE.txt for permissions.
#++

require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'

required_version = Gem::Requirement.new ">= 1.8.7"

unless required_version.satisfied_by? Gem.ruby_version then
abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
end

args = ARGV.clone

begin
Gem::GemRunner.new.run args
rescue Gem::SystemExitException => e
exit e.exit_code
end
require "rubygems/gem_runner"

Gem::GemRunner.new.run ARGV.clone
2 changes: 1 addition & 1 deletion lib/cext/ABI_check.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7
2
2 changes: 1 addition & 1 deletion lib/cext/ABI_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
1
12 changes: 6 additions & 6 deletions lib/cext/include/ccan/build_assert/build_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define CCAN_BUILD_ASSERT_H

/**
* BUILD_ASSERT - assert a build-time dependency.
* CCAN_BUILD_ASSERT - assert a build-time dependency.
* @cond: the compile-time condition which must be true.
*
* Your compile will fail if the condition isn't true, or can't be evaluated
Expand All @@ -15,15 +15,15 @@
* static char *foo_to_char(struct foo *foo)
* {
* // This code needs string to be at start of foo.
* BUILD_ASSERT(offsetof(struct foo, string) == 0);
* CCAN_BUILD_ASSERT(offsetof(struct foo, string) == 0);
* return (char *)foo;
* }
*/
#define BUILD_ASSERT(cond) \
#define CCAN_BUILD_ASSERT(cond) \
do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)

/**
* BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
* CCAN_BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
* @cond: the compile-time condition which must be true.
*
* Your compile will fail if the condition isn't true, or can't be evaluated
Expand All @@ -32,9 +32,9 @@
* Example:
* #define foo_to_char(foo) \
* ((char *)(foo) \
* + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
* + CCAN_BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
*/
#define BUILD_ASSERT_OR_ZERO(cond) \
#define CCAN_BUILD_ASSERT_OR_ZERO(cond) \
(sizeof(char [1 - 2*!(cond)]) - 1)

#endif /* CCAN_BUILD_ASSERT_H */

0 comments on commit 66ca27b

Please sign in to comment.