Skip to content

Commit

Permalink
Showing 6 changed files with 16 additions and 18 deletions.
12 changes: 6 additions & 6 deletions mx.jruby/mx_jruby.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ def __init__(self, suite, name, deps, workingSets, theLicense, **args):
def source_dirs(self):
return []

def output_dir(self):
def output_dir(self, relative=False):
dir = os.path.join(_suite.dir, self.prefix)
return dir.rstrip('/')

@@ -101,23 +101,23 @@ def build(self):
maven_version_arg = '-Dtruffle.version=' + truffle_commit
maven_repo_arg = '-Dmaven.repo.local=' + mavenDir

mx.run_mx(['maven-install', '--repo', mavenDir], suite=truffle)
mx.run_mx(['maven-install', '--repo', mavenDir, '--only', 'TRUFFLE_API,TRUFFLE_DEBUG'], suite=truffle)

open(os.path.join(rubyDir, 'VERSION'), 'w').write('graal-vm\n')

# Build jruby-truffle

env = {'JRUBY_BUILD_MORE_QUIET': 'true'}

mx.run_maven(['--version', maven_repo_arg], nonZeroIsFatal=False, cwd=rubyDir, env=env)
mx.run_maven(['-q', '--version', maven_repo_arg], nonZeroIsFatal=False, cwd=rubyDir, env=env)

mx.log('Building without tests')

mx.run_maven(['-DskipTests', maven_version_arg, maven_repo_arg], cwd=rubyDir, env=env)
mx.run_maven(['-q', '-DskipTests', maven_version_arg, maven_repo_arg], cwd=rubyDir, env=env)

mx.log('Building complete version')

mx.run_maven(['-Pcomplete', '-DskipTests', maven_version_arg, maven_repo_arg], cwd=rubyDir, env=env)
mx.run_maven(['-q', '-Pcomplete', '-DskipTests', maven_version_arg, maven_repo_arg], cwd=rubyDir, env=env)
mx.run(['zip', '-d', 'maven/jruby-complete/target/jruby-complete-graal-vm.jar', 'META-INF/jruby.home/lib/*'], cwd=rubyDir)
mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'], cwd=rubyDir)
mx.log('...finished build of {}'.format(self.subject))
@@ -126,7 +126,7 @@ def clean(self, forBuild=False):
if forBuild:
return
rubyDir = _suite.dir
mx.run_maven(['clean'], nonZeroIsFatal=False, cwd=rubyDir)
mx.run_maven(['-q', 'clean'], nonZeroIsFatal=False, cwd=rubyDir)

class RubyBenchmarkSuite(mx_benchmark.BenchmarkSuite):
def group(self):
2 changes: 1 addition & 1 deletion mx.jruby/suite.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
# GNU Lesser General Public License version 2.1

suite = {
"mxversion": "5.6.6",
"mxversion": "5.31.4",
"name": "jrubytruffle",
"defaultLicense": "EPL",

Original file line number Diff line number Diff line change
@@ -73,6 +73,7 @@ public void dispose() {

private Source loadSource(String source, String name) {
return Source.fromText(source, name).withMimeType(RubyLanguage.MIME_TYPE);
//return Source.newBuilder(source).name(name).mimeType(RubyLanguage.MIME_TYPE).build();
}

}
Original file line number Diff line number Diff line change
@@ -1438,7 +1438,7 @@ private String getFullPath(final String featureString) {
final Source source = getContext().getCallStack().getCallerFrameIgnoringSend().getCallNode().getEncapsulatingSourceSection().getSource();
String result;
if (source.getPath() == null) {
result = source.getShortName();
result = null;
} else {
result = source.getPath();
}
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import com.oracle.truffle.api.source.Source;
import org.jruby.Ruby;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.RubyLanguage;
import org.jruby.truffle.core.string.StringOperations;

import java.io.File;
@@ -37,7 +38,7 @@ public SourceLoader(RubyContext context) {

public Source load(String canonicalPath) throws IOException {
if (canonicalPath.equals("-e")) {
return loadInlineScript();
return loadFragment(new String(context.getJRubyRuntime().getInstanceConfig().inlineScript(), StandardCharsets.UTF_8), "-e");
} else if (canonicalPath.startsWith(TRUFFLE_SCHEME) || canonicalPath.startsWith(JRUBY_SCHEME)) {
return loadResource(canonicalPath);
} else {
@@ -46,18 +47,13 @@ public Source load(String canonicalPath) throws IOException {
throw new IOException("Can't read file " + canonicalPath);
}
return Source.fromFileName(canonicalPath);
//return Source.newBuilder(new File(canonicalPath)).build();
}
}

public Source loadFragment(String fragment, String name) {
return Source.fromText(
fragment,
name);
}

private Source loadInlineScript() {
return Source.fromText(new String(context.getJRubyRuntime().getInstanceConfig().inlineScript(),
StandardCharsets.UTF_8), "-e");
return Source.fromText(fragment, name);
//return Source.newBuilder(fragment).name(name).mimeType(RubyLanguage.MIME_TYPE).build();
}

private Source loadResource(String path) throws IOException {
@@ -86,6 +82,7 @@ private Source loadResource(String path) throws IOException {
}

return Source.fromReader(new InputStreamReader(stream, StandardCharsets.UTF_8), path);
//return Source.newBuilder(new InputStreamReader(stream, StandardCharsets.UTF_8)).name(path).mimeType(RubyLanguage.MIME_TYPE).build();
}

}
Original file line number Diff line number Diff line change
@@ -1131,7 +1131,7 @@ private String getSourcePath(SourceSection sourceSection) {
final String path = source.getPath();

if (path == null) {
return source.getShortName();
throw new UnsupportedOperationException();
}

return path;

0 comments on commit 0f69663

Please sign in to comment.