Skip to content

Commit

Permalink
Merge branch 'master' into dev/mmtk-overrides-default
Browse files Browse the repository at this point in the history
  • Loading branch information
wks committed Oct 10, 2024
2 parents c300b86 + 63f94e1 commit 8590762
Show file tree
Hide file tree
Showing 1,681 changed files with 87,566 additions and 107,821 deletions.
1 change: 1 addition & 0 deletions .document
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ array.rb
ast.rb
dir.rb
gc.rb
hash.rb
io.rb
kernel.rb
marshal.rb
Expand Down
5 changes: 3 additions & 2 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
set startup-with-shell off

define hook-run
set $color_type = 0
set $color_highlite = 0
Expand Down Expand Up @@ -1345,3 +1343,6 @@ define print_flags
end

source -s misc/gdb.py

# Moved from beginning, since it fails on older gdbs
set startup-with-shell off
101 changes: 101 additions & 0 deletions .github/actions/compilers/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Compiles ruby in a container
description: >-
Makes ruby using a dedicated container
inputs:
tag:
required: false
default: clang-18
description: >-
container image tag to use in this run.
with_gcc:
required: false
description: >-
override compiler path & flags.
CFLAGS:
required: false
description: >-
C compiler flags to override.
CXXFLAGS:
required: false
description: >-
C++ compiler flags to override.
optflags:
required: false
# -O1 is faster than -O3 in our tests... Majority of time are consumed trying
# to optimize binaries. Also GitHub Actions run on relatively modern CPUs
# compared to, say, GCC 4 or Clang 3. We don't specify `-march=native`
# because compilers tend not understand what the CPU is.
default: '-O1'
description: >-
Compiler flags for optimisations.
cppflags:
required: false
description: >-
Additional preprocessor flags.
append_configure:
required: false
default: >-
--without-valgrind
--without-jemalloc
--without-gmp
description: >-
flags to append to configure.
enable_shared:
required: false
default: true
description: >-
Whether to build libruby.so.
check:
required: false
default: ''
description: >-
Whether to run `make check`
mspecopt:
required: false
default: ''
description: >-
Additional options for mspec.
static_exts:
required: false
description: >-
whitespace separated list of extensions that need be linked statically.
runs:
using: composite
steps:
- shell: bash
run: docker pull --quiet 'ghcr.io/ruby/ruby-ci-image:${{ inputs.tag }}'

- name: compile
shell: bash
run: >-
docker run
--rm
--user=root
--volume '${{ github.workspace }}:/github/workspace:ro'
--workdir=/github/workspace
--entrypoint=/github/workspace/.github/actions/compilers/entrypoint.sh
--env CI
--env GITHUB_ACTION
--env INPUT_WITH_GCC='${{ inputs.with_gcc || inputs.tag }}'
--env INPUT_CFLAGS='${{ inputs.CFLAGS }}'
--env INPUT_CXXFLAGS='${{ inputs.CXXFLAGS }}'
--env INPUT_OPTFLAGS='${{ inputs.OPTFLAGS }}'
--env INPUT_CPPFLAGS='${{ inputs.cppflags }}'
--env INPUT_APPEND_CONFIGURE='${{ inputs.append_configure }}'
--env INPUT_CHECK='${{ inputs.check }}'
--env INPUT_MSPECOPT='${{ inputs.mspecopt }}'
--env INPUT_ENABLE_SHARED='${{ inputs.enable_shared }}'
--env INPUT_STATIC_EXTS='${{ inputs.static_exts }}'
'ghcr.io/ruby/ruby-ci-image:${{ inputs.tag }}'
96 changes: 96 additions & 0 deletions .github/actions/compilers/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#! /bin/bash

# Copyright (c) 2024 Ruby developers. All rights reserved.
#
# This file is a part of the programming language Ruby. Permission is hereby
# granted, to either redistribute and/or modify this file, provided that the
# conditions mentioned in the file COPYING are met. Consult the file for
# details.

grouped()
{
echo "::group::${@}"
"${@}"
echo "::endgroup::"
}

set -e
set -u
set -o pipefail

srcdir="/github/workspace/src"
builddir="$(mktemp -dt)"

export GITHUB_WORKFLOW='Compilations'
export CONFIGURE_TTY='never'
export RUBY_DEBUG='ci rgengc'
export RUBY_TESTOPTS='-q --color=always --tty=no'
export RUBY_DEBUG_COUNTER_DISABLE='1'
export GNUMAKEFLAGS="-j$((1 + $(nproc --all)))"

case "x${INPUT_ENABLE_SHARED}" in
x | xno | xfalse )
enable_shared='--disable-shared'
;;
*)
enable_shared='--enable-shared'
;;
esac

pushd ${builddir}

