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

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

Open
Foorcee opened this issue Jun 29, 2021 · 8 comments · May be fixed by #236
Open

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

Foorcee opened this issue Jun 29, 2021 · 8 comments · May be fixed by #236
Assignees
Labels
status: accepted Issue is accepted and we want to address it type: bug Something isn't working

Comments

@Foorcee
Copy link

Foorcee commented Jun 29, 2021

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

@DenWav DenWav added status: accepted Issue is accepted and we want to address it type: bug Something isn't working labels Jun 29, 2021
@DenWav
Copy link
Member

DenWav commented Jun 29, 2021

Please include a link to your project.

@Foorcee
Copy link
Author

Foorcee commented Jun 29, 2021

@electronicboy
Copy link
Member

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

@jpenilla
Copy link
Member

jpenilla commented Sep 23, 2022

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.

@nostalfinals
Copy link

nostalfinals commented Oct 1, 2022

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

@PikaMug
Copy link

PikaMug commented Feb 17, 2024

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

@IAISI
Copy link

IAISI commented Feb 23, 2024

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.

@PikaMug
Copy link

PikaMug commented Feb 23, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Issue is accepted and we want to address it type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants