Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.69k stars 2.98k forks source link

kotlin-related build failure #10103

Closed mwoehlke closed 2 months ago

mwoehlke commented 3 months ago

Platforms

Linux

Build

9063fca2b5d0782900d392c7d50a88104f3cdf67

Issue

Trying to build on Fedora 40 fails with:

file or directory '.../mindustry/core/build/generated/source/kapt/main', not found
file or directory '.../mindustry/core/build/generated/source/kaptKotlin/main', not found
Build cache key for task ':core:kaptKotlin' is <hash>
Task ':core:kaptKotlin' is not up-to-date because:
  No history is available.
The input changes require a full rebuild for incremental task ':core:kaptKotlin'.
Running kapt annotation processing using the Gradle Worker API
Using workers NONE isolation mode to run kapt

...

> Task :core:kaptKotlin FAILED

Steps to reproduce

On Fedora 40 (using java-21-openjdk[-devel]):

$ cd mindustry
$ ./gradlew --info desktop:dist

Mods used

n/a

Save file

n/a

(Crash) logs

n/a

Submission

endcr commented 3 months ago

Only compiling with java 16-17 is supported, so maybe try that.

mwoehlke commented 3 months ago

With java-17-openjdk-devel:

file or directory '.../mindustry/core/build/generated/source/kapt/main', not found
file or directory '.../mindustry/core/build/generated/source/kaptKotlin/main', not found
file or directory '.../mindustry/core/build/tmp/kapt3/stubs/main', not found

...although I'm pretty sure I've seen the missing tmp/kapt3/stubs/main before also, so there doesn't seem to be any difference between 17 and 21.

Anuken commented 2 months ago

Kotlin code isn't even used in this repository, so I'm not sure why those messages should affect whether the build fails or not.

Frankly, I've never had this issue, or anything remotely similar, so the most I can suggest is "try googling it", which you have probably tried already. Maybe you're looking at the wrong logs. I can't help you.

Kieaer commented 2 months ago

It may generated from android build. You must use Java 16. Java 17 isn't supported because some library has only java 16 support.

mahdoosh1 commented 2 months ago

Frankly, I've never had this issue, or anything remotely similar

You didnt but i did

mwoehlke commented 2 months ago

Kotlin code isn't even used in this repository

There are quite a few references in build.gradle for something that "isn't even used"...

If I remove them, I don't get the error, but I get quite a few "cannot find symbol" for e.g. Player and Teamc (and maybe others). Which... where do those come from?

mwoehlke commented 2 months ago

Anyway, the problem seems to come from kapt project(":annotations"). If I comment that out, I don't get this specific issue. (But I do get a mess of "cannot find symbol", as noted.)

mwoehlke commented 2 months ago

Ugh. Okay, it does work with JDK 17, but only after using alternatives --config java to force java to be 17. Maybe when I thought I was trying 17 before, I still had either 21 or 22 still installed?

mahdoosh1 commented 2 months ago

Anyway, the problem seems to come from kapt project(":annotations"). If I comment that out, I don't get this specific issue. (But I do get a mess of "cannot find symbol", as noted.)

Thank you. I assume those are some warnings and can be safely ignored.

i will try that as well and see if it works. i am trying to compile Mindustry in Android which is very unsupported and no one is trying to support and help me (even anuke himself) i appreciate the fix for that problem.