Skip to content

Commit

Permalink
Merge branch 'master' into truffle-head
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed May 27, 2016
2 parents 9f1d761 + 005ec3d commit f1c4782
Show file tree
Hide file tree
Showing 27 changed files with 108 additions and 917 deletions.
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ matrix:
jdk: oraclejdk8
- env: JT=check_ambiguous_arguments SKIP_BUILD=true
jdk: oraclejdk8
- env:
- USE_BUILD_PACK=yes
- JT='test fast'
jdk: oraclejdk8
allow_failures:
- env: JT='test mri'
jdk: oraclejdk8
Expand All @@ -69,13 +73,8 @@ branches:
- /^ha-feature/
- ruby-2.4

script: tool/travis_runner.sh
install: |
if [[ -n "$PHASE" && $JAVA_HOME == *"java-8"* ]]; then
travis_retry ./mvnw package -B --projects '!truffle' -Dinvoker.skip -Dmaven.test.skip;
else
if [ -z "$SKIP_BUILD" ]; then travis_retry ./mvnw package -B -Dinvoker.skip -Dmaven.test.skip; fi
fi
install: travis_retry tool/travis-install.sh
script: tool/travis-script.sh

notifications:
irc:
Expand Down
19 changes: 12 additions & 7 deletions ci.hocon
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
jt: [ruby, tool/jt.rb]

common-setup: [
[rm, -rf, mx.jruby],
[mx, sclone, --kind, git, "https://github.com/jruby/jruby-build-pack.git", jruby-build-pack],
[cp, bin/jruby.bash, bin/jruby],
[chmod, +x, bin/jruby],
${jt} [build, --offline]
]

