Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lanch4Jbin dependency does not recognize aarch64 platform architecture and patch level version number #179

Open
miurahr opened this issue Jan 19, 2025 · 2 comments

Comments

@miurahr
Copy link

miurahr commented Jan 19, 2025

Problem

gradle-launch4j plugin assumes a workdir package classifier as linux when running on other than x86-64.

I have made forked version of launch4j that have an linux-aarch64 support. You can find it at https://repo1.maven.org/maven2/org/omegat/launch4j/3.50.1/

When specified a configuration

dependencies {
    launch4jBin 'org.omegat:launch4j:3.50.1:workdir-linux-aarch64'
}

I got an error

> Could not create task ':createExe'.
   > Could not create task of type 'Launch4jLibraryTask'.
      > launch4j binary jar workdir-linux file not found! Expected workdir-linux.jar but got [launch4j-3.50.1-workdir-linux-aarch64.jar]. Use the correct classifier for this platform.

It is because

} else if (os.isLinux() || os.isUnix()) { // isUnix will also match MacOs, hence, call it as last resort
String arch = System.getProperty("os.arch")
if ("amd64" == arch || "x86_64" == arch) {
return 'workdir-linux64'
} else {
return 'workdir-linux'
}
}

The plugin assumes there are only linux and linux64.

It is better to respect the configuration or providing a way to mapping among platforms and flavors.

@miurahr
Copy link
Author

miurahr commented Jan 20, 2025

When forked version of launch4j is modified to publish lanuch4j-3.50.2-workdir-linux.jar for aarch64, the plugin download the intended jar file but failed with error message on Ubuntu 24.10 for ARM64

  • build.gradle
dependencies {
    launch4jBin 'org.omegat:launch4j:3.50.1:workdir-linux'
}
  • gradle log
> Configure project :
Download https://repo.maven.apache.org/maven2/org/omegat/launch4j/3.50.2/launch4j-3.50.2-workdir-linux.jar, took 1 m 13 s 33 ms

FAILURE: Build failed with an exception.

* Where:
Build file '/home/miurahr/IdeaProjects/omegat/build.gradle' line: 315

* What went wrong:
A problem occurred evaluating root project 'OmegaT'.
> Could not create task ':createExe'.
   > Could not create task of type 'Launch4jLibraryTask'.
      > launch4j binary jar workdir-linux file not found! Expected workdir-linux.jar but got [launch4j-3.50.2-workdir-linux.jar]. Use the correct classifier for this platform.

@miurahr
Copy link
Author

miurahr commented Jan 20, 2025

The plugin assumes (specified) launch4j has artifact-id launch4j and version contains 3.50 form hard-coded, and does not respect configured values, e.g., 3.50.1 patch level.

 def jarName = "launch4j-(\\d{1,2}\\.\\d{1,2})-${workingDirName}"

private static File getWorkingJar(ConfigurableFileCollection launch4jBinaryFiles) {
def workingDirName = Launch4jPlugin.workdir()
def jarName = "launch4j-(\\d{1,2}\\.\\d{1,2})-${workingDirName}"
def workingJar = launch4jBinaryFiles.files.find { File file -> file.name =~ /${jarName}.jar/ }
if (!workingJar) {
throw new Exception("launch4j binary jar ${workingDirName} file not found! Expected ${workingDirName}.jar but got ${launch4jBinaryFiles.files.collect { it.name }}. Use the correct classifier for this platform.")
}
workingJar
}

The plugin also assumes a hard-coded classifier string got by workDir() instead of user specified one.

@miurahr miurahr changed the title Could not understand platform architecture aarch64 lanch4Jbin dependency does not recognize aarch64 platform architecture and patch level version number Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant