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

Gradlew desktop:run failing due to invalid code in same place regardless of version #648

Closed
Vortetty opened this issue Sep 8, 2019 · 16 comments

Comments

@Vortetty
Copy link
Contributor

Vortetty commented Sep 8, 2019

i am attempting to build my own version of the game (testing for modded versions, this happened during my initial run before i mod stuff, however i receive this error, regardless of build.:

C:\Users\_____\Desktop\Mindustry>gradlew desktop:run
No local.properties found. Not loading Android module.

Configure project :
Compiling with build: 'custom build'

Task :core:compileJava
C:\Users\\Desktop\Mindustry\core\src\io\anuke\mindustry\editor\MapEditorDialog.java:235: error: cannot find symbol
drawDefaultBackground(x, y);
^
symbol: method drawDefaultBackground(float,float)
location: class MapEditorDialog
C:\Users\
\Desktop\Mindustry\core\src\io\anuke\mindustry\ui\dialogs\DeployDialog.java:174: error: cannot find symbol
drawDefaultBackground(x, y);
^
symbol: method drawDefaultBackground(float,float)
location: class DeployDialog
C:\Users\\Desktop\Mindustry\core\src\io\anuke\mindustry\ui\dialogs\TechTreeDialog.java:58: error: cannot find symbol
drawDefaultBackground(x, y);
^
symbol: method drawDefaultBackground(float,float)
location: class TechTreeDialog
C:\Users\
\Desktop\Mindustry\core\src\io\anuke\mindustry\ui\dialogs\MinimapDialog.java:26: error: cannot find symbol
drawDefaultBackground(x, y);
^
symbol: method drawDefaultBackground(float,float)
location: class MinimapDialog
C:\Users\_____\Desktop\Mindustry\core\src\io\anuke\mindustry\ui\dialogs\ZoneInfoDialog.java:29: error: cannot find symbol
drawDefaultBackground(x, y);
^
symbol: method drawDefaultBackground(float,float)
location: class ZoneInfoDialog
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors

Task :core:compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':core:compileJava'.
    Compilation failed; see the compiler error output for details.
  • 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.

BUILD FAILED in 7s
4 actionable tasks: 1 executed, 3 up-to-date

C:\Users\_____\Desktop\Mindustry>

Anybody know what could be causing this? i have tried re downloading, tried most 4.0 builds to no avail. this was not a problem and suddenly became one, it started when i tested a build with invalid block code, when i fixed it the problem persisted.

@Anuken
Copy link
Owner

Anuken commented Sep 8, 2019

Mindustry automatically pulls the latest version of Arc for convenience, which may not be compatible with the version you are trying to build. For reliable compilation, you must clone the version of Arc used at release time (this one) and place it in the same subfolder that Mindustry is in.

@Anuken Anuken closed this as completed Sep 8, 2019
@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

do i have to rename arc from "Arc-a26c5e32ec3be31001e7a9e9756046e89d2b5a8b" to "Arc"? i would assume i have to but not sure

@Anuken
Copy link
Owner

Anuken commented Sep 9, 2019

The folder? No, it should always be Arc.

@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

The folder? No, it should always be Arc.

ok, just making sure, downloading the commit gives me Arc with the commit id on the end, so i was wondering if i should leave it like that or rename it to just Arc

Edit: does arc go in /mindustry/core/src/io/anuke/mindustry/ or just /mindustry/

@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

testing in both locations still yields the same error

@Anuken
Copy link
Owner

Anuken commented Sep 9, 2019

Place it in the same subfolder that Mindustry is in. Not inside Mindustry.

@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

ok

@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

tried this, still yields same error (i just downloaded an new version of build 92) i have it in the correct folder: the folder

@Anuken
Copy link
Owner

Anuken commented Sep 9, 2019

That's not the correct folder. You put it inside the Mindustry folder, instead of next to it.

@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

So In the core folder?

@Anuken
Copy link
Owner

Anuken commented Sep 9, 2019

No, you put Arc in the same folder that Mindustry is. Not in the Mindustry folder, but next to it. So if Mindustry is in Documents, you would put Arc in Documents as well.

@copygirl
Copy link

copygirl commented Sep 9, 2019

Isn't the real issue here that Mindustry's build system is pulling the latest version of a dependency, instead of specifying which version / commit it works with, and pulling only that?

What is the process of finding the appropriate Arc commit that Mindustry is able to compile with? Say, if you wanted to build old releases of the game to find out how it has changed over the years. Or in some rare cases just want to build the latest release from source.

@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

Ok, now I know where to put it. Will test tonight

@Anuken
Copy link
Owner

Anuken commented Sep 9, 2019

@copygirl Initially, I manually specified the version of Arc that was used for each version of Mindustry, but that was quite annoying and lead to a lot of unnecessary errors. Arc is updated very often; every new commit, I would have to change its dependency in Mindustry. Sometimes I would forget, which lead to unpredictable build errors for others. This is why the current system is in place.


To specify the right version of Arc to use, generally you would look for the last commit made before the Mindustry commit, then either specify the commit hash in Gradle or clone the repo and put it next to Mindustry.


I haven't put much thought into this yet, but a possible alternative to fetching the latest version would be to run a local script each commit to update the Arc dependency.

@Vortetty
Copy link
Contributor Author

Vortetty commented Sep 9, 2019

@Anuken

one way to solve this problem is to have a script checking when arc updates then find that commit hash, and use it to update a file with the hash, and make mindustry read the has inside of that file, then download that commit, preventing breaking and allowing you to continue updating arc, and because when you do a release, the hash for that release of mindustry would stay the same, you would have no problems .

@Anuken
Copy link
Owner

Anuken commented Sep 13, 2019

Implemented a commit hook as part of b1edaa1.

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

3 participants