-
Bug
-
Resolution: Unresolved
-
Minor
-
Windows 10 Home (x64) version 2004, compilation 19041.746
AMD Ryzen 7 4800H with Radeon Graphics, 32 GB RAMWindows Subsystem for Linux (WSL) version Ubuntu 20.04 (hence the Ubuntu builds in java --version)
Java 14 (JDK+JRE):
openjdk 14.0.2 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing)Java 8 (JDK+JRE):
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)Windows 10 Home (x64) version 2004, compilation 19041.746 AMD Ryzen 7 4800H with Radeon Graphics, 32 GB RAM Windows Subsystem for Linux (WSL) version Ubuntu 20.04 (hence the Ubuntu builds in java --version) Java 14 (JDK+JRE): openjdk 14.0.2 2020-07-14 OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04) OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing) Java 8 (JDK+JRE): openjdk version "1.8.0_275" OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~20.04-b01) OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
-
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:
Ensure that BuildTools has been run at least once, to ensure all the repositories have been cloned, and processed.Close any WSL sessions.Open PowerShell in the directory BuildTools is situated.Execute the given commands:Get-ChildItem -Recurse -Attribute Directory | %{fsutil.exe file setCaseSensitiveInfo $_.FullName enable} fsutil.exe file setCaseSensitiveInfo . enable
Reopen WSL in the BuildTools directory.Attempt the build again.
I have found a better workaround to this using '/etc/wsl.conf':
- Open a WSL shell.
- Add these lines to '/etc/wsl.conf':
[automount] options = case=dir
- If the file does not exist, create it:
sudo touch /etc/wsl.conf
- If the file does not exist, create it:
- Save the file and close the shell.
- Shutdown WSL by pressing Windows+R and entering this command:
wsl --shutdown
- Restart WSL.
- Check if the change applied successfully by running mount and seeing if case=dir is seen in the volumes.
- Delete all sources BuildTools.jar has created.
- Retry the build.
This solution should also apply to any other future builds.