Skip to content

Commit

Permalink
Showing 2 changed files with 62 additions and 5 deletions.
23 changes: 19 additions & 4 deletions bin/jruby-cext-c
Original file line number Diff line number Diff line change
@@ -13,17 +13,22 @@
require 'yaml'

SULONG_DIR = ENV['SULONG_DIR']
USE_SYSTEM_CLANG = ENV['USE_SYSTEM_CLANG']

unless SULONG_DIR
abort 'You need to set SULONG_DIR to the location of a built checkout of the Sulong repository'
end

def sh(*args)
puts "$ #{args.join(' ')}"
abort unless system(*args)
end

def mx(*args)
command = ['mx', '-p', SULONG_DIR]
command.push *['--java-home', ENV['JVMCI_JAVA_HOME']] if ENV['JVMCI_JAVA_HOME']
command.push *args
puts "$ #{command.join(' ')}"
abort unless system(*command)
sh *command
end

cext_dir = ARGV[0]
@@ -54,8 +59,18 @@ lls = []

src.each do |src|
ll = File.join(File.dirname(out), File.basename(src, '.*') + '.ll')
mx 'su-clang', "-I#{SULONG_DIR}/include", '-Ilib/ruby/truffle/cext', '-S', '-emit-llvm', *ARGV.drop(1), src, '-o', ll
mx 'su-opt', '-S', '-mem2reg', ll, '-o', ll

clang_args = ["-I#{SULONG_DIR}/include", '-Ilib/ruby/truffle/cext', '-S', '-emit-llvm', *ARGV.drop(1), src, '-o', ll]
opt_args = ['-S', '-mem2reg', ll, '-o', ll]

if USE_SYSTEM_CLANG
sh 'clang', *clang_args
sh 'opt', *opt_args
else
mx 'su-clang', *clang_args
mx 'su-opt', *opt_args
end

lls.push ll
end

44 changes: 43 additions & 1 deletion ci.hocon
Original file line number Diff line number Diff line change
@@ -244,16 +244,58 @@ test-gems: {
]
}

test-cexts: {
packages: {
llvm: "==3.3"
}

downloads: {
JVMCI_JAVA_HOME: {
name: labsjdk,
version: "8u92-jvmci-0.16",
platformspecific: true
}
}

setup: ${common-setup} [
[mv, mx.jruby, temp_mx],
[mkdir, sulong-workspace],
[cd, sulong-workspace],
[mx, sclone, --kind, git, "https://github.com/graalvm/sulong.git", sulong],
[cd, sulong],
[mx, sforceimports],
[mx, --java-home, "$JVMCI_JAVA_HOME", build],
[cd, ../..],
[mv, temp_mx, mx.jruby]
[mx, sclone, --kind, git, "https://github.com/jruby/jruby-truffle-gem-test-pack.git", jruby-truffle-gem-test-pack]
]

environment: {
GEM_HOME: jruby-truffle-gem-test-pack/gems
GRAAL_HOME: sulong-workspace/sulong,
SULONG_DIR: sulong-workspace/sulong,
USE_SYSTEM_CLANG: "true",
HOST_VM: server,
HOST_VM_CONFIG: graal-core
}

run: [
${jt} [test, specs, --graal, ":capi"],
${jt} [test, cexts]
]
}

builds: [
{name: ruby-test-fast} ${common} ${gate-caps} {run: [${jt} [test, fast]]},
{name: ruby-test-tck} ${common} ${gate-caps} {run: [${jt} [test, tck]]},
{name: ruby-test-specs-command-line} ${common} ${gate-caps} {run: [${jt} [test, specs, ":command_line"]]},
{name: ruby-test-specs-language} ${common} ${gate-caps} {run: [${jt} [test, specs, ":language"]]},
{name: ruby-test-specs-core} ${common} ${gate-caps} {run: [${jt} [test, specs, ":core"]]},
{name: ruby-test-specs-library} ${common} ${gate-caps} {run: [${jt} [test, specs, ":library"]]},
{name: ruby-test-specs-truffle} ${common} ${gate-caps} {run: [${jt} [test, specs, ":truffle"]]},
{name: ruby-test-integration} ${common} ${gate-caps} {run: [${jt} [test, integration]]},
{name: ruby-test-cexts} ${common} ${gate-caps} ${test-cexts},
{name: ruby-test-gems} ${common} ${gate-caps} ${test-gems},
{name: ruby-test-tck} ${common} ${gate-caps} {run: [${jt} [test, tck]]},
{name: ruby-test-tarball} ${common} ${gate-caps} {run: [${jt} [tarball]]},

{name: ruby-test-compiler-graal-core} ${common} ${graal-core} ${gate-caps} {run: [${jt} [test, compiler]]},

0 comments on commit 76f8c71

Please sign in to comment.