From a2c3874490cc7cd4e5a651be6bba68870a6d87e0 Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Thu, 17 Mar 2022 19:46:07 -0700 Subject: [PATCH] [do not merge] test on additional JDKs --- .github/workflows/ci.yaml | 168 ++++++++++++++++++ .../dotty/tools/dotc/profile/Profiler.scala | 1 + library/src/scala/runtime/LazyVals.scala | 1 + 3 files changed, 170 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 88e7e4ebc9e5..9eb8368d4a6b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -463,6 +463,174 @@ jobs: ./project/scripts/cmdTests ./project/scripts/bootstrappedOnlyCmdTests + test_java11: + runs-on: [self-hosted, Linux] + container: + image: lampepfl/dotty:2021-03-22 + options: --cpu-shares 4096 + volumes: + - ${{ github.workspace }}/../../cache/sbt:/root/.sbt + - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache + - ${{ github.workspace }}/../../cache/general:/root/.cache + + if: "( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_java11]') + )" + + steps: + - name: Install JDK 11 + run: apt-get update && apt-get install -y openjdk-11-jdk-headless + + - name: Set JDK 11 as default + run: echo "/usr/lib/jvm/java-11-openjdk-amd64/bin" >> $GITHUB_PATH + + - name: Reset existing repo + run: git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/lampepfl/dotty" && git reset --hard FETCH_HEAD || true + + - name: Checkout cleanup script + uses: actions/checkout@v2 + + - name: Cleanup + run: .github/workflows/cleanup.sh + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Add SBT proxy repositories + run: cp -vf .github/workflows/repositories /root/.sbt/ ; true + + - name: Test + run: | + ./project/scripts/sbt "scala3-bootstrapped/compile; scala3-bootstrapped/testOnly dotty.tools.repl.Disassemb* dotty.tools.repl.Javap* dotty.tools.repl.Asmp*" + + test_java15: + runs-on: [self-hosted, Linux] + container: + image: lampepfl/dotty:2021-03-22 + options: --cpu-shares 4096 + volumes: + - ${{ github.workspace }}/../../cache/sbt:/root/.sbt + - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache + - ${{ github.workspace }}/../../cache/general:/root/.cache + + if: "( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_java15]') + )" + + steps: + - name: Install JDK 15 + run: apt-get update && apt-get install -y openjdk-15-jdk-headless + + - name: Set JDK 15 as default + run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH + + - name: Reset existing repo + run: git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/lampepfl/dotty" && git reset --hard FETCH_HEAD || true + + - name: Checkout cleanup script + uses: actions/checkout@v2 + + - name: Cleanup + run: .github/workflows/cleanup.sh + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Add SBT proxy repositories + run: cp -vf .github/workflows/repositories /root/.sbt/ ; true + + - name: Test + run: | + ./project/scripts/sbt "scala3-bootstrapped/compile; scala3-bootstrapped/testOnly dotty.tools.repl.Disassemb* dotty.tools.repl.Javap* dotty.tools.repl.Asmp*" + + test_java17: + runs-on: [self-hosted, Linux] + container: + image: lampepfl/dotty:2021-03-22 + options: --cpu-shares 4096 + volumes: + - ${{ github.workspace }}/../../cache/sbt:/root/.sbt + - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache + - ${{ github.workspace }}/../../cache/general:/root/.cache + + if: "( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_java17]') + )" + + steps: + - name: Install JDK 17 + run: apt-get update && apt-get install -y openjdk-17-jdk-headless + + - name: Set JDK 17 as default + run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH + + - name: Reset existing repo + run: git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/lampepfl/dotty" && git reset --hard FETCH_HEAD || true + + - name: Checkout cleanup script + uses: actions/checkout@v2 + + - name: Cleanup + run: .github/workflows/cleanup.sh + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Add SBT proxy repositories + run: cp -vf .github/workflows/repositories /root/.sbt/ ; true + + - name: Test + run: | + ./project/scripts/sbt "scala3-bootstrapped/compile; scala3-bootstrapped/testOnly dotty.tools.repl.Disassemb* dotty.tools.repl.Javap* dotty.tools.repl.Asmp*" + + test_java18: + runs-on: [self-hosted, Linux] + container: + image: lampepfl/dotty:2021-03-22 + options: --cpu-shares 4096 + volumes: + - ${{ github.workspace }}/../../cache/sbt:/root/.sbt + - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache + - ${{ github.workspace }}/../../cache/general:/root/.cache + + if: "( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_java18]') + )" + + steps: + - name: Install JDK 18 + run: curl https://download.java.net/java/GA/jdk18/43f95e8614114aeaa8e8a5fcf20a682d/36/GPL/openjdk-18_linux-x64_bin.tar.gz | tar -C /usr/lib/jvm -xzf - + + - name: Set JDK 18 as default + run: echo "/usr/lib/jvm/jdk-18/bin" >> $GITHUB_PATH + + - name: Reset existing repo + run: git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/lampepfl/dotty" && git reset --hard FETCH_HEAD || true + + - name: Checkout cleanup script + uses: actions/checkout@v2 + + - name: Cleanup + run: .github/workflows/cleanup.sh + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Add SBT proxy repositories + run: cp -vf .github/workflows/repositories /root/.sbt/ ; true + + - name: Test + run: | + ./project/scripts/sbt "scala3-bootstrapped/compile; scala3-bootstrapped/testOnly dotty.tools.repl.Disassemb* dotty.tools.repl.Javap* dotty.tools.repl.Asmp*" + publish_nightly: runs-on: [self-hosted, Linux] container: diff --git a/compiler/src/dotty/tools/dotc/profile/Profiler.scala b/compiler/src/dotty/tools/dotc/profile/Profiler.scala index ae86713a378c..27d09d64228e 100644 --- a/compiler/src/dotty/tools/dotc/profile/Profiler.scala +++ b/compiler/src/dotty/tools/dotc/profile/Profiler.scala @@ -123,6 +123,7 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context) } private def readHeapUsage() = RealProfiler.memoryMx.getHeapMemoryUsage.getUsed + @annotation.nowarn("cat=deprecation") private def doGC: Unit = { System.gc() System.runFinalization() diff --git a/library/src/scala/runtime/LazyVals.scala b/library/src/scala/runtime/LazyVals.scala index 85ca4f5cb3a0..67d5298ceefe 100644 --- a/library/src/scala/runtime/LazyVals.scala +++ b/library/src/scala/runtime/LazyVals.scala @@ -100,6 +100,7 @@ object LazyVals { } def getOffset(clz: Class[_], name: String): Long = { + @annotation.nowarn("cat=deprecation") val r = unsafe.objectFieldOffset(clz.getDeclaredField(name)) if (debug) println(s"getOffset($clz, $name) = $r")