Skip to content

Commit b0d0e6f

Browse files
Add MMTk GC Module to Ubuntu CI
1 parent 0a85765 commit b0d0e6f

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

Diff for: .github/workflows/ubuntu.yml

+33-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
- test_task: check
3535
configure: '--enable-shared --enable-load-relative'
3636
- test_task: check
37+
gc_name: 'default'
38+
shared_gc: true
39+
configure: '--with-shared-gc=/home/runner/ruby_gc'
40+
- test_task: check
41+
gc_name: 'mmtk'
3742
shared_gc: true
3843
configure: '--with-shared-gc=/home/runner/ruby_gc'
3944
- test_task: test-bundler-parallel
@@ -99,7 +104,6 @@ jobs:
99104

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

@@ -117,6 +121,19 @@ jobs:
117121
;;
118122
esac
119123
124+
- uses: actions-rust-lang/setup-rust-toolchain@v1
125+
- name: Build MMTK Ruby lib
126+
run: >-
127+
cd ../src/gc/mmtk &&
128+
cargo build --release &&
129+
ldd target/release/libmmtk_ruby.so
130+
if: $${{ matrix.shared_gc && matrix.gc_name == 'mmtk' }}
131+
132+
- name: Build shared GC (${{ matrix.gc_name }})
133+
run: |
134+
make shared-gc SHARED_GC=${{ matrix.gc_name }} MMTK_BUILD=release
135+
if: ${{ matrix.shared_gc }}
136+
120137
- name: Set test options for skipped tests
121138
run: |
122139
set -x
@@ -140,10 +157,25 @@ jobs:
140157
${TESTS:+TESTS="$TESTS"}
141158
${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }}
142159
timeout-minutes: ${{ matrix.timeout || 40 }}
160+
if: ${{ !matrix.shared_gc}}
161+
env:
162+
RUBY_TESTOPTS: '-q --tty=no'
163+
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
164+
PRECHECK_BUNDLED_GEMS: 'no'
165+
166+
- name: make ${{ matrix.test_task }}
167+
run: >-
168+
$SETARCH make -s ${{ matrix.test_task }}
169+
${TESTS:+TESTS="$TESTS"}
170+
${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }}
171+
timeout-minutes: ${{ matrix.timeout || 40 }}
172+
if: ${{ matrix.shared_gc}}
143173
env:
144174
RUBY_TESTOPTS: '-q --tty=no'
175+
LD_LIBRARY_PATH: '/home/runner/work/ruby/ruby/src/gc/mmtk/target/release'
145176
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
146177
PRECHECK_BUNDLED_GEMS: 'no'
178+
RUBY_GC_LIBRARY: 'librubygc.${{ matrix.gc_name }}.so'
147179

148180
- name: make skipped tests
149181
run: |

Diff for: common.mk

+7-5
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,10 @@ rewindable:
19051905

19061906
HELP_EXTRA_TASKS = ""
19071907

1908+
MMTK_BUILD=debug
1909+
MMTK_LIB_PATH=-L$(srcdir)/gc/mmtk/target/$(MMTK_BUILD)
1910+
MMTK_LIB=-lmmtk_ruby
1911+
19081912
shared-gc: probes.h
19091913
$(Q) if test -z $(shared_gc_dir); then \
19101914
echo "You must configure with --with-shared-gc to use shared GC"; \
@@ -1913,16 +1917,14 @@ shared-gc: probes.h
19131917
echo "You must specify SHARED_GC with the GC to build"; \
19141918
exit 1; \
19151919
else \
1920+
$(MAKEDIRS) $(shared_gc_dir); \
1921+
echo generating $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT); \
19161922
if [ "$(SHARED_GC)" = "mmtk" ]; then \
1917-
echo generating $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT); \
1918-
$(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; \
1923+
$(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); \
19191924
else \
1920-
echo generating $(shared_gc_dir)librubygc.$(SHARED_GC).$(SOEXT); \
19211925
$(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; \
19221926
fi; \
19231927
fi
1924-
$(Q) $(MAKEDIRS) $(shared_gc_dir)
1925-
$(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
19261928

19271929
help: PHONY
19281930
$(MESSAGE_BEGIN) \

0 commit comments

Comments
 (0)