Skip to content

Conversation

mkoncek
Copy link
Contributor

@mkoncek mkoncek commented Apr 16, 2025

Fixes: #3591

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Does ./gradlew styleCheck pass ?
  3. Have you added your new test classes to an existing test suite in alphabetical order?

Changes to Existing Features:

  • Does this break existing behaviour? If so please explain.
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

@mkoncek
Copy link
Contributor Author

mkoncek commented Apr 17, 2025

As this is not a code change, i did not execute any build locally.

@davecramer
Copy link
Member

As this is not a code change, i did not execute any build locally.

is that why it is failing ?

@mkoncek
Copy link
Contributor Author

mkoncek commented Apr 17, 2025

is that why it is failing ?

I am 99 % sure, though I am not the person who set Copr builds up. It is consistent with the logs, java-17-openjdk-devel is installed before the build itself, so it must be configured from here.

@vlsi
Copy link
Member

vlsi commented Apr 17, 2025

It does not seem to fix the failure

@mkoncek
Copy link
Contributor Author

mkoncek commented Apr 17, 2025

Yeah, I noticed that. My only guess is that the Copr build uses these settings from the master branch, not from PRs.
if you look at this log and the line:

 'source_json': {'builddeps': 'git java-17-openjdk-devel python-unversioned-command',

that is exactly the content of the file that I am changing in this PR and that is what fails during the Copr build:

INFO: installing package(s): git java-17-openjdk-devel python-unversioned-command
Updating and loading repositories:
 updates                                100% | 778.3 KiB/s |  25.7 KiB |  00m00s
 fedora                                 100% | 314.5 KiB/s |  28.0 KiB |  00m00s
Repositories loaded.
Failed to resolve the transaction:
No match for argument: java-17-openjdk-devel
You can try to add to command line:
  --skip-unavailable to skip unavailable packages
WARNING: DNF5 command failed, retrying, attempt #2, sleeping 10s

@mkoncek mkoncek force-pushed the master branch 2 times, most recently from 1db1721 to ad4e33c Compare April 28, 2025 12:44
@mkoncek
Copy link
Contributor Author

mkoncek commented Apr 28, 2025

Now Copr build fails because the Gradle build somehow only accepts Java 17:

A problem occurred configuring project ':postgresql'.
> Failed to query the value of task ':postgresql:compileJava' property 'options.release'.
   > Failed to calculate the value of task ':postgresql:compileJava' property 'javaCompiler'.
      > Cannot find a Java installation on your machine (Linux 6.11.8-300.fc41.x86_64 amd64) matching: {languageVersion=17, vendor=any vendor, implementation=vendor-specific}. Toolchain download repositories have not been configured.

@vlsi
Copy link
Member

vlsi commented Apr 28, 2025

@mkoncek , we do use Java 17 by default, however, there's an option to adjust it: ./gradlew .. -PjdkBuildVersion=21 ...
Could you give it a try?

It might be time to go for Java 21 by default for the build though.

@vlsi
Copy link
Member

vlsi commented Apr 28, 2025

This is funny and not so funny at the same time:

* What went wrong:
Execution failed for task ':postgresql:compileJava'.
> Compilation failed; see the compiler output below.
  warning: [options] source value 8 is obsolete and will be removed in a future release
  warning: [options] target value 8 is obsolete and will be removed in a future release
  warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
  error: warnings found and -Werror specified

@mkoncek , could you add the following as well?

--- a/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts
+++ b/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts
@@ -62,6 +62,11 @@ tasks.configureEach<JavaCompile> {
                 }
             }
         )
+        if (buildParameters.jdkBuildVersion >= 21 && buildParameters.targetJavaVersion < 11) {
+            // We know target Java 8 is deprecated with Java 21, so silence the warning
+            // otherwise the build fails due to -Werror below
+            compilerArgs.add("-Xlint:-options")
+        }
         if (!buildParameters.enableCheckerframework) {
             compilerArgs.add("-Xlint:deprecation")
         } else {

@mkoncek
Copy link
Contributor Author

mkoncek commented Apr 29, 2025

Sure.

@vlsi
Copy link
Member

vlsi commented Apr 29, 2025

Wow. So much fun. It finally worked!

@vlsi vlsi merged commit 475812b into pgjdbc:master Apr 29, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Fedora CI seems to fail
3 participants