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
global-platform-pro: init at 0.3.10-rc11 #44288
Conversation
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: global-platform-pro Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: global-platform-pro Partial log (click to expand)
|
Why are you packaging 0.3.10-rc11 instead of 0.3.9? |
sha256 = "0rk81x2y7vx1caxm6wa59fjrfxmjn7s8yxaxm764p8m2qxk3m4y2"; | ||
}; | ||
|
||
patches = [ (writeText "${name}-version.patch" '' |
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.
What does this do? Is there an upstream report for it? I think it would be better to put the patch into a separate file. Then add a comment describing what it fixes and a link to upstream.
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.
That's not something that can be upstreamed, unfortunately. It's basically bypassing the build system, that attempts to run git describe --tags --always --long --dirty
which fails due to fetchFromGitHub
not keeping the git repo.
This patch hardcodes the output based on the describeVersion
variable, which means it can't really be split into a separate file, or else the describeVersion
would also have to be in this separate file, and an updater may easily forget to update it when bumping the version
.
I've written a comment to explain it :)
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.
Oh, that makes sense. But while this exact change cannot be upstreamed, we should notify upstream that relying on git describe
is not ideal. Maybe they'll change it (why do they actually need that?) or at least provide a nicer way to override it at build time.
Generating a patch based on a template seems a bit fishy to me, but I can't think of a better solution either.
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.
I can't find the gephy package, could you ping the author?
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.
Ugh, it's gephi, not gephy, sorry! I'm not sure on what part of the topic you want me to tag them, though, so I'll let you tag Radvendii where you want :)
inherit src patches; | ||
nativeBuildInputs = [ jdk maven ]; | ||
buildPhase = '' | ||
while mvn package -Dmaven.repo.local=$out/.m2 -Dmaven.wagon.rto=5000; [ $? = 1 ]; do |
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.
- please quote the shell variable
- isn't this equivalent to
while ! mvn package ...
? - is it possible to end up in an endless loop?
- what does that actually do? Download shouldn't be possible in the buildPhase
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 is part of the code copy/pasted and adapted from the gephy
package. Basically copied it and twisted it until it compiled, I don't really understand maven :/
That said for your questions:
- Done
- I… think it is. Tried building with
while ! mvn package …
and it appears to build, at least :) - AFAIK it just re-attempts downloading the dependencies every time the download fails. I guess the author of the
gephy
derivation put it there due to unreliability of the maven repository, and so let it here because it's hard to know whether I'm just having luck downloading all at once or not :) - It can download thanks to it being a fixed-output derivation :) (the
outputHash*
variables)
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.
- I… think it is. Tried building with while ! mvn package … and it appears to build, at least :)
Then I think using that would be a bit nicer :) Although it is not 100% equivalent since ! command
will be true at any exit code other than 0, I think that is what is meant anyways.
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.
I don't find any mention of outputHash
, what do I miss?
It would probably be valuable to get the author of gephy's expression here.
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.
It's the three lines at https://github.com/NixOS/nixpkgs/pull/44288/files/cccfa8f3953933147757d6790ad025e88de32dc0#diff-3f80555b27d7cb249ab01d104b052e6eR52 :)
For the equivalence, I'd guess maybe mvn package
returns a different error code depending on whether it's a download failure or some other kind of failure? cc @Radvendii
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.
And why is it run in a while loop in the first place @Radvendii?
done | ||
''; | ||
# keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside | ||
installPhase = ''find $out/.m2 -type f -regex '.+\(\.lastUpdated\|resolver-status\.properties\|_remote\.repositories\)' -delete''; |
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.
(damn that is an ugly regex syntax)
Please quote the shell variable and maybe put the command into its own line:
installPhase = ''
# command
''
Where is this actually installing anything?
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.
Done, and split the line :) (even though it's $out
so it's guaranteed to not contain spaces, I do understand what you mean by wanting to always quote variables :))
As for where this is installing anything, my understanding of this code (from gephy
) is that the buildPhase
is doing the downloading, and the installPhase
is doing the cleanup. This is similar to the usual way of doing the build in the buildPhase
and then copying only what's required in the installPhase
, so I think it makes more or less sense? :)
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.
even though it's $out so it's guaranteed to not contain spaces, I do understand what you mean by wanting to always quote variables :)
IIRC it is possible to change the store location. So if I'd change it to /nix/s t o r e/
, $out
would contain spaces. Also it is easier to always quote on principle :)
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.
Oh so buildPhase
downloads directly to $out
. I guess it might make sense, although I'd just put everything into installPhase
since there is no actual building involved.
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.
Done, it looks even more like buildRustPackage
this way :)
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.
There probably is room for generalization, but I don't know maven either.
nativeBuildInputs = [ jdk maven makeWrapper ]; | ||
|
||
buildPhase = '' | ||
mvn package --offline -Dmaven.repo.local=$( \ |
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.
Please quote the $(...)
|
||
buildPhase = '' | ||
mvn package --offline -Dmaven.repo.local=$( \ | ||
cp -dpR ${deps}/.m2 ./ && \ |
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.
Quote
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.
I've simplified a bit this part of the code on my way :) should have paid more attention to having simple code when I first packaged it, I guess.
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/lib/java $out/share/java |
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.
Quote
|
||
installPhase = '' | ||
mkdir -p $out/lib/java $out/share/java | ||
cp -R target/apidocs $out/doc |
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.
Quote
installPhase = '' | ||
mkdir -p $out/lib/java $out/share/java | ||
cp -R target/apidocs $out/doc | ||
cp target/gp.jar $out/share/java |
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.
Quote
mkdir -p $out/lib/java $out/share/java | ||
cp -R target/apidocs $out/doc | ||
cp target/gp.jar $out/share/java | ||
makeWrapper ${jre_headless}/bin/java $out/bin/gp \ |
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.
Quote
cp -R target/apidocs $out/doc | ||
cp target/gp.jar $out/share/java | ||
makeWrapper ${jre_headless}/bin/java $out/bin/gp \ | ||
--add-flags "-jar $out/share/java/gp.jar" \ |
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.
And one last time 😀
That's a good question. The honest answer is, I didn't pay attention. However, giving it a bit more thorough look, it seems that 0.3.9 is 2 years old. Across Debian, rpmfind, Gentoo and Archlinux, the only equivalent package appears to be globalplatformpro-git from AUR, that is 0.3.10-rc8.[somegitrev]. I don't have strong opinions on rolling back to 0.3.9, though :) it looks like it's a package a bit like tinc: the pre-release is stable, and the officially-stable version is ancient -- but I don't have many data points to prove this.
I've replied to some of them, should have fixed everything in my last commit! Also just noticed I used 4-spaces indentation on this file, for my defense it wasn't my usual computer. I've pushed two commits for ease of review, should all be squashed before merge :) |
Oh, and forgot to mention: thank you for your exhaustive review! :) |
On 18-08-16 08:27, Léo Gaspard wrote:
> Why are you packaging 0.3.10-rc11 instead of 0.3.9?
That's a good question. The honest answer is, I didn't pay attention. However, giving it a bit more thorough look, it seems that 0.3.9 is 2 years old. Across Debian, rpmfind, Gentoo and Archlinux, the only equivalent package appears to be globalplatformpro-git from AUR, that is 0.3.10-rc8.[somegitrev].
I don't have strong opinions on rolling back to 0.3.9, though :) it looks like it's a package a bit like tinc: the pre-release is stable, and the officially-stable version is ancient -- but I don't have many data points to prove this.
In that case I think packaging the rc is okay, especially because its a release candidate and not a beta. But if you want to do that, please open an upstream issue asking for a new release and link to that in a comment by the `version` attribute.
> [review comments]
I've replied to some of them, should have fixed everything in my last commit! Also just noticed I used 4-spaces indentation on this file, for my defense it wasn't my usual computer.
Alright I'll re-review. I would love if nix used some sensible indentation but of course the best indentation rule to follow is always the one of the project :)
I've pushed two commits for ease of review, should all be squashed before merge :)
Thanks!
Oh, and forgot to mention: thank you for your exhaustive review! :)
Thank you for understanding. I know that exhaustive review can be exhausting, but I think we should strive for a high quality standard :)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: global-platform-pro Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: global-platform-pro Partial log (click to expand)
|
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.
The changes look good to me 👍
The two remaining things I'd like to see are
- upstream report about the use of
git describe
- upstream request for a new version
- input from the
gephy
author
I think your first two points are fixed as per the latest push, let's wait for @Radvendii 's opinion about the |
Perfect, thank you! If @Radvendii doesn't respond until lets say monday, ping me and I'll merge. |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: global-platform-pro Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: global-platform-pro Partial log (click to expand)
|
@timokau Ping for merge |
Thank you! :) |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)