Skip to content

Race condition in neoForm* tasks in projects with subprojects for different versions of minecraft/neoforge. #282

@blackd

Description

@blackd

Description

When we have a project with subprojects for different versions of NeoForge/Minecraft builds usually fail with:

  • first run always fails in neoFormApplyForgesAccessTransformer of one or more of the projects.
  • subsequent runs fail, 90% of the cases, in neoFormPatch and 10% in neoFormApplyForgesAccessTransformer.

If we make all neoForm* tasks run sequentially like in all task form the second project always run after all neoForm* task from the first. The problem disappears.

The attached project neo-sub-projects-test.tar.gz demonstrates the problem and contains a very simple plugin that can synchronise the tasks from the subprojects. Unfortunately I wasn't able to make it part of the root build script.

Both subprojects are based on the respective template mod projects for that version of Minecraft.

How to test

  • unpack the archive
  • run ./gradlew build - the build will fail in neoFormApplyForgesAccessTransformer of on of the subprojects.
  • run ./gradle build again - it will probably fail in neoFormPatch of the same project.

to reset and test with sync on:

  • run ./gradlew cleanCache clean - cleanCache will probably fail
  • run ./gradlew cleanCache clean
  • to enable the synchronous mode please edit the root gradle.properties file changing doNeoSync=false to doNeoSync=true
  • run ./gradlew build - the build will be successful

Speculations

I have a hunch that the main problem is in how NeoGradle handles its cache. May be something gets overwritten or something like that.

Special Considerations

For cleanCache tasks to work at all these properties are set for all projects:

org.gradle.caching=false
org.gradle.configuration-cache=false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions