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

atlauncher: build from source #327592

Merged
merged 1 commit into from
Sep 5, 2024
Merged

atlauncher: build from source #327592

merged 1 commit into from
Sep 5, 2024

Conversation

GetPsyched
Copy link
Member

Description of changes

Thanks to chayleaf's efforts in #272380, it's much easier to package apps built with Gradle!

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@GetPsyched
Copy link
Member Author

GetPsyched commented Jul 16, 2024

#237183 (comment)

@drupol, a little over a year later :P

Anyway, it's worth noting that merging this PR just adds on to the issues detailed in #320528 and #327064. I don't think these issues would stop new PRs to be merged yet but rather just work on the existing problem, but I think it's worth mentioning.

@GetPsyched
Copy link
Member Author

Seems like the build fails on aarch64-linux:

A problem occurred configuring root project 'ATLauncher'.
> Could not create task ':createExe'.
   > Could not create task of type 'Launch4jLibraryTask'.
      > Could not resolve all files for configuration ':launch4jBin'.
         > Could not find launch4j-3.50-workdir-linux.jar (net.sf.launch4j:launch4j:3.50).
           Searched in the following locations:
               https://repo.maven.apache.org/maven2/net/sf/launch4j/launch4j/3.50/launch4j-3.50-workdir-linux.jar

Wondering if I should revert to just getting the JAR and wrapping that instead of getting the EXE as well, since the latter breaks on one platform as of writing.

@chayleaf
Copy link
Contributor

chayleaf commented Jul 17, 2024

I'd recommend avoiding Launch4j if possible, it's just unnecessary native code. I doubt launch4j-3.50-workdir-linux.jar would work on aarch64, it's more likely it's targeting i686.

@GetPsyched
Copy link
Member Author

Unsure how would I go about avoiding Launch4j. This is my first and only Gradle package that I maintain + I don't know much about Gradle/Launch4j. Could you please elaborate/provide a reference? Thanks.

@chayleaf
Copy link
Contributor

basically, instead of building the exe, you build the jar and wrap it. To do that, you find out what task is responsible for building the jar and set gradleBuildTask appropriately.

@GetPsyched
Copy link
Member Author

Ah okay, that's what I was doing initially anyway. I'll do that again in a bit.

@GetPsyched GetPsyched force-pushed the atlauncher branch 3 times, most recently from 5497b8f to ba5e11c Compare July 21, 2024 07:45
@GetPsyched
Copy link
Member Author

This is weird, even after setting gradleBuildTask = "shadowJar"; it is still trying to run the createExe task 🤔. I can exclude that task explicitly but this shouldn't happen, right?

@chayleaf
Copy link
Contributor

perhaps you can find the answer with gradle tasks --all, which prints all tasks and their dependencies

@GetPsyched
Copy link
Member Author

Weirdly, the createExe task does not run on x86_64-linux (see logs) but does run on aarch64-darwin (see logs). Do you know if this is caused by Grade itself, Gradle tooling in nixpkgs, or by the configuration of upstream, @chayleaf?

@chayleaf
Copy link
Contributor

This says Could not create task ':createExe', not "an error occured during running task" or whatever. I'm pretty sure you have to exclude it here.

@K900 K900 merged commit 4c7acf9 into NixOS:master Sep 5, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants