1.15.2 Buildtools doesn't work for 1.15.2

Discussion in 'Spigot Plugin Development' started by Cerus, Apr 5, 2020.

  1. Hello!

    I'm unable to run Buildtools to build Spigot 1.15.2. The following error occurs:
    Resetting Spigot-API to Bukkit...
    applyPatches.sh: line 7: 9996 Segmentation fault git checkout master > /dev/null 2>&1
    fatal: Unable to create 'D:/Spigot Sources/1.15.2/Spigot/Spigot-API/.git/index.lock': File exists.

    Another git process seems to be running in this repository, e.g.
    an editor opened by 'git commit'. Please make sure all processes
    are terminated then try again. If it still fails, a git process
    may have crashed in this repository earlier:
    remove the file manually to continue.
    Applying patches to Spigot-API...
    applyPatches.sh: line 7: 3908 Segmentation fault git am --abort > /dev/null 2>&1
    applyPatches.sh: line 7: 8928 Segmentation fault git am --3way "$basedir/${what}-Patches/"*.patch
    Something did not apply cleanly to Spigot-API.
    Please review above details and finish the apply then
    save the changes with rebuildPatches.sh
    Error compiling Spigot. Please check the wiki for FAQs.
    If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
    java.lang.RuntimeException: Error running command, return status !=0: [sh, applyPatches.sh]
    at org.spigotmc.builder.Builder.runProcess0(Builder.java:794)
    at org.spigotmc.builder.Builder.runProcess(Builder.java:731)
    at org.spigotmc.builder.Builder.main(Builder.java:596)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:40)
    I have no other command prompts or editors open in the directory.

    What exactly am I doing wrong?

    The whole log is attached to this thread.

    Attached Files:

  2. How do you run the buildtools ?
  3. Probably you aborted an earlier run of buildtools but didn't delete the lock file so git thinks the directory is still in use.
    The simplest way to work around the issue is to delete all generated files and directories and re-run buildtools.
  4. Already tried that. I tried to run buildtools in a new and empty directory, same error.

    I run it with this command:
    java -jar BuildTools.jar --rev 1.15.2
  5. A problem you have with Windows you haven't with Mac OS and Linux. :D
  6. Well.. I'm not going to switch to Linux just because of one issue with Git :D
  7. Are you using git bash inside of the directory of BuildTools.jar?

    If so try this inside of Git Bash (Alternative removing the .index file from Spigot/.git/)
    Code (Text):
    rm -f Spigot/.git/index.lock
    Code (Text):
    java -jar BuildTools.jar --rev 1.15.2
    Any chance you can post your applyPatches.sh file?
    #7 CoachL_ck, Apr 9, 2020
    Last edited: Apr 9, 2020
  8. Already tried that with no success. :/

    Here's the applyPatches.sh:
    Code (Text):

    echo "Rebuilding Forked projects.... "

    applyPatch() {

        cd "$basedir"
        if [ ! -d  "$target" ]; then
            git clone ../$what $target
        cd "$basedir/$target"
        echo "Resetting $target to $what..."
        git config commit.gpgSign false
        git remote rm origin >/dev/null 2>&1
        git remote add origin ../../$what >/dev/null 2>&1
        git checkout master >/dev/null 2>&1
        git fetch origin >/dev/null 2>&1
        git reset --hard $branch

        echo "  Applying patches to $target..."
        git am --abort >/dev/null 2>&1
        git am --3way "$basedir/${what}-Patches/"*.patch
        if [ "$?" != "0" ]; then
            echo "  Something did not apply cleanly to $target."
            echo "  Please review above details and finish the apply then"
            echo "  save the changes with rebuildPatches.sh"
            exit 1
            echo "  Patches applied cleanly to $target"

    cd ../Bukkit
    hash=$(git rev-parse HEAD)
    git branch -f spigot "$hash"

    applyPatch Bukkit Spigot-API origin/spigot && applyPatch CraftBukkit Spigot-Server origin/patched