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

ant: use upstream launcher script #364094

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

tomodachi94
Copy link
Member

Let's use Ant's upstream launcher script. It handles far more edge-cases than ours.

Instead of writing our own, let's simply hard-code values into the launcher that are known in advance.

One small step towards #353512. Closes #4105, because a path to the JRE is one of the things we now explicitly set. Something similar first attempted by @linsui in #266313. Accidentally screwed up #359451.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@tomodachi94 tomodachi94 requested review from TomaSajt and a team December 11, 2024 02:21
@github-actions github-actions bot added the 6.topic: java Including JDK, tooling, other languages, other VMs label Dec 11, 2024
@@ -11,6 +11,8 @@ stdenv.mkDerivation (finalAttrs: {
pname = "ant";
version = "1.10.15";

buildInputs = [ jre ];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, will this change make it so that we don't actually need to add both jdk and ant into nativeBuildInputs when using ant?

Also also, jdk vs jre? (I'd say jdk)
--@TomaSajt

From my testing, if we use jdk, that is the case, but setting it to jdk makes it difficult to use a different version of Java without overriding ant.
--Me

Is there a reason that we shouldn't have consumers explicitly specify a JDK?
--Me

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t jre the same as jdk these days?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the distinction usually is the fact that jre may be overridden to be run on a different java version than it was built on (why tho) or it can be overridden with a minimal java.
Though I doubt many people would care, so I guess we don't have to care either.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just meant re: “From my testing, if we use jdk, that is the case” – since I do think ensuring people explicitly specify a JDK is best.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say "explicitly specify" do you mean that ant should have a hardcoded jdk that can be overridden, or do you mean that it should not have a hardcoded jdk, but should use whatever's in JAVA_HOME.

I'm torn between the two options.

@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: java Including JDK, tooling, other languages, other VMs 10.rebuild-darwin: 101-500 10.rebuild-linux: 101-500 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants