Skip to content

Fix str encode in ractors #674

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d80c03d
Fix id2ref table build when GC in progress
jhawthorn Aug 8, 2025
22fe80f
Fix Typo in Regular Expressions docs (_regexp.rdoc)
carlzulauf Aug 4, 2025
4209ebb
[DOC] Array#fill fix to indicate return is self
notEthan Aug 5, 2025
60ca525
[DOC] Array#map! fix to indicate return is self
notEthan Aug 5, 2025
23c0113
[ruby/stringio] fix: prevent segfault in StringIO#seek with SEEK_END
koh-sh Aug 9, 2025
31f2d89
[ruby/stringio] Fix SEGV at read/pread on null StringIO
nobu Aug 9, 2025
b4d5ebc
[ruby/stringio] Fix SEGV at eof? on null StringIO
nobu Aug 9, 2025
77b3495
[ruby/stringio] Adjust indent [ci skip]
nobu Aug 9, 2025
2a6345e
time.c: fix time_mark_and_move when WIDEVALUE_IS_WIDER
byroot Aug 9, 2025
90f8199
CI: mingw: Tweak misc system & package info
nobu Aug 9, 2025
c1f9f0a
CI: windows: Windows-2019 or earlier no longer used
nobu Aug 10, 2025
cc4eba0
Win: Use `@` instead of `echo off` in `vssetup.cmd`
nobu Aug 9, 2025
a443cd0
CI: mingw: Set `cmd` as the default shell
nobu Aug 9, 2025
4adb6f6
CI: mingw: Set up msys2 environment variables
nobu Aug 9, 2025
b0a4e23
CI: mingw: Use the official actions for msys2
hsbt Jul 24, 2025
df11c07
[DOC] Fix `vssetup.cmd` arguments
nobu Aug 10, 2025
5e324ac
Optimize `str_casecmp` length check using pointer end
erimicel Aug 10, 2025
09d6cfc
Update test_string.rb
erimicel Aug 10, 2025
c914389
Update string_casecmp.yml
erimicel Aug 10, 2025
62b5fe8
[DOC] Tweaks for GC.config
BurdetteLamar Aug 6, 2025
ad14632
[DOC] Tweaks for GC.config
BurdetteLamar Aug 8, 2025
e0b72ad
[DOC] Update JIT options
BurdetteLamar Aug 11, 2025
4775d1f
Add NODE IN locations
S-H-GAMELINKS Aug 10, 2025
61fff8a
Fix return value of setting in GC.config
peterzhu2118 Aug 8, 2025
ec8327d
Allow encodings to be autoloaded through transcoding functions
luke-gruber Aug 6, 2025
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
92 changes: 66 additions & 26 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,39 @@ jobs:
)}}

steps:
- name: Set up Ruby & MSYS2
uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
- uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0
id: msys2
with:
ruby-version: '3.2'
msystem: UCRT64
update: true
install: >-
git
make
ruby
autoconf
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-ragel
mingw-w64-ucrt-x86_64-openssl
mingw-w64-ucrt-x86_64-libyaml
mingw-w64-ucrt-x86_64-libffi

- name: Set up env
id: setup-env
working-directory:
run: |
$msys2 = ${env:MSYS2_LOCATION}
echo $msys2\usr\bin $msys2\ucrt64\bin |
Tee-Object ${env:GITHUB_PATH} -Append -Encoding utf-8

# Use the fast device for the temporary directory.
# %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
# https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
$tmp = ${env:RUNNER_TEMP}
echo HOME=$home TMP=$tmp TEMP=$tmp TMPDIR=$tmp |
Tee-Object ${env:GITHUB_ENV} -Append -Encoding utf-8
shell: pwsh # cmd.exe does not strip spaces before `|`.
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}

- name: Remove Strawberry Perl pkg-config
working-directory:
Expand All @@ -86,25 +115,38 @@ jobs:
- name: Misc system & package info
working-directory:
run: |
# show where
result=true
for e in gcc.exe ragel.exe make.exe libcrypto-3-x64.dll libssl-3-x64.dll; do
echo ::group::$'\e[93m'$e$'\e[m'
where $e || result=false
echo ::endgroup::
done
# show version
for e in gcc ragel make "openssl version"; do
case "$e" in *" "*) ;; *) e="$e --version";; esac
echo ::group::$'\e[93m'$e$'\e[m'
$e || result=false
echo ::endgroup::
done
# show packages
echo ::group::$'\e[93m'Packages$'\e[m'
pacman -Qs mingw-w64-ucrt-x86_64-* | sed -n "s,local/mingw-w64-ucrt-x86_64-,,p"
echo ::endgroup::
$result
group() { echo ::group::$'\e[94;1m'"$*"$'\e[m'; }
endgroup() { echo ::endgroup::; }

group Path
cygpath -wa / . $(type -p cygpath bash sh)
endgroup

I() {
group $1
run Where type -pa $1 && { [ $# -eq 1 ] || run Version "$@"; } ||
failed+=($1)
endgroup
}
run() { local w m=$1; shift; w="$("$@")" && show "$m" && indent "$w"; }
indent() { [ -z "$1" ] || echo "$1" | /bin/sed '/^$/!s/^/ /'; }
show() { echo $'\e[96m'"$*"$'\e[m'; }

failed=()

I gcc.exe --version
I ragel.exe --version
I make.exe --version
I openssl.exe version
I libcrypto-3-x64.dll
I libssl-3-x64.dll

group Packages
pacman -Qs mingw-w64-ucrt-x86_64-* | /bin/sed -n "s,local/mingw-w64-ucrt-x86_64-,,p"
endgroup

[ ${#failed[@]} -eq 0 ]
shell: sh

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -123,6 +165,7 @@ jobs:
run: >
../src/configure --disable-install-doc --prefix=/.
--build=$CHOST --host=$CHOST --target=$CHOST
shell: sh

- name: make all
timeout-minutes: 30
Expand All @@ -145,15 +188,13 @@ jobs:
- name: test
timeout-minutes: 30
run: make test
shell: cmd
env:
GNUMAKEFLAGS: ''
RUBY_TESTOPTS: '-v --tty=no'
if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test' }}

- name: test-all
timeout-minutes: 45
shell: cmd
run: |
make ${{ StartsWith(matrix.test_task, 'test/') && matrix.test_task || 'test-all' }}
env:
Expand All @@ -168,7 +209,6 @@ jobs:
timeout-minutes: 10
run: |
make ${{ StartsWith(matrix.test_task, 'spec/') && matrix.test_task || 'test-spec' }}
shell: cmd
if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test-spec' || StartsWith(matrix.test_task, 'spec/') }}

- uses: ./src/.github/actions/slack
Expand All @@ -180,4 +220,4 @@ jobs:
defaults:
run:
working-directory: build
shell: sh
shell: cmd
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
test_task: test-bundled-gems
fail-fast: false

runs-on: windows-${{ matrix.os < 2022 && '2019' || matrix.os }}
runs-on: windows-${{ matrix.os }}

if: >-
${{!(false
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:

- name: Install libraries with vcpkg
run: |
vcpkg install --vcpkg-root=C:\Users\runneradmin\scoop\apps\vcpkg\current
vcpkg install --vcpkg-root=%USERPROFILE%\scoop\apps\vcpkg\current
working-directory: src

- name: Save vcpkg artifact
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
- name: Set up Launchable
uses: ./.github/actions/launchable/setup
with:
os: windows-${{ matrix.os < 2022 && '2019' || matrix.os }}
os: windows-${{ matrix.os }}
launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
builddir: build
srcdir: src
Expand Down
12 changes: 6 additions & 6 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -3659,9 +3659,9 @@ rb_ary_collect(VALUE ary)

/*
* call-seq:
* collect! {|element| ... } -> new_array
* collect! {|element| ... } -> self
* collect! -> new_enumerator
* map! {|element| ... } -> new_array
* map! {|element| ... } -> self
* map! -> new_enumerator
*
* With a block given, calls the block with each element of +self+
Expand Down Expand Up @@ -4755,10 +4755,10 @@ rb_ary_clear(VALUE ary)

/*
* call-seq:
* fill(object, start = nil, count = nil) -> new_array
* fill(object, range) -> new_array
* fill(start = nil, count = nil) {|element| ... } -> new_array
* fill(range) {|element| ... } -> new_array
* fill(object, start = nil, count = nil) -> self
* fill(object, range) -> self
* fill(start = nil, count = nil) {|element| ... } -> self
* fill(range) {|element| ... } -> self
*
* Replaces selected elements in +self+;
* may add elements to +self+;
Expand Down
6 changes: 6 additions & 0 deletions ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,12 @@ node_locations(VALUE ast_value, const NODE *node)
location_new(&RNODE_IF(node)->if_keyword_loc),
location_new(&RNODE_IF(node)->then_keyword_loc),
location_new(&RNODE_IF(node)->end_keyword_loc));
case NODE_IN:
return rb_ary_new_from_args(4,
location_new(nd_code_loc(node)),
location_new(&RNODE_IN(node)->in_keyword_loc),
location_new(&RNODE_IN(node)->then_keyword_loc),
location_new(&RNODE_IN(node)->operator_loc));
case NODE_MODULE:
return rb_ary_new_from_args(3,
location_new(nd_code_loc(node)),
Expand Down
2 changes: 2 additions & 0 deletions benchmark/string_casecmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ benchmark:
casecmp-10: lstr10.casecmp(ustr10)
casecmp-100: lstr100.casecmp(ustr100)
casecmp-1000: lstr1000.casecmp(ustr1000)
casecmp-1000vs10: lstr1000.casecmp(ustr10)
casecmp-nonascii1: lnonascii1.casecmp(unonascii1)
casecmp-nonascii10: lnonascii10.casecmp(unonascii10)
casecmp-nonascii100: lnonascii100.casecmp(unonascii100)
casecmp-nonascii1000: lnonascii1000.casecmp(unonascii1000)
casecmp-nonascii1000vs10: lnonascii1000.casecmp(unonascii10)
2 changes: 1 addition & 1 deletion doc/_regexp.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ An added _quantifier_ specifies how many matches are required or allowed:
/\w*/.match('x')
# => #<MatchData "x">
/\w*/.match('xyz')
# => #<MatchData "yz">
# => #<MatchData "xyz">

- <tt>+</tt> - Matches one or more times:

Expand Down
46 changes: 5 additions & 41 deletions doc/ruby/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ $ ruby --internal-encoding=cesu-8 -e 'puts Encoding::default_internal'
CESU-8
```

### `--jit`

Option `--jit` is an alias for option `--yjit`, which enables YJIT;
see additional YJIT options in the [YJIT documentation](rdoc-ref:yjit/yjit.md).

### `--verbose`: Set `$VERBOSE`

Option `--verbose` sets global variable `$VERBOSE` to `true`
Expand All @@ -681,44 +686,3 @@ and disables input from `$stdin`.

Option `--version` prints the version of the Ruby interpreter, then exits.

## Experimental Options

These options are experimental in the current Ruby release,
and may be modified or withdrawn in later releases.

### `--jit`

Option `-jit` enables JIT compilation with the default option.

#### `--jit-debug`

Option `--jit-debug` enables JIT debugging (very slow);
adds compiler flags if given.

#### `--jit-max-cache=num`

Option `--jit-max-cache=num` sets the maximum number of methods
to be JIT-ed in a cache; default: 100).

#### `--jit-min-calls=num`

Option `jit-min-calls=num` sets the minimum number of calls to trigger JIT
(for testing); default: 10000).

#### `--jit-save-temps`

Option `--jit-save-temps` saves JIT temporary files in $TMP or /tmp (for testing).

#### `--jit-verbose`

Option `--jit-verbose` prints JIT logs of level `num` or less
to `$stderr`; default: 0.

#### `--jit-wait`

Option `--jit-wait` waits until JIT compilation finishes every time (for testing).

#### `--jit-warnings`

Option `--jit-warnings` enables printing of JIT warnings.

8 changes: 5 additions & 3 deletions doc/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,18 @@ sh ../../ruby/configure -C --disable-install-doc --with-opt-dir=C:\Users\usernam
To cross build arm64 binary:

```
cmd /k win32\vssetup.cmd -arch arm64
cmd /k win32\vssetup.cmd -arch=arm64
```

To cross build x64 binary:

```
cmd /k win32\vssetup.cmd -arch x64
cmd /k win32\vssetup.cmd -arch=x64
```

See `win32\vssetup.cmd -help` for other command line options.
This batch file is a wrapper of `vsdevcmd.bat` and options are
passed to it as-is. `win32\vssetup.cmd -help` for other command
line options.

**Note** building ruby requires following commands.

Expand Down
Loading
Loading