Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 53907672bb45
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5c66685f614c
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 14, 2015

  1. [Truffle] Use simple getResourceAsStream to load the core library.

    LoadService doesn't seem to work when Truffle is on the boot class path.
    chrisseaton committed Jun 14, 2015
    Copy the full SHA
    b550439 View commit details
  2. Copy the full SHA
    5c66685 View commit details
Showing with 11 additions and 6 deletions.
  1. +5 −0 bin/jruby.bash
  2. +4 −0 bin/jruby.sh
  3. +2 −6 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
5 changes: 5 additions & 0 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -146,6 +146,11 @@ for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do
JRUBY_ALREADY_ADDED=true
done

# The Truffle jar always needs to be on the boot classpath so that the VM can
# substitute classes. We add it even if the jar isn't necessarily available,
# but this doesn't cause any problems.
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"

if $cygwin; then
JRUBY_CP=`cygpath -p -w "$JRUBY_CP"`
fi
4 changes: 4 additions & 0 deletions bin/jruby.sh
Original file line number Diff line number Diff line change
@@ -107,6 +107,10 @@ for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do
JRUBY_ALREADY_ADDED=true
done

# The Truffle jar always needs to be on the boot classpath so that the VM can
# substitute classes. We add it even if the jar isn't necessarily available,
# but this doesn't cause any problems.
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"

# ----- Set Up The System Classpath -------------------------------------------

Original file line number Diff line number Diff line change
@@ -640,17 +640,13 @@ public void loadRubyCore(String fileName, String prefix) {
}

public InputStream getRubyCoreInputStream(String fileName) {
final LoadServiceResource resource = context.getRuntime().getLoadService().getClassPathResource(getClass().getClassLoader(), fileName);
final InputStream resource = getClass().getResourceAsStream("/" + fileName);

if (resource == null) {
throw new RuntimeException("couldn't load Truffle core library " + fileName);
}

try {
return resource.getInputStream();
} catch (IOException e) {
throw new RuntimeException(e);
}
return resource;
}

public void initializeEncodingConstants() {