Skip to content

Commit

Permalink
Add MMTk GC Module to Ubuntu CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eightbitraptor committed Oct 2, 2024
1 parent 0a85765 commit b0d0e6f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
- test_task: check
configure: '--enable-shared --enable-load-relative'
- test_task: check
gc_name: 'default'
shared_gc: true
configure: '--with-shared-gc=/home/runner/ruby_gc'
- test_task: check
gc_name: 'mmtk'
shared_gc: true
configure: '--with-shared-gc=/home/runner/ruby_gc'
- test_task: test-bundler-parallel
Expand Down Expand Up @@ -99,7 +104,6 @@ jobs:

- name: Build shared GC
run: |
echo "RUBY_GC_LIBRARY=librubygc.default.so" >> $GITHUB_ENV
make shared-gc SHARED_GC=default
if: ${{ matrix.shared_gc }}

Expand All @@ -117,6 +121,19 @@ jobs:
;;
esac
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build MMTK Ruby lib
run: >-
cd ../src/gc/mmtk &&
cargo build --release &&
ldd target/release/libmmtk_ruby.so
if: $${{ matrix.shared_gc && matrix.gc_name == 'mmtk' }}

- name: Build shared GC (${{ matrix.gc_name }})
run: |
make shared-gc SHARED_GC=${{ matrix.gc_name }} MMTK_BUILD=release
if: ${{ matrix.shared_gc }}

- name: Set test options for skipped tests
run: |
set -x
Expand All @@ -140,10 +157,25 @@ jobs:
${TESTS:+TESTS="$TESTS"}
${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }}
timeout-minutes: ${{ matrix.timeout || 40 }}
if: ${{ !matrix.shared_gc}}
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
PRECHECK_BUNDLED_GEMS: 'no'

- name: make ${{ matrix.test_task }}
run: >-
$SETARCH make -s ${{ matrix.test_task }}
${TESTS:+TESTS="$TESTS"}
${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }}
timeout-minutes: ${{ matrix.timeout || 40 }}
if: ${{ matrix.shared_gc}}
env:
RUBY_TESTOPTS: '-q --tty=no'
LD_LIBRARY_PATH: '/home/runner/work/ruby/ruby/src/gc/mmtk/target/release'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
PRECHECK_BUNDLED_GEMS: 'no'
RUBY_GC_LIBRARY: 'librubygc.${{ matrix.gc_name }}.so'

- name: make skipped tests
run: |
Expand Down
12 changes: 7 additions & 5 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,10 @@ rewindable:

HELP_EXTRA_TASKS = ""

MMTK_BUILD=debug
MMTK_LIB_PATH=-L$(srcdir)/gc/mmtk/target/$(MMTK_BUILD)
MMTK_LIB=-lmmtk_ruby

shared-gc: probes.h
$(Q) if test -z $(shared_gc_dir); then \
echo "You must configure with --with-shared-gc to use shared GC"; \
Expand All @@ -1913,16 +1917,14 @@ shared-gc: probes.h
echo "You must specify SHARED_GC with the GC to build"; \
exit 1; \
else \
$(MAKEDIRS) $(shared_gc_dir); \
echo generating $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT); \
if [ "$(SHARED_GC)" = "mmtk" ]; then \
echo generating $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT); \
$(LDSHARED) -I$(srcdir)/include -I$(srcdir) -I$(arch_hdrdir) $(XDLDFLAGS) -L$(srcdir)/gc/mmtk/target/debug -lmmtk_ruby $(cflags) -DBUILDING_SHARED_GC -fPIC -o $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT) $(srcdir)/gc/$(SHARED_GC).c; \
$(LDSHARED) -I$(srcdir)/include -I$(srcdir) -I$(arch_hdrdir) $(XDLDFLAGS) $(MMTK_LIB_PATH) $(cflags) -DBUILDING_SHARED_GC -fPIC -o $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT) $(srcdir)/gc/$(SHARED_GC).c $(MMTK_LIB); \
else \
echo generating $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT); \
$(LDSHARED) -I$(srcdir)/include -I$(srcdir) -I$(arch_hdrdir) $(XDLDFLAGS) $(cflags) -DBUILDING_SHARED_GC -fPIC -o $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT) $(srcdir)/gc/$(SHARED_GC).c; \
fi; \
fi
$(Q) $(MAKEDIRS) $(shared_gc_dir)
$(Q) $(LDSHARED) -I$(srcdir)/include -I$(srcdir) -I$(arch_hdrdir) $(XDLDFLAGS) $(cflags) -DBUILDING_SHARED_GC -fPIC -o $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT) $(srcdir)/gc/$(SHARED_GC).c

help: PHONY
$(MESSAGE_BEGIN) \
Expand Down

0 comments on commit b0d0e6f

Please sign in to comment.