-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
gradle: add setup hook #272380
gradle: add setup hook #272380
Conversation
735100e
to
0b23401
Compare
It would be great to get rid of
Are there some improvements that could be suggested to the upstream, or is the format hopelessly bad?
Would this sort of change be simple enough to implement in the proxy directly? Change the type of struct Pages(BTreeMap<String, BTreeMap<String, Page>>); so that the first level is the URL scheme+authority: {
"https://jcenter.bintray.com": {
"com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar": {
"sha256": "dmrSoHg/JoeWLIrXTO7MOKKLn3Ki0IXuQ4t4E+ko0Mc="
},
"com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.pom": {
"sha256": "GYidvfGyVLJgGl7mRbgUepdGRIgil2hMeYr+XWPXjf4="
},
"com/google/code/gson/gson-parent/2.9.1/gson-parent-2.9.1.pom": {
"sha256": "fKCEXnNoVhjePka9NDTQOko3PVIPq5OmgDGK1sjLKnk="
}
}
} In this tiny sample it saves about 8%, which is pretty far from the desired 30%+ 😦 |
Then maybe use the gradle coordination: {
"https://jcenter.bintray.com": {
"com.google.code:findbugs.jsr305:3.0.2": {
"jar": "dmrSoHg/JoeWLIrXTO7MOKKLn3Ki0IXuQ4t4E+ko0Mc=",
"pom": "GYidvfGyVLJgGl7mRbgUepdGRIgil2hMeYr+XWPXjf4="
}
}
} |
Related to #151524 |
Here's my list of issues:
At this point, isn't it normal to give up on Gradle lockfiles? It seems like the entire ecosystem is built in a way as to be as non-reproducible as possible. From what little interaction I had with upstream, it doesn't seem like they'd be very willing to improve it either, but you're welcome to try; I'm not a Java dev, I'm just a nixpkgs contributor, I don't want to waste my effort on proposing changes to people who probably don't have the time to look into why they're necessary. Good thing is the MITM cache, with some modifications (to add more configuration), can actually be used for other build systems that currently use FODs, so I think this way of doing it is both pragmatic and useful in the long run. Even if there isn't an http(s) proxy setting, we can hijack /etc/ssl (or whatever other paths) and use a proxifier, which should defeat even the most uncooperating build systems. As I already mentioned, this is far from ideal, but it's pragmatic. |
This gives an improvement of 46.123%, down to 100kb for this particular deps.json! It would be possible to squeeze another 0.3% if snapshots didn't exist, but whatever, that doesn't matter much. |
263a26d
to
faacf14
Compare
I think I got this in a shape suitable for most Gradle derivations currently in nixpkgs, should I try converting more derivations to the setup hook? I'm slightly familiar with them from my previous attempt at creating a builder for Gradle. If possible, I'd like to get a review of the public interface (what you see in the latest commit, the attr names and such) before continuing.
|
c6f85f4
to
cd5e909
Compare
ae1da4f
to
5fed667
Compare
Not necessarily as part of this PR, but I wonder if there is a plan to have a |
I don't see a point in that, look at e.g. the |
Good point; not adding a wrapper exposes the hacky behaviour. Nevermind. |
Result of 8 packages marked as broken and skipped:
81 packages built:
|
Thanks a bunch for your work @chayleaf :) |
For the
|
This PR broke evaluation of nixpkgs for Nix 2.3.18.
I made a fix in PR #329212. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Description of changes
In turn, this solves the following longstanding Gradle+Nix issues:
okio
->okio-jvm
now work with no manual workaroundsOpen questions
It seems there are no major issues left?
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.