You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within the runDatagen task, a task expected to be able to be cached, there's the /tmp/loom-classpath<rng.long>.args within the jvmArgs field, which due to its random nature, practically invalidates the cache.
Expected Results
Gradle to be able to not need to run the datagen task after the first or second time.
Actual Results
Gradle can't not run the datagen task due to the mentioned argument above.
Possible Fix
Replace the Files.createTempFile with a custom call, creating a hash depending on the running user and the to-be file contents.
It maybe considered to then hold a write/delete lock to prevent competing Looms causing problems, letting only the last one releasing the lock to delete it, not that I expect there to be a case of this happening under normal conditions.
thrownewUncheckedIOException("Failed to create classpath file", e);
}
One thing to keep in mind is we wouldn't want to start skipping the normal run game tasks if their inputs havent changed
It is possible to tell Gradle that the task is not cacheable with Task.notCompatibleWithConfigurationCache(String), which would be applicable to the runClient and runServer tasks.
To accommodate it, the run configs should default to not compatible for the reason of "Application/Game Runner", with the datagen run defaulting to cacheable. It may be ideal to allow new run configs to be declared as cacheable if the dev needs it to be.
The text was updated successfully, but these errors were encountered:
modmuss50
added a commit
to modmuss50/fabric-loom-1
that referenced
this issue
Nov 28, 2024
Within the
runDatagen
task, a task expected to be able to be cached, there's the/tmp/loom-classpath<rng.long>.args
within thejvmArgs
field, which due to its random nature, practically invalidates the cache.Expected Results
Gradle to be able to not need to run the datagen task after the first or second time.
Actual Results
Gradle can't not run the datagen task due to the mentioned argument above.
Possible Fix
Replace the
Files.createTempFile
with a custom call, creating a hash depending on the running user and the to-be file contents.It maybe considered to then hold a write/delete lock to prevent competing Looms causing problems, letting only the last one releasing the lock to delete it, not that I expect there to be a case of this happening under normal conditions.
Other
fabric-loom/src/main/java/net/fabricmc/loom/task/AbstractRunTask.java
Lines 127 to 133 in 097fd98
To accommodate it, the run configs should default to not compatible for the reason of "Application/Game Runner", with the
datagen
run defaulting to cacheable. It may be ideal to allow new run configs to be declared as cacheable if the dev needs it to be.The text was updated successfully, but these errors were encountered: