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

Error during build #7

Open
azlux opened this issue Jul 6, 2023 · 5 comments
Open

Error during build #7

azlux opened this issue Jul 6, 2023 · 5 comments

Comments

@azlux
Copy link
Contributor

azlux commented Jul 6, 2023

Hi,
The Dockerfile don't build since few days, did you have change something ?
From the error, I suppose it this line where the version is fixed :
https://github.com/retrowars/retrowars/blob/2f78e54494c86e690139aab6d4d370a580f02e76/build.gradle#L10

azlux@srv1:$ docker build .
Sending build context to Docker daemon  2.048kB
Step 1/9 : FROM openjdk:8 as build
 ---> b273004037cc
Step 2/9 : RUN git clone https://github.com/retrowars/retrowars
 ---> Using cache
 ---> 10ac5f5fcec3
Step 3/9 : WORKDIR /retrowars
 ---> Using cache
 ---> b82ebc67d5c4
Step 4/9 : RUN ./gradlew -PexcludeAndroid stage :server:dist
 ---> Running in 79eeac9c4e9b
Downloading https://services.gradle.org/distributions/gradle-7.5-bin.zip
...........10%............20%...........30%............40%...........50%............60%...........70%............80%...........90%............100%

Welcome to Gradle 7.5!

Here are the highlights of this release:
 - Support for Java 18
 - Support for building with Groovy 4
 - Much more responsive continuous builds
 - Improved diagnostics for dependency resolution

For more details see https://docs.gradle.org/7.5/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'retrowars'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:7.4.2.
     Required by:
         project :
      > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but:
          - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
          - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
          - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
          - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')

* 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

BUILD FAILED in 11s
The command '/bin/sh -c ./gradlew -PexcludeAndroid stage :server:dist' returned a non-zero code: 1

Best regards
Azlux

@pserwylo
Copy link
Member

pserwylo commented Jul 8, 2023

Whoops, sorry about that! I'll get it fixed and close this when done.

I'll also take this opportunity to thank you again for your continued contribution here. Running the server is awesome and I am super thankful. I'm also thankful for your input with posts like this and your original inputs into the docker build (which I use officially now). Out of curiosity, have you noticed any activity on your server? My main retrowars-latest.serwylo.com server is proving to be slightly more stable than I originally suspected after increasing the resources, but hopefully you see a few games every now and again.

It is worth noting that I now publish images to dockerhub (pserwylo/retrowars). However I understand that you may be interested in building yourself and that is of course fine. It is also worth noting if you are interested that the docker image need only change under certain circumstances, namely when server logic changes or games are introduced. When this happens, I'll tag a version that is suffixed with -server (e.g. v0.29.0-server)

@pserwylo
Copy link
Member

pserwylo commented Jul 8, 2023

I'll also try to setup a Github Actions CI pipeline because this is a bit of an embarrassing bug that should never really have been merged!

@pserwylo
Copy link
Member

pserwylo commented Jul 8, 2023

This all actually a bit messy. Took me longer than I care to admit to figure out the Dockerfile was in this repo not the other one. I think I'll move the docker file to the other repo. Then I'll try to hook up a CI/CD job to publish the docker file each time a vX.X.X-server tag is created. It can also validate the build each time I file a PR to prevent this issue going forward.

@pserwylo
Copy link
Member

pserwylo commented Jul 8, 2023

Fixed in retrowars/retrowars#129. I've recreated the Dockerfile in the main repo. Will remove from here soon.

@azlux
Copy link
Contributor Author

azlux commented Jul 10, 2023

Out of curiosity, have you noticed any activity on your server ?

I saw some people during my server maintenance playing on the server, but I don't keep logs on my server, So I cannot say something precise.

I'm good with your dockerfile and published image, I'm now using it for my server.

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

No branches or pull requests

2 participants