-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into dev/gc-mmtk
- Loading branch information
Showing
123 changed files
with
2,243 additions
and
1,324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
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` | ||
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_ENABLE_SHARED='${{ inputs.enable_shared }}' | ||
--env INPUT_STATIC_EXTS='${{ inputs.static_exts }}' | ||
'ghcr.io/ruby/ruby-ci-image:${{ inputs.tag }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.