common: {
packages: {
git: ">=1.8.3"
Expand All @@ -10,20 +18,17 @@ common: {
}

environment: {
CI: "true"
CI: "true",
JRUBY_NO_ANT: "true"
}

setup: [
${jt} [build]
]
setup: ${common-setup}

timelimit: "30:00"
}

graal-core: {
setup: [
${jt} [bootstrap],
[rm, -rf, mx.jruby],
setup: ${common-setup} [
[mkdir, graal-workspace],
[cd, graal-workspace],
[mx, sclone, --kind, git, "https://github.com/graalvm/graal-core.git", graal-core],
Expand Down
54 changes: 29 additions & 25 deletions core/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,39 +287,43 @@
end
end

jruby_bin_config = [ 'run', { :id => 'copy',
'tasks' => {
'exec' => {
'@executable' => '/bin/sh',
'@osfamily' => 'unix',
'arg' => {
'@line' => '-c \'cp "${jruby.basedir}/bin/jruby.bash" "${jruby.basedir}/bin/jruby"\''
unless ENV['JRUBY_NO_ANT']

jruby_bin_config = [ 'run', { :id => 'copy',
'tasks' => {
'exec' => {
'@executable' => '/bin/sh',
'@osfamily' => 'unix',
'arg' => {
'@line' => '-c \'cp "${jruby.basedir}/bin/jruby.bash" "${jruby.basedir}/bin/jruby"\''
}
},
'chmod' => {
'@file' => '${jruby.basedir}/bin/jruby',
'@perm' => '755'
}
},
'chmod' => {
'@file' => '${jruby.basedir}/bin/jruby',
'@perm' => '755'
}
} } ]
} } ]

phase :clean do
plugin :antrun do
execute_goals( *jruby_bin_config )
phase :clean do
plugin :antrun do
execute_goals( *jruby_bin_config )
end
end
end

profile 'jruby.bash' do
profile 'jruby.bash' do

activation do
file( :missing => '../bin/jruby' )
end
activation do
file( :missing => '../bin/jruby' )
end

phase :initialize do
plugin :antrun do
execute_goals( *jruby_bin_config )
phase :initialize do
plugin :antrun do
execute_goals( *jruby_bin_config )
end
end
end

end

end

jni_config = [ 'unpack', { :id => 'unzip native',
Expand Down
76 changes: 0 additions & 76 deletions lib/ruby/truffle/truffle/readline.rb

This file was deleted.

1 change: 1 addition & 0 deletions maven/BUILD-PACK
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
738b3e9638783e87c34e564c9f78d65cd06a886b

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/library/readline/completion_proc_tags.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/truffle.mspec
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class MSpecScript
MSpec.disable_feature :continuation_library
MSpec.disable_feature :fork
MSpec.enable_feature :encoding
MSpec.enable_feature :readline

set :files, get(:language) + get(:core) + get(:library) + get(:truffle)
end
Expand Down
41 changes: 32 additions & 9 deletions tool/jt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ def self.find_jruby_bin_dir
end
end

def self.find_repo(name)
[JRUBY_DIR, "#{JRUBY_DIR}/.."].each do |dir|
found = Dir.glob("#{dir}/#{name}*").first
return found if found
end
raise "Can't find the #{name} repo - clone it into the repository directory or its parent"
end

def self.find_gem(name)
["#{JRUBY_DIR}/lib/ruby/gems/shared/gems", JRUBY_DIR, "#{JRUBY_DIR}/.."].each do |dir|
found = Dir.glob("#{dir}/#{name}*").first
Expand Down Expand Up @@ -267,6 +275,16 @@ def sh(*args)
def mvn(*args)
sh './mvnw', *(['-q'] + args)
end

def maven_options(*options)
maven_options = %w[-DskipTests]
offline = options.delete('--offline')
if offline
maven_options.push "-Dmaven.repo.local=#{Utilities.find_repo('jruby-build-pack')}/maven"
maven_options.push '--offline'
end
return [maven_options, options]
end

def mspec(command, *args)
env_vars = {}
Expand All @@ -288,10 +306,11 @@ module Commands

def help
puts 'jt checkout name checkout a different Git branch and rebuild'
puts 'jt bootstrap run the build system\'s bootstrap phase'
puts 'jt bootstrap [options] run the build system\'s bootstrap phase'
puts 'jt build [options] build'
puts 'jt build truffle [options] build only the Truffle part, assumes the rest is up-to-date'
puts 'jt rebuild [options] clean and build'
puts ' --offline use the build pack to build offline'
puts 'jt clean clean'
puts 'jt irb irb'
puts 'jt rebuild clean and build'
Expand Down Expand Up @@ -355,17 +374,19 @@ def checkout(branch)
rebuild
end

def bootstrap
mvn '-DskipTests', '-Pbootstrap-no-launcher'
def bootstrap(*options)
maven_options, other_options = maven_options(*options)
mvn *maven_options, '-DskipTests', '-Pbootstrap-no-launcher'
end

def build(project = nil)
opts = %w[-DskipTests]
def build(*options)
maven_options, other_options = maven_options(*options)
project = other_options.first
case project
when 'truffle'
mvn *opts, '-pl', 'truffle', 'package'
mvn *maven_options, '-pl', 'truffle', 'package'
when nil
mvn *opts, 'package'
mvn *maven_options, 'package'
else
raise ArgumentError, project
end
Expand Down Expand Up @@ -818,8 +839,9 @@ def human_size(bytes)
end
end

def tarball
mvn '-Pdist'
def tarball(*options)
maven_options, other_options = maven_options(*options)
mvn *maven_options, '-Pdist'
generated_file = "#{JRUBY_DIR}/maven/jruby-dist/target/jruby-dist-#{Utilities.jruby_version}-bin.tar.gz"
final_file = "#{JRUBY_DIR}/jruby-bin-#{Utilities.jruby_version}.tar.gz"
FileUtils.copy generated_file, final_file
Expand Down Expand Up @@ -897,6 +919,7 @@ def main(args)
when "build"
command = [args.shift]
command << args.shift if args.first == "truffle"
command << args.shift if args.first == "--offline"
send(*command)
end

Expand Down
20 changes: 20 additions & 0 deletions tool/travis-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -e
set -x

if [[ -v USE_BUILD_PACK ]]
then
git clone --depth 1 https://github.com/jruby/jruby-build-pack.git
MAVEN_CLI_OPTS="-Dmaven.repo.local=jruby-build-pack/maven --offline"
cp bin/jruby.bash bin/jruby
chmod +x bin/jruby
export JRUBY_NO_ANT=yes
fi

if [[ -n "$PHASE" && $JAVA_HOME == *"java-8"* ]]
then
./mvnw $MAVEN_CLI_OPTS package -B --projects '!truffle' -Dinvoker.skip -Dmaven.test.skip;
else
if [ -z "$SKIP_BUILD" ]; then ./mvnw $MAVEN_CLI_OPTS package -B -Dinvoker.skip -Dmaven.test.skip; fi
fi
10 changes: 8 additions & 2 deletions tool/travis_runner.sh → tool/travis-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
set -e
set -x

if [[ -v USE_BUILD_PACK ]]
then
git clone --depth 1 https://github.com/jruby/jruby-build-pack.git
MAVEN_CLI_OPTS="-Dmaven.repo.local=jruby-build-pack/maven --offline"
fi

if [[ -v PHASE ]]
then
DOWNLOAD_OUTPUT_FILTER='Download|\\[exec\\] [[:digit:]]+/[[:digit:]]+|^[[:space:]]*\\[exec\\][[:space:]]*$'
if [[ $JAVA_HOME == *"java-8"* ]]
then
./mvnw package -B --projects '!truffle' -Dinvoker.skip=false $PHASE | egrep -v "$DOWNLOAD_OUTPUT_FILTER"
./mvnw $MAVEN_CLI_OPTS package -B --projects '!truffle' -Dinvoker.skip=false $PHASE | egrep -v "$DOWNLOAD_OUTPUT_FILTER"
else
./mvnw package -B -Dinvoker.skip=false $PHASE | egrep -v "$DOWNLOAD_OUTPUT_FILTER"
./mvnw $MAVEN_CLI_OPTS package -B -Dinvoker.skip=false $PHASE | egrep -v "$DOWNLOAD_OUTPUT_FILTER"
fi

MVN_STATUS=${PIPESTATUS[0]}
Expand Down
Loading

0 comments on commit f1c4782

Please sign in to comment.