diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e8295961658731..dd9b9cdcfc4b9e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -36,6 +36,12 @@ jobs: - test_task: check shared_gc: true configure: '--with-shared-gc=/home/runner/ruby_gc' + gc_name: 'default' + - test_task: check + shared_gc: true + shared_gc_dir: '/home/runner/ruby_gc' + configure: '--with-shared-gc=/home/runner/ruby_gc' + gc_name: 'mmtk' - test_task: test-bundler-parallel timeout: 50 - test_task: test-bundled-gems @@ -99,7 +105,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 }} @@ -117,6 +122,20 @@ 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: | + mkdir ${{ matrix.shared_gc_dir }} && + 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 @@ -140,10 +159,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: | diff --git a/common.mk b/common.mk index 965acf6636dcf7..cf76584135c1fe 100644 --- a/common.mk +++ b/common.mk @@ -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"; \ @@ -1913,16 +1917,14 @@ shared-gc: probes.h echo "You must specify SHARED_GC with the GC to build"; \ exit 1; \ else \ + $(Q) $(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) $(MMTK_LIBS) $(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) $(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) \