grouped ${srcdir}/configure \
-C \
--with-gcc="${INPUT_WITH_GCC}" \
--enable-debug-env \
--disable-install-doc \
--with-ext=-test-/cxxanyargs,+ \
${enable_shared} \
${INPUT_APPEND_CONFIGURE} \
CFLAGS="${INPUT_CFLAGS}" \
CXXFLAGS="${INPUT_CXXFLAGS}" \
optflags="${INPUT_OPTFLAGS}" \
cppflags="${INPUT_CPPFLAGS}" \
debugflags='-ggdb3' # -g0 disables backtraces when SEGV. Do not set that.

popd

if [[ -n "${INPUT_STATIC_EXTS}" ]]; then
echo "::group::ext/Setup"
set -x
mkdir ${builddir}/ext
(
for ext in ${INPUT_STATIC_EXTS}; do
echo "${ext}"
done
) >> ${builddir}/ext/Setup
set +x
echo "::endgroup::"
fi

pushd ${builddir}

case "${INPUT_APPEND_CONFIGURE}" in
*--with-shared-gc*)
export RUBY_GC_LIBRARY='librubygc.default.so'
mkdir -p /home/runner/shared-gc
grouped make shared-gc SHARED_GC=default
;;
esac

grouped make showflags
grouped make all
grouped make test

[[ -z "${INPUT_CHECK}" ]] && exit 0

if [ "$INPUT_CHECK" = "true" ]; then
tests="ruby -ext-"
else
tests="$INPUT_CHECK"
fi

grouped make install
grouped make test-tool
grouped make test-all TESTS="-- $tests"
grouped env CHECK_LEAKS=true make test-spec MSPECOPT="$INPUT_MSPECOPT"
10 changes: 6 additions & 4 deletions .github/actions/setup/directories/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@ runs:
git config --global init.defaultBranch garbage
- if: inputs.checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
path: ${{ inputs.srcdir }}
fetch-depth: ${{ inputs.fetch-depth }}

- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
- uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: ${{ inputs.srcdir }}/.downloaded-cache
key: downloaded-cache

- if: steps.which.outputs.autoreconf
shell: bash
working-directory: ${{ inputs.srcdir }}
run: ./autogen.sh
run: ./autogen.sh --install

# This is for MinGW.
- if: runner.os == 'Windows'
Expand Down Expand Up @@ -138,7 +138,9 @@ runs:
run: |
sudo chmod -R go-w /usr/share
chmod -v go-w $HOME $HOME/.config || :
sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || :
SAVE_IFS="$IFS" IFS=:; set $PATH; dirs=() IFS="$SAVE_IFS"
for d do [ ! -d "$d" ] || dirs+=("$d"); done
sudo chmod -v go-w "${dirs[@]}" || :
- if: inputs.dummy-files == 'true'
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/annocheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
|| contains(github.event.head_commit.message, 'Document')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.title, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
)}}
Expand All @@ -63,7 +63,7 @@ jobs:
- run: id
working-directory:

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
sparse-checkout-cone-mode: false
sparse-checkout: /.github
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/baseruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
|| contains(github.event.head_commit.message, 'Document')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.title, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
)}}
Expand All @@ -56,7 +56,7 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler: none

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- uses: ./.github/actions/setup/ubuntu

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/bundled_gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}

Expand All @@ -46,10 +46,11 @@ jobs:
- name: Download previous gems list
run: |
data=bundled_gems.json
mkdir -p .downloaded-cache
ln -s .downloaded-cache/$data .
curl -O -R -z ./$data https://stdgems.org/$data
for data in bundled_gems.json default_gems.json; do
ln -s .downloaded-cache/$data .
curl -O -R -z ./$data https://stdgems.org/$data
done
- name: Update bundled gems list
id: bundled_gems
Expand Down Expand Up @@ -103,7 +104,7 @@ jobs:
timeout-minutes: 30
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
if: ${{ steps.diff.outputs.gems }}

- name: Commit
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/check_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
|| contains(github.event.head_commit.message, 'Document')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.title, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
)}}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- uses: ./.github/actions/setup/ubuntu
if: ${{ contains(matrix.os, 'ubuntu') }}
Expand All @@ -65,6 +65,8 @@ jobs:

- run: make all golf

- run: ./goruby -veh

- run: ruby tool/update-deps --fix

- run: git diff --no-ext-diff --ignore-submodules --exit-code
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/check_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -111,6 +111,28 @@ jobs:
steps.diff.outputs.update
}}
- name: Generate docs
id: docs
run: |
ruby -W0 --disable-gems -I./lib tool/rdoc-srcdir -q --op html .
echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT
# Generate only when document commit/PR
if: >-
${{false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.head_commit.message, 'Document')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.title, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
}}
- name: Upload docs
uses: actions/upload-artifact@v4
with:
path: html
name: ${{ steps.docs.outputs.htmlout }}
if: ${{ steps.docs.outcome == 'success' }}

- uses: ./.github/actions/slack
with:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
Expand Down
Loading

0 comments on commit 8590762

Please sign in to comment.