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

Traceback when trying to build package #396

Closed
mnaser opened this issue Feb 9, 2022 · 2 comments · Fixed by #400
Closed

Traceback when trying to build package #396

mnaser opened this issue Feb 9, 2022 · 2 comments · Fixed by #400

Comments

@mnaser
Copy link

mnaser commented Feb 9, 2022

Hi there,

I'm trying to build the following code:

let
  pkgs = import <nixpkgs> {};
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix";
    ref = "refs/tags/3.4.0";
  }) {};
in
mach-nix.buildPythonApplication rec {
  pname = "keystone";
  version = "16.0.0";

  # Manually set version because pbr wants to get it from the git
  # upstream repository (and we are installing from tarball instead)
  PBR_VERSION = version;

  src = pkgs.fetchFromGitea {
    domain = "opendev.org";
    owner = "openstack";
    repo = pname;
    rev = version;
    sha256 = "sha256-tXTrN79jBOXdVLs4g0lrl1Bx8YYGYoPCedl1CzdQZcc=";
  };

  requirements = builtins.readFile "${src}/requirements.txt";
}

It's resulting in the following:

Traceback (most recent call last):
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generate.py", line 110, in <module>
    main()
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generate.py", line 103, in main
    do()
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generate.py", line 66, in do
    expr = generator.generate(reqs)
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generators/overides_generator.py", line 36, in generate
    pkgs = self.resolver.resolve(reqs)
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/resolver/resolvelib_resolver.py", line 83, in resolve
    remove_circles_and_print(nix_py_pkgs, self.nixpkgs)
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/deptree.py", line 97, in remove_circles_and_print
    print(format_tree(
  File "/nix/store/1jq9cw7vi7ij3wzwkqa3nipc7h43zikf-python3-3.9.9-env/lib/python3.9/site-packages/tree_format/_text.py", line 81, in format_tree
    return u'\n'.join(lines)
  File "/nix/store/1jq9cw7vi7ij3wzwkqa3nipc7h43zikf-python3-3.9.9-env/lib/python3.9/site-packages/tree_format/_text.py", line 53, in _format_tree
    format_node(child))])
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/deptree.py", line 78, in name
    if indexed_pkgs[node_name].build_inputs + indexed_pkgs[node_name].prop_build_inputs == []:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
error: builder for '/nix/store/is4v1wsxxryq0bfwgd8f0n616vbj9fz9-mach_nix_file.drv' failed with exit code 1;
       last 10 log lines:
       >     remove_circles_and_print(nix_py_pkgs, self.nixpkgs)
       >   File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/deptree.py", line 97, in remove_circles_and_print
       >     print(format_tree(
       >   File "/nix/store/1jq9cw7vi7ij3wzwkqa3nipc7h43zikf-python3-3.9.9-env/lib/python3.9/site-packages/tree_format/_text.py", line 81, in format_tree
       >     return u'\n'.join(lines)
       >   File "/nix/store/1jq9cw7vi7ij3wzwkqa3nipc7h43zikf-python3-3.9.9-env/lib/python3.9/site-packages/tree_format/_text.py", line 53, in _format_tree
       >     format_node(child))])
       >   File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/deptree.py", line 78, in name
       >     if indexed_pkgs[node_name].build_inputs + indexed_pkgs[node_name].prop_build_inputs == []:
       > TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
       For full logs, run 'nix log /nix/store/is4v1wsxxryq0bfwgd8f0n616vbj9fz9-mach_nix_file.drv'.
(use '--show-trace' to show detailed location information)

I'm trying to troubleshoot but it seems like it's an actual bug...

@mnaser
Copy link
Author

mnaser commented Feb 9, 2022

I added some print statements and it looks like the following is what fails it:

pysaml2
Traceback (most recent call last):
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generate.py", line 110, in <module>
    main()
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generate.py", line 103, in main
    do()
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generate.py", line 66, in do
    expr = generator.generate(reqs)
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/generators/overides_generator.py", line 36, in generate
    pkgs = self.resolver.resolve(reqs)
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/resolver/resolvelib_resolver.py", line 83, in resolve
    remove_circles_and_print(nix_py_pkgs, self.nixpkgs)
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/deptree.py", line 98, in remove_circles_and_print
    print(format_tree(
  File "/nix/store/1jq9cw7vi7ij3wzwkqa3nipc7h43zikf-python3-3.9.9-env/lib/python3.9/site-packages/tree_format/_text.py", line 81, in format_tree
    return u'\n'.join(lines)
  File "/nix/store/1jq9cw7vi7ij3wzwkqa3nipc7h43zikf-python3-3.9.9-env/lib/python3.9/site-packages/tree_format/_text.py", line 54, in _format_tree
    for result in _format_tree(child,
  File "/nix/store/1jq9cw7vi7ij3wzwkqa3nipc7h43zikf-python3-3.9.9-env/lib/python3.9/site-packages/tree_format/_text.py", line 67, in _format_tree
    format_node(children[-1]))])
  File "/nix/store/6dr20pzvf1k8y6804dw8q31nj4d7aamz-h88mkfsmnchwn89a3mbgh7d6ixy1di5l-source/mach_nix/deptree.py", line 78, in name
    if indexed_pkgs[node_name].build_inputs + indexed_pkgs[node_name].prop_build_inputs == []:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

Further troubleshooting shows that this issue happens when it gets to cryptography as node_name.

@mnaser
Copy link
Author

mnaser commented Feb 9, 2022

Interesting, adding the following:

providers.cryptography = "sdist";

helps get through it, but obviously that adds to the build time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant