Uploaded image for project: 'BuildTools'
  1. BuildTools
  2. BUILDTOOLS-568

Unable to build Spigot 1.8.8 with BuildTools.jar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-BuildTools-abd1c56-124 (#124)
    • Yes

      Hello.

      I am encountering an error whilst trying to build Spigot for 1.8.8. After applying CraftBukkit patches and beginning compilation, Maven throws a bunch of errors, mainly about org.bukkit.material colliding with a type or that the import org.bukkit.material was unresolved. The full log is attached below.
      I tried switching javac from JDK 14 to JDK 8, thinking it's a compiler problem but that did not help. I also deleted the sources and tried again but the problem persists. I'm unsure what to do.

      Note: The paths in the log follow the Linux convention since I use Windows Subsystem for Linux (WSL) instead of Git for Windows. Not that this affects anything.


      EDIT:

      After more investigation I found out the cause of the problem.
      If there exists a file and a folder with the same name, when compiling in WSL, Maven sees an additional phantom copy of the file which is not supposed to be there. The copy seems to have an all-lowercase name and the contents of the original file.

      Example:

      Assume the current directory is 'buildtools/Bukkit/src/main/java/'.
      Inside the package 'org.bukkit' there exists a class 'Material.java' as well as the package 'org.bukkit.material'. When attempting to build Spigot from WSL, Maven reports it sees the class 'Material.java' as well as a 'material.java' class, which shouldn't exist (as seen in the original log file). This seems to cause the aforementioned conflict.

      This is weird, as I was able to build Spigot 1.16.5 with no issues. The way I worked around this is as follows:

      1. Ensure that BuildTools has been run at least once, to ensure all the repositories have been cloned, and processed.
      2. Close any WSL sessions.
      3. Open PowerShell in the directory BuildTools is situated.
      4. Execute the given commands:
        Get-ChildItem -Recurse -Attribute Directory | %{fsutil.exe file setCaseSensitiveInfo $_.FullName enable}
        fsutil.exe file setCaseSensitiveInfo . enable
        
      5. Reopen WSL in the BuildTools directory.
      6. Attempt the build again.

      I have found a better workaround to this using '/etc/wsl.conf':

      1. Open a WSL shell.
      2. Add these lines to '/etc/wsl.conf':
        [automount]
        options = case=dir
        
        • If the file does not exist, create it:
          sudo touch /etc/wsl.conf
      3. Save the file and close the shell.
      4. Shutdown WSL by pressing Windows+R and entering this command:
        wsl --shutdown
      5. Restart WSL.
        • Check if the change applied successfully by running mount and seeing if case=dir is seen in the volumes.
      6. Delete all sources BuildTools.jar has created.
      7. Retry the build.

      This solution should also apply to any other future builds.

            Unassigned Unassigned
            Sniping_ Sniping_
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: