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

python2.7-pluggy not buildable #117718

Closed
applike-ss opened this issue Mar 26, 2021 · 5 comments
Closed

python2.7-pluggy not buildable #117718

applike-ss opened this issue Mar 26, 2021 · 5 comments
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: python

Comments

@applike-ss
Copy link

Describe the bug
I am getting this error when pluggy is built as one of the dependencies in my docker build:

File "/tmp/nix-build-python2.7-pluggy-0.8.0.drv-0/easy_install-wpQldL/setuptools_scm-6.0.1/src/setuptools_scm/utils.py", line 41
    print(*k)
          ^
SyntaxError: invalid syntax
builder for '/nix/store/6b1ybjsxs32339zjnzyy94g6i0w66hi0-python2.7-pluggy-0.8.0.drv' failed with exit code 1

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/ss89/docker-rhodecode-ce
  2. cd docker-rhodecode-ce
  3. docker build .
  4. wait...

Expected behavior
There shouldn't be a build error for python2.7-pluggy.

Additional context
partial output from docker:

building '/nix/store/6b1ybjsxs32339zjnzyy94g6i0w66hi0-python2.7-pluggy-0.8.0.drv'...
unpacking sources
unpacking source archive /nix/store/g3118ms8fl3pv4ps2bprc37ik7g4ni1n-pluggy-0.8.0.tar.gz
source root is pluggy-0.8.0
setting SOURCE_DATE_EPOCH to timestamp 1539688357 of file pluggy-0.8.0/setup.cfg
patching sources
configuring
building
/tmp/nix-build-python2.7-pluggy-0.8.0.drv-0/easy_install-wpQldL/setuptools_scm-6.0.1/src
<pkg_resources.WorkingSet object at 0x7f4ab1b5ead0>
Traceback (most recent call last):
  File "nix_run_setup", line 8, in <module>
    exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
  File "setup.py", line 46, in <module>
    main()
  File "setup.py", line 41, in main
    packages=["pluggy"],
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/__init__.py", line 128, in setup
    _install_setup_requires(attrs)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/dist.py", line 461, in fetch_build_eggs
    replace_conflicting=True,
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/pkg_resources/__init__.py", line 866, in resolve
    replace_conflicting=replace_conflicting
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1146, in best_match
    return self.obtain(req, installer)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1158, in obtain
    return installer(requirement)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/dist.py", line 528, in fetch_build_egg
    return cmd.easy_install(req)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 699, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 882, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1150, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1136, in run_setup
    run_setup(setup_script, args)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/nix/store/fb993ma5m3y1hs95gay44j8mjjq5qlkl-python-2.7.15/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/nix/store/fb993ma5m3y1hs95gay44j8mjjq5qlkl-python-2.7.15/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/nix/store/dldi0k4v13439l1s1h52agc2i7bwcrxw-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/nix-build-python2.7-pluggy-0.8.0.drv-0/easy_install-wpQldL/setuptools_scm-6.0.1/setup.py", line 52, in <module>
    
  File "/tmp/nix-build-python2.7-pluggy-0.8.0.drv-0/easy_install-wpQldL/setuptools_scm-6.0.1/setup.py", line 29, in scm_config
    description="plugin and hook calling mechanisms for python",
  File "/tmp/nix-build-python2.7-pluggy-0.8.0.drv-0/easy_install-wpQldL/setuptools_scm-6.0.1/src/setuptools_scm/__init__.py", line 8, in <module>
  File "/tmp/nix-build-python2.7-pluggy-0.8.0.drv-0/easy_install-wpQldL/setuptools_scm-6.0.1/src/setuptools_scm/config.py", line 6, in <module>
  File "/tmp/nix-build-python2.7-pluggy-0.8.0.drv-0/easy_install-wpQldL/setuptools_scm-6.0.1/src/setuptools_scm/utils.py", line 41
    print(*k)
          ^
