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

zeronet: init at 0.6.2 #40883

Merged
merged 1 commit into from Jun 2, 2018
Merged

zeronet: init at 0.6.2 #40883

merged 1 commit into from Jun 2, 2018

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented May 21, 2018

Motivation for this change

https://zeronet.io

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Is the path correct or should I put it under pkgs/servers?

This probably needs a nixos module too but I won't add it in this pr.


format = "other";

buildPhase = "python -O -m compileall .";
Copy link
Member

Choose a reason for hiding this comment

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

${python.interpreter} instead of python


# Wrap the main executable and set the log and data dir to something out of
# the store
fixupPhase = ''
Copy link
Member

Choose a reason for hiding this comment

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

Its intentional to replace any existing fixupPhase?

Copy link
Member Author

Choose a reason for hiding this comment

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

But there shouldn't be any, as I am using format="other". Or should I move it to postFixup anyway?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh well, moving it won't do any harm

@@ -0,0 +1,42 @@
{ stdenv, fetchFromGitHub, buildPythonApplication
Copy link
Member

Choose a reason for hiding this comment

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

applications should pass in python or pythonPackages, not the individual attributes.

@fgaz
Copy link
Member Author

fgaz commented May 21, 2018

@FRidh All done

@Chiiruno
Copy link
Contributor

Chiiruno commented May 21, 2018

Nice, maybe we'll get ZeroNet here soon.
You can probably for the most part copy this other zeronet commit for the module.
pkgs/applications/networking/p2p should be fine as it is, pkgs/servers is more for inbound network facing packages.

@fgaz
Copy link
Member Author

fgaz commented May 21, 2018

@Chiiruno oh... there was another pr?! I always forget to do a search before writing code and duplicating things >.<

@fgaz
Copy link
Member Author

fgaz commented May 21, 2018

Only now I see the horror that is that lib directory... What is the policy on vendoring here? Should I patch it to use upstream for each of those libraries?

@Chiiruno
Copy link
Contributor

Chiiruno commented May 21, 2018

AFAIK you shouldn't have to mess with the lib directory, and you don't necessarily need to implement all the config options that the other commit did.
See this module for ideas on the zeronet module, it shouldn't have to get more complex than that.
Make sure to add a user/group id to nixos/modules/misc/ids.nix and call your module in nixos/modules/module-list.nix.

@Chiiruno
Copy link
Contributor

Chiiruno commented May 21, 2018

This is one of those packages where the authors think its a good idea to bundle everything and do updating from within the application, see HelloZeroNet/ZeroNet#382.

This is likely going to need quite some patching to get rid of vendored dependencies. They also do some sys.path. manipulation in zeronet.py I saw.

From #31910

You may want to check if your package has a problem with any of that.

@@ -0,0 +1,41 @@
{ stdenv, fetchFromGitHub, python2Packages, python2 }:
Copy link
Member

Choose a reason for hiding this comment

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

python2Packages or python2. The interpreter is part of the package set, python2Packages.python, and the packages part of the interpreter, python2.pkgs

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@fgaz
Copy link
Member Author

fgaz commented Jun 1, 2018

@Chiiruno The path should be ok, and I think the deps will remain vendored for now

@xeji
Copy link
Contributor

xeji commented Jun 2, 2018

@GrahamcOfBorg build zeronet

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: zeronet

Partial log (click to expand)

Listing ./tools ...
Listing ./tools/coffee ...
Listing ./tools/tor ...
Compiling ./update.py ...
Compiling ./zeronet.py ...
installing
post-installation fixup
strip is /nix/store/r5mcn9vqq80v5pfqp45d7290cis7dwp4-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/nwdmga7cyl557la6wjplnilwvfjc2vr9-zeronet-0.6.2
/nix/store/nwdmga7cyl557la6wjplnilwvfjc2vr9-zeronet-0.6.2/share/zeronet.py: interpreter directive changed from "/usr/bin/env python2.7" to "/nix/store/q3ncxyf9ql0wffblk758a2790mjfvan6-python-2.7.15/bin/python2.7"

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: zeronet

Partial log (click to expand)

Compiling ./update.py ...
Compiling ./zeronet.py ...
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/hblz98pxggh1w63n2ig1wvd7xsl3a1xi-zeronet-0.6.2
strip is /nix/store/8yfik687kfccisxnad42j19lfb7ij9b4-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/hblz98pxggh1w63n2ig1wvd7xsl3a1xi-zeronet-0.6.2
/nix/store/hblz98pxggh1w63n2ig1wvd7xsl3a1xi-zeronet-0.6.2/share/zeronet.py: interpreter directive changed from "/usr/bin/env python2.7" to "/nix/store/1xkxxrd2sd8q78icm687ac8si9miak45-python-2.7.15/bin/python2.7"
checking for references to /build in /nix/store/hblz98pxggh1w63n2ig1wvd7xsl3a1xi-zeronet-0.6.2...
/nix/store/hblz98pxggh1w63n2ig1wvd7xsl3a1xi-zeronet-0.6.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: zeronet

Partial log (click to expand)

Listing ./tools/tor ...
Compiling ./update.py ...
Compiling ./zeronet.py ...
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/n5h2ad8jdvpvj63jh2f8ywada4cqs4b5-zeronet-0.6.2
strip is /nix/store/92d2ifxcni4n3zx9s8wnkcjlvnx5ajlc-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/n5h2ad8jdvpvj63jh2f8ywada4cqs4b5-zeronet-0.6.2
/nix/store/n5h2ad8jdvpvj63jh2f8ywada4cqs4b5-zeronet-0.6.2/share/zeronet.py: interpreter directive changed from "/usr/bin/env python2.7" to "/nix/store/xlc7ld1xd57ha3x9mbx11c84j290va0f-python-2.7.15/bin/python2.7"
checking for references to /build in /nix/store/n5h2ad8jdvpvj63jh2f8ywada4cqs4b5-zeronet-0.6.2...

@xeji xeji merged commit b25c251 into NixOS:master Jun 2, 2018
@xeji xeji mentioned this pull request Jun 2, 2018
8 tasks
@fgaz fgaz deleted the zeronet branch March 5, 2019 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants