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

Fix pythonPackages.sentry-sdk build #75039

merged 1 commit into from Dec 7, 2019

Fix pythonPackages.sentry-sdk build #75039

merged 1 commit into from Dec 7, 2019


Copy link

@duijf duijf commented Dec 5, 2019

Motivation for this change

The following command fails on Nixpkgs master:

nix-build -A python37Packages.sentry-sdk
Build output before
sentry_sdk (unittest.loader._FailedTest) ... ERROR

ERROR: sentry_sdk (unittest.loader._FailedTest)
ImportError: Failed to import test module: sentry_sdk
Traceback (most recent call last):
  File "/nix/store/drr8qcgiccfc5by09r5zc30flgwh1mbx-python3-3.7.5/lib/python3.7/unittest/", line 470, in _find_test_path
    package = self._get_module_from_name(name)
  File "/nix/store/drr8qcgiccfc5by09r5zc30flgwh1mbx-python3-3.7.5/lib/python3.7/unittest/", line 377, in _get_module_from_name
  File "/build/sentry-sdk-0.13.2/sentry_sdk/", line 1, in <module>
    from sentry_sdk.hub import Hub, init
  File "/build/sentry-sdk-0.13.2/sentry_sdk/", line 9, in <module>
    from sentry_sdk.scope import Scope
  File "/build/sentry-sdk-0.13.2/sentry_sdk/", line 6, in <module>
    from sentry_sdk.utils import logger, capture_internal_exceptions
  File "/build/sentry-sdk-0.13.2/sentry_sdk/", line 772, in <module>
    HAS_REAL_CONTEXTVARS, ContextVar = _get_contextvars()
  File "/build/sentry-sdk-0.13.2/sentry_sdk/", line 740, in _get_contextvars
    if not _is_threading_local_monkey_patched():
  File "/build/sentry-sdk-0.13.2/sentry_sdk/", line 721, in _is_threading_local_monkey_patched
    from eventlet.patcher import is_monkey_patched  # type: ignore
  File "/nix/store/c7gzwdfhpq2a9ix6xy15fv4fjn1s57fs-python3.7-eventlet-0.25.1/lib/python3.7/site-packages/eventlet/", line 10, in <module>
    from eventlet import convenience
  File "/nix/store/c7gzwdfhpq2a9ix6xy15fv4fjn1s57fs-python3.7-eventlet-0.25.1/lib/python3.7/site-packages/eventlet/", line 7, in <module>
    from import socket
  File "/nix/store/c7gzwdfhpq2a9ix6xy15fv4fjn1s57fs-python3.7-eventlet-0.25.1/lib/python3.7/site-packages/eventlet/green/", line 21, in <module>
    from import greendns
  File "/nix/store/c7gzwdfhpq2a9ix6xy15fv4fjn1s57fs-python3.7-eventlet-0.25.1/lib/python3.7/site-packages/eventlet/support/", line 69, in <module>
    setattr(dns.rdtypes.IN, pkg, import_patched('dns.rdtypes.IN.' + pkg))
  File "/nix/store/c7gzwdfhpq2a9ix6xy15fv4fjn1s57fs-python3.7-eventlet-0.25.1/lib/python3.7/site-packages/eventlet/support/", line 59, in import_patched
    return patcher.import_patched(module_name, **modules)
  File "/nix/store/c7gzwdfhpq2a9ix6xy15fv4fjn1s57fs-python3.7-eventlet-0.25.1/lib/python3.7/site-packages/eventlet/", line 126, in import_patched
    *additional_modules + tuple(kw_additional_modules.items()))
  File "/nix/store/c7gzwdfhpq2a9ix6xy15fv4fjn1s57fs-python3.7-eventlet-0.25.1/lib/python3.7/site-packages/eventlet/", line 100, in inject
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
  File "/nix/store/grdm0zv2b7blma4ykb11nvb6g7xw8jcz-python3.7-dnspython-1.16.0/lib/python3.7/site-packages/dns/rdtypes/IN/", line 25, in <module>
    _proto_tcp = socket.getprotobyname('tcp')
OSError: protocol not found

Ran 1 test in 0.000s

FAILED (errors=1)
Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>
builder for '/nix/store/aq3bs2hpacj0jaj0zgpjlkajgxvpxhm0-python3.7-sentry-sdk-0.13.2.drv' failed with exit code 1
error: build of '/nix/store/aq3bs2hpacj0jaj0zgpjlkajgxvpxhm0-python3.7-sentry-sdk-0.13.2.drv' failed

The test suite wants to read /etc/protocols, but this file isn't available in the sandbox by default.

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 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 (Could not find docs)
  • Fits
Notify maintainers

cc @gebner

@duijf duijf requested review from FRidh and jonringer as code owners Dec 5, 2019
@ofborg ofborg bot added the 6.topic: python label Dec 5, 2019
@duijf duijf mentioned this pull request Dec 5, 2019
5 of 10 tasks complete
@ofborg ofborg bot requested a review from gebner Dec 5, 2019
Copy link

@jonringer jonringer left a comment

I meant to fix this actually, but thanks for doing it for me! :)

do you mind squashing the commits? otherwise LGTM

@duijf duijf force-pushed the duijf:fix-sentry-sdk branch 2 times, most recently from c6e2b5e to 87af0c7 Dec 7, 2019
Copy link
Contributor Author

@duijf duijf commented Dec 7, 2019


@duijf duijf requested a review from jonringer Dec 7, 2019
This package could not build because the tests require /etc/protocols.
Therefore, make this file available using libredirect.
@gebner gebner merged commit f669d0c into NixOS:master Dec 7, 2019
13 checks passed
13 checks passed
Evaluation Performance Report Evaluator Performance Report
grahamcofborg-eval ^.^!
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
grahamcofborg-eval-check-meta config.nix: checkMeta = true
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
grahamcofborg-eval-package-list nix-env -qa --json --file .
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
@duijf duijf deleted the duijf:fix-sentry-sdk branch Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.