Closed calcmogul closed 2 weeks ago
Are you able to reproduce this? I just tried again, with the following path, and it worked fine.
/home/thad/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/National Instruments/Shared/OpenVINO/:/mnt/c/Program Files/Eclipse Adoptium/jdk-17.0.9.9-hotspot/bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/CMake/bin:/mnt/c/Program Files/Microsoft SQL Server/150/Tools/Binn/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files (x86)/IVI Foundation/VISA/WinNT/Bin/:/mnt/c/Program Files/IVI Foundation/VISA/Win64/Bin/:/mnt/c/Program Files (x86)/National Instruments/Shared/LabVIEW CLI:/mnt/c/Program Files (x86)/IVI Foundation/VISA/WinNT/Bin:/mnt/c/Program Files/nodejs/:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Users/thadh/.cargo/bin:/mnt/c/Users/thadh/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/thadh/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/thadh/.dotnet/tools:/mnt/c/Users/thadh/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0/LocalCache/local-packages/Python312/Scripts:/mnt/c/Users/thadh/AppData/Roaming/npm:/snap/bin:/home/thad/chains/roborio-academic/bin
Yep.
[tav@myriad choreolib]$ ./gradlew build
> Task :compileJava
warning: unknown enum constant Visibility.NONE
reason: class file for com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility not found
warning: unknown enum constant Visibility.NONE
2 warnings
> Task :javadoc
warning: unknown enum constant Visibility.NONE
reason: class file for com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility not found
warning: unknown enum constant Visibility.NONE
2 warnings
> Task :createChoreoLibLinuxathenaReleaseStaticLibrary FAILED
> Task :linkChoreoLibLinuxathenaDebugSharedLibrary
Failed to strip binaries because of unknown tool objcopy and strip
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':createChoreoLibLinuxathenaReleaseStaticLibrary'.
> Could not find Static library archiver 'arm-frc2024-linux-gnueabi-ar'. Searched in:
- /home/tav/.local/bin
* 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.
BUILD FAILED in 17s
31 actionable tasks: 30 executed, 1 up-to-date
[tav@myriad ~]$ echo $PATH
/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/emscripten:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin:/home/tav/.local/bin:/home/tav/code/bash:/home/tav/code/bash/pacman:/home/tav/code/python:/home/tav/frc/wpilib/scripts:/usr/lib/emscripten
Ok. I was trying an executable, I wonder if its something specific to ar.
Seems like once it finds the location for g++, it looks there for everything instead of checking the rest of PATH.
[tav@myriad bin]$ pwd
/home/tav/.local/bin
[tav@myriad bin]$ ls -lh
Permissions Size User Date Modified Name
lrwxrwxrwx - tav 30 Dec 2023 arm-frc2024-linux-gnueabi-g++ -> /usr/bin/ccache
lrwxrwxrwx - tav 30 Dec 2023 arm-frc2024-linux-gnueabi-gcc -> /usr/bin/ccache
If I add symlinks for ar, objcopy, and strip, the build works.
Ah. Yes, thats how it works. It only searches for g++ in path. Once it finds that it assumes everything else is there. Thats a gradle behavior we can't solve, its not something we're doing on our end.
Moving
~/.local/bin
after/usr/bin
in PATH fixed it.The relevant code is here: https://github.com/wpilibsuite/native-utils/blob/c4ed8126d6bdeabdb2575f828df0c3c7694134d9/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/ToolchainDiscoverer.java#L211