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

Build failure: python312Packages.psycopg #366014

Open
charmoniumQ opened this issue Dec 17, 2024 · 3 comments
Open

Build failure: python312Packages.psycopg #366014

charmoniumQ opened this issue Dec 17, 2024 · 3 comments
Labels
0.kind: build failure A package fails to build 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: python

Comments

@charmoniumQ
Copy link
Contributor

charmoniumQ commented Dec 17, 2024

Steps To Reproduce

Steps to reproduce the behavior:

  1. Copy this Nix flake

    {
      inputs = {
        nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
      };
      outputs = { self, nixpkgs }: {
        nixosConfigurations.test = nixpkgs.lib.nixosSystem {
          system = "aarch64-linux";
          modules = [ {
            system.stateVersion = "24.05";
            boot.loader.grub.devices = [ "/dev/sda" ];
            fileSystems."/" = {
              device = "/dev/sda1";
              fsType = "ext4";
            };
            services.paperless = {
              enable = true;
            };
          } ];
        };
        packages.aarch64-linux = {
          paperless-ngx = nixpkgs.legacyPackages.aarch64-linux.paperless-ngx;
          psycopg = nixpkgs.legacyPackages.aarch64-linux.python312Packages.psycopg;
        };
      };
    }
    
  2. Run nix build .#nixosConfigurations.test.config.system.build.toplevel

  3. After about 2 hours (I am cross-compiling to aarch64-linux), I see the following error:

    error: builder for '/nix/store/qqn9pscl8021bah21s4ph31km6c0m7yd-python3.12-psycopg-3.2.3.drv' failed with exit code 1;
    
           ...trimming the XPASS, XFAIL, and PASS lines...
    
           > FAILED tests/pool/test_pool_common_async.py::test_setup_no_timeout[asyncio-AsyncNullConnectionPool] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_common_async.py::test_setup_no_timeout[asyncio-AsyncConnectionPool] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_async.py::test_stats_connect[asyncio] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_async.py::test_refill_on_check[asyncio] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_async.py::test_connect_check_timeout[asyncio] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_async.py::test_reconnect_after_grow_failed[asyncio] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_null_async.py::test_stats_connect[asyncio] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool.py::test_stats_connect - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool.py::test_reconnect_after_grow_failed - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool.py::test_refill_on_check - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool.py::test_connect_check_timeout - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool.py::test_uniform_use - assert {1, 2, 3} == {2}
           > FAILED tests/test_concurrency_async.py::test_eintr[ITIMER_REAL-SIGALRM] - AssertionError: script terminated with SIGALRM
           > FAILED tests/test_concurrency_async.py::test_ctrl_c - AssertionError: process didn't start?
           > FAILED tests/pool/test_pool_common.py::test_setup_no_timeout[NullConnectionPool] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_common.py::test_setup_no_timeout[ConnectionPool] - ValueError: the proxy didn't start listening in time
           > FAILED tests/pool/test_pool_null.py::test_stats_connect - ValueError: the proxy didn't start listening in time
           > FAILED tests/test_concurrency.py::test_eintr[ITIMER_REAL-SIGALRM] - AssertionError: script terminated with SIGALRM
           > FAILED tests/test_concurrency.py::test_ctrl_c - AssertionError: process didn't start?
           > = 19 failed, 4919 passed, 197 skipped, 454 deselected, 37 xfailed, 2 xpassed in 2873.81s (0:47:53) =
           For full logs, run 'nix log /nix/store/qqn9pscl8021bah21s4ph31km6c0m7yd-python3.12-psycopg-3.2.3.drv'.
    error: 1 dependencies of derivation '/nix/store/5k9siwszm3hj4r9ajdrj6lgg2065538q-paperless-ngx-2.13.5.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/g0db28n49pc6xiqg68ybl0kdxagdzisl-unit-paperless-web.service.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/phjs36rg03alc4idb7lydgjn3mi9n3xm-system-units.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/gpvi9g9paljdqp2cfhwi24sjr9kqkkjf-etc.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/q0sbyx27snsj963x8rn74x2i7fh108gl-nixos-system-remote-25.05.20241213.3566ab7.drv' failed to build
    

Build log

Build Log, too big for GitHub issue

Additional context

  1. Not sure if this matters, but I am on an x86_64-linux host, cross-compiling for aarch64-linux.

  2. The odd thing is that nix build .#psycopg2 --system aarch64-linux (and paperless-ngx) build correctly. I can't isolate the failure except by building a whole NixOS Configuration.

  3. I am unable to disable tests on psycopg, probably because I don't understand how to override it correctly.

    paperless.package = pkgs.paperless-ngx.override (paperless-ngx-old-attrs: {
      python3 = paperless-ngx-old-attrs.python3.override {
         packageOverrides = self: pypkgs-old: {
          psycopg = pypkgs-old.psycopg.overridePythonAttrs {
            pytestCheckPhase = ''true'';
            doCheck = false;
          };
        };
      };
    });
    
  4. Why doesn't pytestCheckPhase have -x (stop after first failure)? Should it?

  5. Too my untrained eye, all of the broken should probably be skipped because they would conflict with the Nix sandbox.

    • test_setup_no_timeout, test_reconnect_after_grow_failed, test_setup_no_timeout: create warnings like the following:

      WARNING  psycopg.pool:pool.py:637 error connecting in 'pool-225': connection failed: connection to server at "127.0.0.1", port 54975 failed: Connection refused
              Is the server running on that host and accepting TCP/IP connections?
      

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.56, NixOS, 24.11 (Vicuna), 24.11.20241014.a3c0b3b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.25.0pre20240920_ca3fc169`
 - nixpkgs: `/home/sam/.nix-defexpr/channels/nixpkgs`

Notify maintainers

@SuperSandro2000 (last non-treewide committer)


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@charmoniumQ charmoniumQ added the 0.kind: build failure A package fails to build label Dec 17, 2024
@SuperSandro2000 SuperSandro2000 added 6.topic: python 6.topic: cross-compilation Building packages on a different platform than they will be used on labels Dec 17, 2024
@SuperSandro2000
Copy link
Member

Why doesn't pytestCheckPhase have -x (stop after first failure)? Should it?

No. We want to know all test failures and not abort at the first one and then abort the on the next one in the next build.

Not sure if this matters, but I am on an x86_64-linux host, cross-compiling for aarch64-linux.

Is your machine under heavy load? Maybe psycopg is tripping some timeouts in their test suite which are then triggered.


I don't think this is a packaging issue, more with your machine being under to much load or an upstream issue.

@charmoniumQ
Copy link
Contributor Author

charmoniumQ commented Dec 18, 2024

I don't think this is a packaging issue, more with your machine being under to much load or an upstream issue.

Machine is relatively modern and not under load, but it could be due to running in QEMU due to cross-compiling.

I couldn't figure out how to skip the tests. Maybe something similar to this would work?

pkgs.paperless-ngx.override (paperless-ngx-old-attrs: {
  python3 = paperless-ngx-old-attrs.python3.override {
     packageOverrides = self: pypkgs-old: {
      psycopg = pypkgs-old.psycopg.overridePythonAttrs {
        pytestCheckPhase = ''true'';
        doCheck = false;
      };
    };
  };
});

@SuperSandro2000
Copy link
Member

I think package overrides are broken for paperless-ngx because of the injected overrides for tesseract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: python
Projects
None yet
Development

No branches or pull requests

2 participants