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.0 #31910

Closed
wants to merge 5 commits into from
Closed

Conversation

matthiasbeyer
Copy link
Contributor

Motivation for this change

Closing #31566

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.

As upstream does not ship a setup.py in the repository, we have to copy the sources "by hand" to $out/bin. Unfortunately, that somehow breaks the code and it fails with

- Starting ZeroNet...
ERROR:root:Unhandled exception: No module named gevent
Traceback (most recent call last):
  File "/nix/store/zhycgdhdradx0ihl5nf5a379y5krpm6l-zeronet-0.6.0/bin/.zeronet.py-wrapped", line 19, in main
    import main
  File "/nix/store/zhycgdhdradx0ihl5nf5a379y5krpm6l-zeronet-0.6.0/bin/src/main.py", line 9, in <module>
    import gevent
ImportError: No module named gevent
Traceback (most recent call last):
  File "/nix/store/zhycgdhdradx0ihl5nf5a379y5krpm6l-zeronet-0.6.0/bin/.zeronet.py-wrapped", line 92, in <module>
    main()
  File "/nix/store/zhycgdhdradx0ihl5nf5a379y5krpm6l-zeronet-0.6.0/bin/.zeronet.py-wrapped", line 65, in main
    traceback.print_exc(file=open(config.log_dir + "/error.log", "a"))
AttributeError: 'Config' object has no attribute 'log_dir'

(There's also no configuration as it seems)

@matthiasbeyer
Copy link
Contributor Author

REL: HelloZeroNet/ZeroNet#1192

@matthiasbeyer
Copy link
Contributor Author

With the latest commit this works, if the user has sufficient rights on the directories.

As I want to turn this into a nixos service, this shouldn't be an issue... DO NOT MERGE!!!

@matthiasbeyer
Copy link
Contributor Author

Added service file - so now, as always: Please tell me how to properly test this!

data_dir = ${cfg.dataDir}
log_dir = ${cfg.logDir}
''
+ (ifNotNull cfg.uiIP
Copy link
Member

Choose a reason for hiding this comment

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

Its not needed to implemented all configuration options. Considering many do not have a description I suggest just using extraConfig for them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed some, feel free to suggest more... I will provide descriptions for the rest then.

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

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.


propagatedBuildInputs = with pythonPackages; [ gevent msgpack ];

phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
Copy link
Member

Choose a reason for hiding this comment

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

format = "other";
buildPhase = ":";

The phases should typically not be touched as you may loose phases that are relevant.

enable = true;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = "${pkgs.zeronet}/bin/zeronet.py --conf_file ${configFile}";
Copy link
Member

Choose a reason for hiding this comment

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

Executables should not have an extension, and especially in the case of Python where it would create bytecode.

@Chiiruno
Copy link
Contributor

Any progress?

@Chiiruno Chiiruno mentioned this pull request May 21, 2018
8 tasks
@xeji
Copy link
Contributor

xeji commented Jun 2, 2018

Closing in favor of #40883 since this seems stalled.

@xeji xeji closed this Jun 2, 2018
@matthiasbeyer matthiasbeyer deleted the add-zeronet branch November 9, 2019 16:40
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

6 participants