Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade source and target JDK to JDK17 #2919

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: docker login
uses: docker/login-action@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/latest-bitcoind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
timeout-minutes: 90
steps:
- name: Checkout bitcoind master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: bitcoin/bitcoin
path: bitcoin
Expand All @@ -34,14 +34,14 @@ jobs:
working-directory: ./bitcoin

- name: Checkout eclair master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: eclair

- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'adopt'

- name: Configure OS settings
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'adopt'

- name: Cache Maven dependencies
Expand All @@ -31,10 +31,14 @@ jobs:
- name: Configure OS settings
run: echo "fs.file-max = 1024000" | sudo tee -a /etc/sysctl.conf

# github runner still use maven 3.8.8 :(
- name: Install maven 3.9.9
run: mvn wrapper:wrapper -Dmaven="3.9.9"

# NB: we exclude external API tests from the CI, because we don't want our build to fail because a dependency is failing.
# This means we won't automatically catch changes in external APIs, but developers should regularly run the test suite locally so in practice it shouldn't be a problem.
- name: Build with Maven
run: mvn test-compile && mvn scoverage:report -DtagsToExclude=external-api
run: ./mvnw test-compile && ./mvnw scoverage:report -DtagsToExclude=external-api

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

- [OpenJDK 11](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot).
- [OpenJDK 17](https://adoptium.net/temurin/releases/?version=17).
- [Maven](https://maven.apache.org/download.cgi) 3.6.0 or newer

## Build
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM adoptopenjdk/openjdk11:jdk-11.0.3_7-alpine as BUILD
FROM eclipse-temurin:17-alpine as BUILD

# Setup maven, we don't use https://hub.docker.com/_/maven/ as it declare .m2 as volume, we loose all mvn cache
# We can alternatively do as proposed by https://github.com/carlossg/docker-maven#packaging-a-local-repository-with-the-image
Expand Down Expand Up @@ -41,8 +41,8 @@ COPY . .
RUN mvn package -pl eclair-node -am -DskipTests -Dgit.commit.id=notag -Dgit.commit.id.abbrev=notag -o
# It might be good idea to run the tests here, so that the docker build fail if the code is bugged

# We currently use a debian image for runtime because of some jni-related issue with sqlite
FROM openjdk:11.0.4-jre-slim
# We currently use a ubuntu image for runtime because of some jni-related issue with sqlite
FROM eclipse-temurin:17-jre-noble
WORKDIR /app

# install jq for eclair-cli
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ rpcclienttimeout=30

Eclair is developed in [Scala](https://www.scala-lang.org/), a powerful functional language that runs on the JVM, and is packaged as a ZIP archive.

To run Eclair, you first need to install Java, we recommend that you use [OpenJDK 11](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot). Other runtimes also work, but we don't recommend using them.
To run Eclair, you first need to install Java, we recommend that you use [OpenJDK 17](https://adoptium.net/temurin/releases/?version=17). Other runtimes also work, but we don't recommend using them.

Then download our latest [release](https://github.com/ACINQ/eclair/releases), unzip the archive and run the following command:

Expand Down
4 changes: 2 additions & 2 deletions contrib/arm64v8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:11-jdk-jammy as BUILD
FROM eclipse-temurin:17-jdk-noble as BUILD

# Setup maven, we don't use https://hub.docker.com/_/maven/ as it declare .m2 as volume, we loose all mvn cache
# We can alternatively do as proposed by https://github.com/carlossg/docker-maven#packaging-a-local-repository-with-the-image
Expand Down Expand Up @@ -42,7 +42,7 @@ RUN mvn package -pl eclair-node -am -DskipTests -Dgit.commit.id=notag -Dgit.comm
# It might be good idea to run the tests here, so that the docker build fail if the code is bugged

# We currently use a debian image for runtime because of some jni-related issue with sqlite
FROM openjdk:11.0.4-jre-slim
FROM eclipse-temurin:17-jre-noble
WORKDIR /app

# install jq for eclair-cli
Expand Down
9 changes: 7 additions & 2 deletions docs/release-notes/eclair-vnext.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ To enable CoinGrinder at all fee rates and prevent the automatic consolidation o
consolidatefeerate=0
```

### Upgrade build and runtime platform to JDK 17

Eclair is now built with and targets JDK 17 and will no longer run on JDK11.


### Incoming obsolete channels will be rejected

Eclair will not allow remote peers to open new `static_remote_key` channels. These channels are obsolete, node operators should use `option_anchors` channels now.
Expand Down Expand Up @@ -68,7 +73,7 @@ $ sha256sum -c SHA256SUMS.stripped
Eclair builds are deterministic. To reproduce our builds, please use the following environment (*):

- Ubuntu 22.04
- AdoptOpenJDK 11.0.22
- AdoptOpenJDK 17.0.12
- Maven 3.9.2

Use the following command to generate the eclair-node package:
Expand All @@ -79,7 +84,7 @@ mvn clean install -DskipTests

That should generate `eclair-node/target/eclair-node-<version>-XXXXXXX-bin.zip` with sha256 checksums that match the one we provide and sign in `SHA256SUMS.asc`

(*) You may be able to build the exact same artefacts with other operating systems or versions of JDK 11, we have not tried everything.
(*) You may be able to build the exact same artefacts with other operating systems or versions of JDK 17, we have not tried everything.

## Upgrading

Expand Down
13 changes: 11 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
<properties>
<project.build.outputTimestamp>2020-01-01T00:00:00Z</project.build.outputTimestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>
<scala.version>2.13.11</scala.version>
<scala.version.short>2.13</scala.version.short>
<akka.version>2.6.20</akka.version>
Expand Down Expand Up @@ -101,6 +100,11 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-wrapper-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -141,6 +145,7 @@
<arg>-Werror</arg>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-release:17</arg>
</args>
<jvmArgs>
<jvmArg>-Xmx1024m</jvmArg>
Expand Down Expand Up @@ -215,6 +220,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-wrapper-plugin</artifactId>
</plugin>
<!-- disable surefire -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Loading