PaperMC / paperweight

Gradle build system plugin for Paper and Paper forks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix Command finished with 128 exit code / Filename too long [Windows]

Foorcee opened this issue · comments

I had this issue when building our fork with paperweight.
I executed ./gradlew applyPatches in Git bash.

> Task :tuinity:paper:patchCraftBukkit FAILED
> Task :tuinity:getPaperUpstreamData FAILED
> Task :getTuinityUpstreamData FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tuinity:paper:patchCraftBukkit'.
> io.papermc.paperweight.PaperweightException: Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false apply --ignore-whitespace --directory=src/main/java ...Tuinity1.17\.gradle\caches\paperweight\upstreams\paper\.gradle\caches\paperweight\taskCache\patchCraftBukkitPatches.zip--1588702556\net\minecraft\world\entity\ai\goal\target\PathfinderGoalNearestAttackableTarget.patch

* 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

After trying to run the command manually, git tells me that the filename is too long.

The solution is to enable the following option in Git:
git config --global core.longpaths true

Please include a link to your project.

Windows has a maximum file path limit of 260 chars, we should maaaybe reduce the length of the file names we use, but, the file path limit is something you're gonna need to factor in on your side too

I think a registry edit might be needed in addition to git config --system core.longpaths true
image

Whether or not the registry edit is needed (I'm not sure, maybe someone can test and confirm) it probably makes sense for paperweight to pass the aforementioned git option when running on Windows.

I succeeded to run ./gradlew applyPatches of Paper and Purpur on Windows 10 after disabling the Win32 Filename legth limit and enable core.longpaths in Git For Windows.
https://imgur.com/a/i90iMTe

Suspect this is related - when running applyPatches:

open(".gradle/caches/paperweight/mc-dev-sources/data/minecraft/advancements/recipes/building_blocks/polished_blackstone_brick_slab_from_polished_blackstone_bricks_stonecutting.json"): Filename too long

Suspect this is related - when running applyPatches:

open(".gradle/caches/paperweight/mc-dev-sources/data/minecraft/advancements/recipes/building_blocks/polished_blackstone_brick_slab_from_polished_blackstone_bricks_stonecutting.json"): Filename too long

Tried enabling long paths in registry for Win AND core.longpaths for GIT? That fixed our similar issues, but BOTH settings have to be applied.

@IAISI Thanks, git config --system core.longpaths true was enough for me but I just figured I'd post the error for search engines to pick up on.