Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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)
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
2 changes: 1 addition & 1 deletion gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4357,7 +4357,7 @@ gc_config_set(rb_execution_context_t *ec, VALUE self, VALUE hash)

rb_gc_impl_config_set(objspace, hash);

return rb_gc_impl_config_get(objspace);
return Qnil;
}

static VALUE
Expand Down
Loading