Skip to content

Commit

Permalink
Merge pull request jruby#8437 from enebo/api3
Browse files Browse the repository at this point in the history
context through RubyArray using more API
  • Loading branch information
enebo authored Nov 21, 2024
2 parents 6c28127 + 73aeb8e commit 274cedd
Show file tree
Hide file tree
Showing 98 changed files with 1,625 additions and 1,450 deletions.
120 changes: 60 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
strategy:
matrix:
target: ['test:jruby:int', 'spec:ruby:fast', 'spec:ji', 'spec:ffi']
java-version: ['17', '21', '23']
java-version: ['21', '23']
fail-fast: false

name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }})

steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
Expand All @@ -39,26 +39,26 @@ jobs:
- name: rake ${{ matrix.target }}
run: bin/jruby -S rake ${{ matrix.target }}

rake-test-17:
rake-test-21:
runs-on: ubuntu-latest

strategy:
matrix:
target: ['test:mri:core:jit', 'test:mri:extra', 'spec:ruby:fast:jit', 'test:mri:stdlib', 'spec:ruby:slow', 'spec:ruby:debug', 'test:jruby:aot', 'test:slow_suites', 'spec:compiler', 'spec:regression', 'spec:jruby', 'spec:jrubyc', 'spec:profiler']
fail-fast: false

name: rake ${{ matrix.target }} (Java 17)
name: rake ${{ matrix.target }} (Java 21)

steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
java-version: '21'
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -79,13 +79,13 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
java-version: 21
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -94,13 +94,13 @@ jobs:
- name: rake test:jruby
run: bin/jruby --dev -S rake test:jruby

rake-test-17-indy:
rake-test-21-indy:
runs-on: ubuntu-latest

strategy:
matrix:
target: ['test:mri:core:jit', 'test:jruby:jit', 'spec:compiler', 'spec:ruby:fast:jit', 'spec:ji']
java-version: ['17', '21', '23']
java-version: ['21', '23']
fail-fast: false

name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }} +indy)
Expand All @@ -111,8 +111,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
Expand All @@ -132,16 +132,16 @@ jobs:
strategy:
matrix:
package-flags: ['-Pmain', '-Pdist', '-Pcomplete', '-Posgi', '-Ptest', '-Pmain,test -Dinvoker.test=extended']
java-version: [17, 21, 23]
java-version: [21, 23]
fail-fast: false

name: mvn ${{ matrix.package-flags }} (Java ${{ matrix.java-version }})

steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
Expand All @@ -163,7 +163,7 @@ jobs:
strategy:
matrix:
package-flags: ['-Pjruby-jars', '-Pjruby-jars,test -Dinvoker.test=extended', '-Pjruby_complete_jar_extended -Dinvoker.skip=true']
java-version: [17, 21, 23]
java-version: [21, 23]
fail-fast: false


Expand All @@ -172,8 +172,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -201,13 +201,13 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -222,7 +222,7 @@ jobs:
strategy:
fail-fast: false

name: mvn -Ptest, rake test:jruby (Windows, Java 17)
name: mvn -Ptest, rake test:jruby (Windows, Java 21)

env:
JAVA_OPTS: "-Djdk.io.File.enableADS=true"
Expand All @@ -231,11 +231,11 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: set up java 17
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -256,13 +256,13 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
java-version: '21'
cache: 'maven'
- name: dependency convergence
run: tool/maven-ci-script.sh
Expand All @@ -279,13 +279,13 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21
cache: 'maven'
- name: maven-ci-script.sh
run: tool/maven-ci-script.sh
Expand Down Expand Up @@ -316,13 +316,13 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
java-version: 21
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -340,13 +340,13 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
java-version: 21
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -361,7 +361,7 @@ jobs:
# strategy:
# matrix:
# package-flags: ['-Ptest']
# # dist, complete, and osgi do not pass on 17 yet
# # dist, complete, and osgi do not pass on 21 yet
# java-version: ['11']
# fail-fast: false
#
Expand Down Expand Up @@ -398,7 +398,7 @@ jobs:
# - name: Bootstrap build
# uses: jruby/jruby-ci-build@fbd2cf981aaff3eae190ac20086fa161be3d9060
# with:
# java-version: 17
# java-version: 21
# - name: set up java ${{ matrix.java-version }}
# uses: actions/setup-java@v3
# with:
Expand All @@ -410,21 +410,21 @@ jobs:
## run: "bin/jruby -S rake ${{ matrix.target }}"
# run: "true"

maven-test-openj9-17:
maven-test-openj9-21:
runs-on: ubuntu-latest

name: mvn -Ptest (OpenJ9 Java 17)
name: mvn -Ptest (OpenJ9 Java 21)

steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: 'semeru'
java-version: '17'
java-version: '21'
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -435,26 +435,26 @@ jobs:
env:
PHASE: 'package -Ptest'

rake-test-wip-17:
rake-test-wip-21:
runs-on: ubuntu-latest

strategy:
matrix:
target: ['test:mri:core_wip', 'test:mri:stdlib_wip']
fail-fast: false

name: rake ${{ matrix.target }} (Java 17)
name: rake ${{ matrix.target }} (Java 21)

steps:
- name: checkout
uses: actions/checkout@v3
- name: remove default java except 17
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-21-jdk
- name: set up java 17
- name: remove default java except 21
run: sudo apt remove temurin-8-jdk temurin-11-jdk temurin-17-jdk
- name: set up java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
java-version: '21'
cache: 'maven'
- name: bootstrap
run: mvn -Pbootstrap clean package
Expand All @@ -469,7 +469,7 @@ jobs:
permissions:
contents: none
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/jruby-9.5' }}
needs: [mvn-test, mvn-test-extended, mvn-test-windows, dependency-check, rake-test, rake-test-17-indy, rake-test-17, test-versions, sequel, concurrent-ruby, jruby-tests-dev, regression-specs-jit]
needs: [mvn-test, mvn-test-extended, mvn-test-windows, dependency-check, rake-test, rake-test-21-indy, rake-test-21, test-versions, sequel, concurrent-ruby, jruby-tests-dev, regression-specs-jit]
uses: jruby/jruby/.github/workflows/snapshot-publish.yml@6cd0d4d96d9406635183d81cf91acc82cd78245f
secrets:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Expand Down
15 changes: 1 addition & 14 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private Status internalRun() {
return doCheckSyntax(runtime, in, filename);
} else {
// proceed to run the script
doRunFromMain(runtime, in, filename);
runtime.runFromMain(in, filename);
}
status = new Status();
} finally {
Expand Down Expand Up @@ -392,12 +392,6 @@ private Status handleMainExit(MainExitException mee) {
return new Status(mee.getStatus());
}

private void doRunFromMain(Ruby runtime, InputStream in, String filename) {
doCheckSecurityManager();

runtime.runFromMain(in, filename);
}

private Status doCheckSyntax(Ruby runtime, InputStream in, String filename) throws RaiseException {
// check primary script
boolean status = checkStreamSyntax(runtime, in, filename);
Expand Down Expand Up @@ -522,13 +516,6 @@ private static void doGCJCheck() {
}
}

private void doCheckSecurityManager() {
if (Main.class.getClassLoader() == null && System.getSecurityManager() != null) {
System.err.println("Warning: security manager and JRuby running from boot classpath.\n" +
"Run from jruby.jar or set env VERIFY_JRUBY=true to enable security.");
}
}

/**
* This is only used from the main(String[]) path, in which case the err for this
* run should be System.err. In order to avoid the Ruby err being closed and unable
Expand Down
Loading

0 comments on commit 274cedd

Please sign in to comment.