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

[staging-next] python3Packages.httplib2: allow local networking on darwin #120201

Merged
merged 1 commit into from Apr 23, 2021

Conversation

mweinelt
Copy link
Member

@mweinelt mweinelt commented Apr 22, 2021

Motivation for this change

https://hydra.nixos.org/build/141751890

This should hopefully fix the following testsuite error:

___________________________ test_timeout_subsequent ____________________________
tests/test_other.py:137: in test_timeout_subsequent
    assert response.status == 200
E   assert 408 == 200
E     +408
E     -200
        Handler    = <class 'tests.test_other.test_timeout_subsequent.<locals>.Handler'>
        _          = b'Request Timeout'
        http       = <httplib2.Http object at 0x10860f400>
        response   = {'content-type': 'text/plain', 'status': '408', 'content-length': 15}
        uri        = 'http://localhost:58287/'
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 311, in server_socket_thread
    fun(client, tick)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 392, in server_request_socket_handler
    request = HttpRequest.from_buffered(buf)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 177, in from_buffered
    return parse_http_message(cls, buf)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 120, in parse_http_message
    start_line = buf.readline()
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 110, in readline
    self._fill(more=1)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 81, in _fill
    chunk = self._sock.recv(8 << 10)
ConnectionResetError: [Errno 54] Connection reset by peer

Needs to be build on x86-64-darwin.

#119398

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Apr 22, 2021
@mweinelt mweinelt changed the title python3Packages.httplib2: allow local networking on darwin [staging-next] python3Packages.httplib2: allow local networking on darwin Apr 22, 2021
@ofborg ofborg bot requested a review from fabaff April 22, 2021 12:00
@jonringer
Copy link
Contributor

cc @NixOS/darwin-maintainers or @SuperSandro2000 can you verify that this fixes the build?

nixpkgs-review pr 120201 --package python3Packages.httplib2

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Build and I get this warning from hammering:

warning: unused-argument
Unused argument: stdenv.
Near pkgs/development/python-modules/httplib2/default.nix:1:3:

────────────────────
  |
1 | { stdenv
  |   ^
────────────────────

There is just one test failure on darwin, and it can probably be worked
around by allowing local networking.

This should hopefully fix the following testsuite error:

```
___________________________ test_timeout_subsequent ____________________________
tests/test_other.py:137: in test_timeout_subsequent
    assert response.status == 200
E   assert 408 == 200
E     +408
E     -200
        Handler    = <class 'tests.test_other.test_timeout_subsequent.<locals>.Handler'>
        _          = b'Request Timeout'
        http       = <httplib2.Http object at 0x10860f400>
        response   = {'content-type': 'text/plain', 'status': '408', 'content-length': 15}
        uri        = 'http://localhost:58287/'
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 311, in server_socket_thread
    fun(client, tick)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 392, in server_request_socket_handler
    request = HttpRequest.from_buffered(buf)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 177, in from_buffered
    return parse_http_message(cls, buf)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 120, in parse_http_message
    start_line = buf.readline()
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 110, in readline
    self._fill(more=1)
  File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 81, in _fill
    chunk = self._sock.recv(8 << 10)
ConnectionResetError: [Errno 54] Connection reset by peer
```
@mweinelt
Copy link
Member Author

Addressed.

@mweinelt
Copy link
Member Author

@SuperSandro2000 Is this ready to go?

@SuperSandro2000 SuperSandro2000 merged commit 9896bb0 into NixOS:staging-next Apr 23, 2021
@vcunat
Copy link
Member

vcunat commented Apr 23, 2021

I'm afraid it still doesn't work on our Hydra: https://hydra.nixos.org/build/141769972

EDIT: or more precisely, it built there before this merge (thanks to tests being disabled on darwin) but got broken now.

@mweinelt
Copy link
Member Author

Lets just skip this specific test then.

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

4 participants