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

rfc6555: init at 0.0.0 #67936

Merged
merged 1 commit into from Sep 8, 2019
Merged

rfc6555: init at 0.0.0 #67936

merged 1 commit into from Sep 8, 2019

Conversation

endocrimes
Copy link
Member

Motivation for this change

rfc6555 is a required dependency of OfflineIMAP 7.3.0.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

Copy link
Member

@spacekookie spacekookie left a comment

Choose a reason for hiding this comment

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

LGTM!

@d-goldin
Copy link
Contributor

d-goldin commented Sep 2, 2019

Briefly tested it with python 2.7 and 3.7 on NixOS and seems fine in both cases. Maybe it would be nice to briefly comment in the derivation why tests are disabled.

@endocrimes
Copy link
Member Author

@d-goldin Can do - they're currently disabled bc they require networking - is it preferable to keep them disabled or is there a way to allow networking during the checkPhase?

@d-goldin
Copy link
Contributor

d-goldin commented Sep 2, 2019

@endocrimes: Yeah, I tried it before and arrived at the same conclusion. Just thought it might make sense to leave a remark in the code so it can be patched in the future or just inform.

To my knowledge wrt. network access - while there might be some ways to hack around the sandbox, we shouldn't go there, as it would potentially sacrifice purity reproducibility. But also better to not keep hitting external resources from the build-infra.

So often such tests are either selectively disabled/removed or patched to not rely on external resources (ideally upstream of course).

@endocrimes
Copy link
Member Author

@d-goldin 👍 added a comment

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/52

@vcunat
Copy link
Member

vcunat commented Sep 4, 2019

is there a way to allow networking during the checkPhase?

No, the nix language still doesn't have a good way for that AFAIK. Well, you could cheat by creating a separate fixed-output derivation that produces something trivial on success (e.g. an empty file) and doing tests within that, but... there are also good arguments to try avoiding tests that require internet access. I believe that localhost networking should work fine already (even in the sandbox).

@endocrimes
Copy link
Member Author

@vcunat I’m well aware of the downsides of running tests that require network access 😅 - in this case I’m packaging a depending that I am not a maintainer of, so I have limited influence over that. In this case disabling checks is probably fine though.

@vcunat
Copy link
Member

vcunat commented Sep 4, 2019

If these are just exceptions, it might be worth trying to disable just those that need internet.

@d-goldin
Copy link
Contributor

d-goldin commented Sep 7, 2019

I'm not sure if the disabled tests are holding this PR back, but in case it helps, here is a commit that more selectively disables tests by using a pre-existing decorator: d-goldin@f796e1e

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

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

Seems fine, though I can't say I know python stuff well.

vcunat added a commit that referenced this pull request Sep 8, 2019
@vcunat
Copy link
Member

vcunat commented Sep 8, 2019

I took your patch with my nitpicks as b199e30. At a quick look, it might be worth submitting upstream, if you like.

@vcunat vcunat merged commit 4f2a3aa into NixOS:master Sep 8, 2019
@d-goldin
Copy link
Contributor

d-goldin commented Sep 8, 2019

@vcunat: Why doCheck alone was insufficient, is because it runs ${python.interpreter} setup.py test per default, but for that a test_suite should be defined in setup.py. What is done in the upstream repo instead is that they use toxto kick-off the tests and run for different "environments" (https://github.com/sethmlarson/rfc6555/blob/master/tox.ini#L8). For our purposes here trying to use tox would have been more complicated than just adjusting the phase.

Thanks.

@vcunat
Copy link
Member

vcunat commented Sep 8, 2019

Here I did checkPhase -> postCheck, so that we only extend the logic instead of overriding it. Long-term experience says it's much better that way.

dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Oct 2, 2019
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