Open GrapeBaBa opened 5 months ago
Would you like to make a PR?
I have the same error on GitLab CI. Doesn't happen locally.
I have the same error on GitLab CI. Doesn't happen locally.
Can you help me with a reproducer?
Kotlin/Java isn't my strong language so I am afraid I can't help much. But, you should be able to reproduce it by using OP's repo: https://github.com/optimism-java/hildr/pull/167/commits.
Note that he fixed his CI by changing the check at: https://github.com/optimism-java/hildr/pull/167/commits/9d42023f7a4f2c005367b8d3425b1dd24d0f6b37
Further info: I am using gradle 8.10, and I found out this when I went to the definitions of the isXYZ:
Maybe it didn't fail locally as I am using MacOS.
I have updated mine to be
def brotliVersion = "1.17.0"
def operatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
def currentArchitecture = DefaultNativePlatform.getCurrentArchitecture()
repositories {
mavenCentral()
}
dependencies {
implementation "com.aayushatharva.brotli4j:brotli4j:$brotliVersion"
runtimeOnly("""com.aayushatharva.brotli4j:native-${
if (operatingSystem.isWindows())
if (currentArchitecture.isAmd64()) "windows-x86_64"
else if (currentArchitecture.isArm64()) "windows-aarch64"
else
throw new IllegalStateException("Unsupported architecture: ${currentArchitecture.getName()}");
else if (operatingSystem.isMacOsX())
if (currentArchitecture.isArm64()) "osx-aarch64"
else "osx-x86_64"
else if (operatingSystem.isLinux())
if (currentArchitecture.isArm64()) "linux-aarch64"
else if (currentArchitecture.isAmd64()) "linux-x86_64"
else if (currentArchitecture.isArm32()) "linux-armv7"
else if (currentArchitecture.isI386()) "linux-x86_64" // Assuming I386 should also use linux-x86_64 as there is no linux-i386 folder
else
throw new IllegalStateException("Unsupported architecture: ${currentArchitecture.getName()}");
else
throw new IllegalStateException("Unsupported operating system: $operatingSystem");
}:$brotliVersion""")
}
I don't know where this difference in methods comes from, though. I can do a PR, but I can't say if we are a minority that has this issue.
Describe the bug Groovy gradle script not works. No methods for architectures.
To Reproduce Steps to reproduce the behavior:
Expected behavior No errors when building.
Logs https://github.com/optimism-java/hildr/actions/runs/9465053552
Platform (please complete the following information):
Additional context