-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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.hook: init, migrate a few packages #357162
base: master
Are you sure you want to change the base?
Conversation
a1c058d
to
dd9f9cd
Compare
dd9f9cd
to
71a2599
Compare
I removed the inline documentation to avoid duplicating content. A comment at the top of the hook now directs the user to the manual. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can break packages that have a call to ant
inside of their build process.
e.g. the last time I encountered this situation was with rstudio
, where cmake
calls ant
:
With this change, both cmake
and ant
try to override the buildPhase, and I guess ant
's setup hook happens to get called earlier, thus the cmake
build doesn't run. Also, since build.xml
does not exist, it just errors out.
I guess we could just add dontUseAntBuild
.
Personal opinion:
Hooks should not be directly included with the package they're wrapping.
I would be happier with an antHook
than with ant
having this default behaviour.
This would also not randomly break packages.
Is there any consensus about whether we should include setup hooks in the packages themselves? I'm conflicted: I agree that this can cause headaches when introducing a new hook into an existing package, but many packages do include a setup hook by default (like |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
50f4758
to
105ed60
Compare
This comment was marked as outdated.
This comment was marked as outdated.
105ed60
to
3dabd15
Compare
This comment was marked as outdated.
This comment was marked as outdated.
efb88fa
to
a3a15e4
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
d8a987f
to
82aa5f9
Compare
Result of 1 package blacklisted:
6 packages built:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
82aa5f9
to
d97495e
Compare
By the way, do we need to have But my personal opinion is that, if we're not inside the magical land of hooks anymore, we shouldn't try to override how commands work. |
d97495e
to
c120ad8
Compare
Documentation available in doc/languages-frameworks/ant.section.md, or in the "Ant" section of the manual once this is merged.
c120ad8
to
fd71ebc
Compare
Not necessarily. The function is there to reduce the amount of copy-paste between phases; I'm not opposed to renaming it to The wrapper can be circumvented. Per the docs: |
We have that at $dayjob: |
Ant itself also does that. In its GitHub repository, |
Add a setup hook for Ant.
It does a few different things; I recommend reading the documentation for a full explanation.
I also migrated a few packages to demonstrate that this works in practice. Since there are many packages that use Ant in Nixpkgs, it would be impractical to do all of them at once in this PR.
For maintainers of changed packages
I migrated your package to the new pattern. If something (e.g. an assumption about your package, or something with the hook) looks wrong, please let me know.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.