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
WIP: hackish script to compare JSON from Guix and Nix #26105
Conversation
…here the two deviate
@rbvermaa here you go ;-) |
@@ -0,0 +1,81 @@ | |||
#!/usr/bin/python |
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.
Can you make this a package instead? Also /usr/bin/python
would never work directly on nixos.
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.
/usr/bin/env python
should work OK, I believe, though it seems better to explicitly state python2 or python3.
Both ways – maintainers/scripts/* and actual package – seem OK to me. It does seem targeted mainly on nixpkgs (or guix) contributors.
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.
alright, thanks. This is still WIP of course, more comments welcome. I will try to work a bit on using the homepage attribute to correlate packages as well.
If people are interested I could also check against for example Debian (fairly straightforward), or something like libraries.io. It might be worth exploring this topic a bit more.
import os, sys, json | ||
|
||
guixjsonfilename = '/tmp/packages-guix.json' | ||
nixjsonfilename = '/tmp/packages.json' |
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.
How would a user get both?
The Guix JSON is here: https://www.gnu.org/software/guix/packages/packages.json The Nix JSON is here: http://nixos.org/nixpkgs/packages.json.gz |
I could turn this into a more useful script, but I wanted to get some feedback first to see if it would be useful for people. |
Data is now downloaded from the Guix and Nix websites. What would be the right place in Nixpkgs to move this to? |
This doesn't seem to work anymore :( I guess because Nix' packages json is gone? |
It still seems to be there. Maybe it was a temporary glitch while the json was being regenerated? |
## NixOS exports the available packages in the stable channel | ||
## (for example: 17.03) as JSON | ||
## http://nixos.org/nixpkgs/packages.json.gz | ||
httpcon = httplib.HTTPConnection('nixos.org') |
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.
httpcon = httplib.HTTPConnection('nixos.org') | |
httpcon = httplib.HTTPSConnection('nixos.org') |
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, duh. I probably should be rewriting the script anyway to Python 3
I see now that it is just trying to fetch Seeing the output, is this something that https://repology.org/ also solves? |
This was merely a hackish script to provide something. Using repology instead makes perfect sense to me. |
This seems to be stalled and should probably be closed. @Mic92 @armijnhemel |
Happy to close it if someone wants to provide a good alternative based on repology. A the moment I have no time to fix the script. |
Does this solve your problem: https://github.com/matthiasbeyer/repolocli (shameless self-promotion)? If not, but it could, feel free to submit changes! |
The original goal was just to see how well we are doing being up to date, but also to make it more automatic instead of someone going to the repology website to check. I never got around to implementing that, so if your program could be used to make an alerting service that would be great :-) |
I plan to implement something like this, yes. Patches welcome! |
In that case I will close this one :-) |
Motivation for this change
Simple script to see where nixpkgs and guix deviate. This is still very much a WIP and needs a lot of spit and polish (hardcoded paths, etc.)
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)