SyntaxError: invalid syntax
builder for '/nix/store/6b1ybjsxs32339zjnzyy94g6i0w66hi0-python2.7-pluggy-0.8.0.drv' failed with exit code 1
building '/nix/store/bawcrj33kj5vhfds3palsg9vd0pq9vhg-python2.7-py-1.6.0.drv'...
cannot build derivation '/nix/store/ib5jh2ahlrjmbcm9s2wr7gr2rr0f1k6n-python2.7-pytest-3.8.2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/4zfk72m3k7vy5fmaj0sv4mlf51zi5lcr-python2.7-elasticsearch-6.3.1.drv', '/nix/store/8ql2278xlj27j1p5m27v9vzgc7128k6r-python2.7-six-1.11.0.drv', '/nix/store/9s489gjcmzmsasnqk85m6p0375vjihq1-python2.7-elasticsearch-dsl-6.3.1.drv', '/nix/store/bawcrj33kj5vhfds3palsg9vd0pq9vhg-python2.7-py-1.6.0.drv', '/nix/store/d2apwj5bnfhyjxblg4qcg5a6c8yp43id-python2.7-pytest-cov-2.6.0.drv', '/nix/store/dd3l5w6y8h5znsc40y2ln72qk5qqbscr-python2.7-pytest-sugar-0.9.1.drv', '/nix/store/f5idw61xkr5psl253rmrqsrrh7iscs5k-python2.7-responses-0.5.1.drv', '/nix/store/gbyzw4znl7zg6zwcpjn90h4l8xqq8wqr-python2.7-elasticsearch1-dsl-0.0.12.drv', '/nix/store/ib5jh2ahlrjmbcm9s2wr7gr2rr0f1k6n-python2.7-pytest-3.8.2.drv', '/nix/store/ikg4l5iraif1r3icy9sb8z8rzv4k99ww-python2.7-pytest-runner-4.2.drv', '/nix/store/izabjdcbzz3jcy2cl0n92yng50vg5lsi-python2.7-urllib3-1.24.1.drv', '/nix/store/mz7jyjhhrzjnxxpnq1x288r9zpxzpsd0-python2.7-elasticsearch2-2.5.0.drv', '/nix/store/nmiiyiac38v8sxcc382qjs49djnpvvph-python2.7-requests-2.9.1.drv', '/nix/store/ynjsjcz26qckymg1w4f2xbczyga27fnl-python2.7-whoosh-2.7.4.drv' failed
The command '/bin/sh -c USER=root . /root/.nix-profile/etc/profile.d/nix.sh &&         cd rhodecode-develop/rhodecode-tools-ce &&         nix-shell' returned a non-zero code: 100
@rmcgibbo
Copy link
Contributor

rmcgibbo commented Mar 26, 2021

Because
(a) python2 is EOL,
(b) most upstream packages have already or are now dropping compatibility with python2, and
(c) nixpkgs rarely keeps multiple versions of a single package in the package,

I think this is going to be an expected and increasingly common occurrence.

It's probably better to either pin your nixpkgs to an old revision or upgrade your stack to python3.

@FRidh
Copy link
Member

FRidh commented Mar 27, 2021

an older version of pluggy can be added, if someone is up for doing this

@Gabriella439
Copy link
Contributor

Gabriella439 commented Apr 2, 2021

This can still be fixed by adding setuptools_scm to nativeBuildInputs for any derivations that fail in this way

What's happening is that setuptools doesn't find the setuptools_scm plugin when running the Nix build, so it attempts to impurely install the latest download of the plugin which is not Python-2-compatible. Adding setuptools_scm to nativeBuildInputs provides a Python 2 compatible version

@stale
Copy link

stale bot commented Oct 1, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 1, 2021
@FliegendeWurst
Copy link
Member

Build works on 21.11 and most likely current master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: python
Projects
None yet
Development

No branches or pull requests

6 participants