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

Docker-build of evmtool fails #8310

Closed
holiman opened this issue Feb 16, 2025 · 8 comments
Closed

Docker-build of evmtool fails #8310

holiman opened this issue Feb 16, 2025 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@holiman
Copy link

holiman commented Feb 16, 2025

After the gradle-update (#8294), building evmtool in docker fails for me.

Example Dockerfile

FROM ubuntu:24.04

RUN apt-get update -q && apt-get install -qy --no-install-recommends git ca-certificates \
  openjdk-21-jre-headless=21* libjemalloc-dev=5.* 
RUN git clone https://github.com/hyperledger/besu.git --depth 1 #--recurse-submodules
RUN cd besu && ./gradlew --parallel ethereum:evmtool:installDist
RUN mkdir /out && mv besu/ethereum/evmtool/build/install/evmtool /out/evmtool

ENTRYPOINT ["/bin/bash"]

Error:

martin@worknuk:~/workspace/goevmlab/docker$ docker build -f Dockerfile.besu  . 
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  16.38kB
Step 1/6 : FROM ubuntu:24.04
 ---> a04dc4851cbc
Step 2/6 : RUN apt-get update -q && apt-get install -qy --no-install-recommends git ca-certificates   openjdk-21-jre-headless=21* libjemalloc-dev=5.*
 ---> Using cache
 ---> 65912787c70a
Step 3/6 : RUN git clone https://github.com/hyperledger/besu.git --depth 1 #--recurse-submodules
 ---> Using cache
 ---> 420e23fac743
Step 4/6 : RUN cd besu && ./gradlew --parallel ethereum:evmtool:installDist
 ---> Running in e3f165d04f39
Downloading https://services.gradle.org/distributions/gradle-8.11-bin.zip
.............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............
90%.............100%
Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :
Generating project version as supplied is version not semver: unspecified
[Incubating] Problems report is available at: file:///besu/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.


FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':besu:compileJava'.
> Failed to query the value of extension 'errorprone' property 'enabled'.
   > Failed to calculate the value of task ':besu:compileJava' property 'javaCompiler'.
      > 


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

BUILD FAILED in 1m 22s

For more on this, please refer to https://docs.gradle.org/8.11/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
The command '/bin/sh -c cd besu && ./gradlew --parallel ethereum:evmtool:installDist' returned a non-zero code: 1

Here is the problem report: problem.html.txt . It's a html-file, but I had to rename it to txt to make github accept it.
Not sure if the deprecations reported in the report are the problem, or if it's something other related to gradle (e.g like gradle/gradle#30499 )

@holiman holiman added the bug Something isn't working label Feb 16, 2025
@macfarla
Copy link
Contributor

thanks for reporting. Fixed most of the deprecation warnings in this PR #8295 which has been merged

will this PR help? #8304

@holiman
Copy link
Author

holiman commented Feb 17, 2025

thanks for reporting. Fixed most of the deprecation warnings in this PR #8295 which has been merged

Thanks! Much better, see attached problems-report.html.txt

However, these deprecation warnings seems to be just warnings about upcoming changes for version 9. I'm not sure they are actually related to the build failure,

Could not determine the dependencies of task ':besu:compileJava'.
> Failed to query the value of extension 'errorprone' property 'enabled'.
   > Failed to calculate the value of task ':besu:compileJava' property 'javaCompiler'.
      > Toolchain installation '/usr/lib/jvm/java-21-openjdk-amd64' does not provide the required capabilities: [JAVA_COMPILER]

(I seem now that the last part of this message for some reason was omitted from my original problem description above. Strange)

will this PR help? #8304

In general probably yes, but in this particular bug-report, no, the one I'm using is already at 24.04.

@macfarla
Copy link
Contributor

have you tried restarting gradle, clearing cache etc? Reading gradle/gradle#30499 that seemed to fix the issue for folks?

@holiman
Copy link
Author

holiman commented Feb 17, 2025

This seems to be the problem

root@a745e59c1469:/besu# ./gradlew -q javaToolchains
Generating project version as supplied is version not semver: unspecified

 + Options
     | Auto-detection:     Enabled
     | Auto-download:      Enabled

 + Ubuntu JRE 21.0.6+7-Ubuntu-124.04.1
     | Location:           /usr/lib/jvm/java-21-openjdk-amd64
     | Language Version:   21
     | Vendor:             Ubuntu
     | Architecture:       amd64
     | Is JDK:             false
     | Detected by:        Current JVM

Namely, the is JDK: false.

@holiman
Copy link
Author

holiman commented Feb 17, 2025

And yes, I've tried cleaining caches and the various things in that issue

@holiman
Copy link
Author

holiman commented Feb 17, 2025

Hm. I don't find any javac on there. But how did that ever work, and what broke it? Did gradle switch from automatically downloading a javac to not doing that?

@holiman
Copy link
Author

holiman commented Feb 17, 2025

I can make it work if I switch from installing openjdk-21-jre-headless=21* to openjdk-21-jdk-headless=21*. Both the main dockerfile and the evmtool dockerfile seems to get by with installing only the jre.

No idea how this works.

@macfarla macfarla self-assigned this Feb 17, 2025
@macfarla
Copy link
Contributor

it makes sense that you need the jdk to be able to compile. The main dockerfile and the evmtool dockerfiles are set up to run besu, not compile it. JRE is runtime only.

As for how/why it worked before on an earlier version of gradle - that is a mystery. Glad you found the solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants