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

[BUG] PyPy: TypeError: 'NoneType' object is not subscriptable (key slice(None, None, None)) #4621

Closed
hugovk opened this issue Sep 1, 2024 · 2 comments

Comments

@hugovk
Copy link
Contributor

hugovk commented Sep 1, 2024

setuptools version

setuptools==72.2.0

Python version

PyPy 3.10

OS

Ubuntu and macOS but not Windows

Additional environment information

No response

Description

Running python -m pip install . for https://github.com/ultrajson/ultrajson fails for Ubuntu and macOS but not Windows.

Our CI passed on 1st August (when 72.1.0 was current):

https://github.com/ultrajson/ultrajson/actions/runs/10192609686

And failed today with no other code changes (74.0.0 is current):

https://github.com/ultrajson/ultrajson/actions/runs/10651820147

Pinning our build backend to older versions, the first one to fail was 72.2.0 from 2nd August:

https://github.com/hugovk/ultrajson/actions/runs/10656680834

The end of the traceback reads:

        File "/tmp/pip-build-env-hfi_5v1q/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/unixccompiler.py", line 268, in link
          linker = (
      TypeError: 'NoneType' object is not subscriptable (key slice(None, None, None))

This seems to track with the changes in 72.2.0:

Merged with pypa/distutils@b7ee725f3 including: Support for Pathlike objects in data files and extensions (pypa/distutils#272, pypa/distutils#237), native support for C++ compilers (pypa/distuils#228) and removed unused get_msvcr() (pypa/distutils#274). (#4538)

https://setuptools.pypa.io/en/stable/history.html#v72-2-0

Expected behavior

It should build for PyPy3.10, as it did for 72.1.0, and as it does for CPython 3.8-3.13.

How to Reproduce

With pypy3.10:

git clone https://github.com/ultrajson/ultrajson
cd ultrajson
git checkout 60e68ab041e09c72805895531a0d8bd5260d1950 # commit before pinning setuptools < 72.2
python -m pip install -e .

Output

...
Processing /home/runner/work/ultrajson/ultrajson
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: ujson
  Building wheel for ujson (pyproject.toml): started
  Building wheel for ujson (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for ujson (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [92 lines of output]
      /tmp/pip-build-env-hfi_5v1q/overlay/lib/pypy3.10/site-packages/setuptools_scm/git.py:167: UserWarning: "/home/runner/work/ultrajson/ultrajson" is shallow and may cause errors
        warnings.warn(f'"{wd.path}" is shallow and may cause errors')
      running bdist_wheel
      running build
      running build_py
      running build_ext
      building 'ujson' extension
      creating build
      creating build/temp.linux-x86_64-pypy310
      creating build/temp.linux-x86_64-pypy310/src
      creating build/temp.linux-x86_64-pypy310/src/_vendor
      creating build/temp.linux-x86_64-pypy310/src/_vendor/double-conversion
      creating build/temp.linux-x86_64-pypy310/src/_vendor/double-conversion/double-conversion
      creating build/temp.linux-x86_64-pypy310/src/lib
      creating build/temp.linux-x86_64-pypy310/src/python
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/bignum-dtoa.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/bignum-dtoa.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/bignum.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/bignum.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/cached-powers.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/cached-powers.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/double-to-string.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/double-to-string.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/fast-dtoa.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/fast-dtoa.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/fixed-dtoa.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/fixed-dtoa.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/string-to-double.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/string-to-double.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/_vendor/double-conversion/double-conversion/strtod.cc -o build/temp.linux-x86_64-pypy310/./src/_vendor/double-conversion/double-conversion/strtod.o -D_GNU_SOURCE
      g++ -pthread -DNDEBUG -O2 -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/lib/dconv_wrapper.cc -o build/temp.linux-x86_64-pypy310/./src/lib/dconv_wrapper.o -D_GNU_SOURCE
      gcc -pthread -DNDEBUG -O2 -DDEBUG -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/lib/ultrajsondec.c -o build/temp.linux-x86_64-pypy310/./src/lib/ultrajsondec.o -D_GNU_SOURCE
      gcc -pthread -DNDEBUG -O2 -DDEBUG -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/lib/ultrajsonenc.c -o build/temp.linux-x86_64-pypy310/./src/lib/ultrajsonenc.o -D_GNU_SOURCE
      gcc -pthread -DNDEBUG -O2 -DDEBUG -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/python/JSONtoObj.c -o build/temp.linux-x86_64-pypy310/./src/python/JSONtoObj.o -D_GNU_SOURCE
      gcc -pthread -DNDEBUG -O2 -DDEBUG -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/python/objToJSON.c -o build/temp.linux-x86_64-pypy310/./src/python/objToJSON.o -D_GNU_SOURCE
      gcc -pthread -DNDEBUG -O2 -DDEBUG -fPIC -I./src/python -I./src/lib -I./src/_vendor/double-conversion/double-conversion -I/opt/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10 -c ./src/python/ujson.c -o build/temp.linux-x86_64-pypy310/./src/python/ujson.o -D_GNU_SOURCE
      creating build/lib.linux-x86_64-pypy310
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 2[51](https://github.com/hugovk/ultrajson/actions/runs/10656680834/job/29535602935#step:4:52), in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-hfi_5v1q/overlay/lib/pypy3.10/site-packages/setuptools/build_meta.py", line 415, in build_wheel
          return self._build_with_temp_dir(
        File "/tmp/pip-build-env-hfi_5v1q/overlay/lib/pypy3.10/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
      TypeError: 'NoneType' object is not subscriptable (key slice(None, None, None))
      [end of output]
@hugovk hugovk added bug Needs Triage Issues that need to be evaluated for severity and status. labels Sep 1, 2024
@abravalheri
Copy link
Contributor

Possibly a duplicate of pypa/distutils#283?

@jaraco
Copy link
Member

jaraco commented Sep 2, 2024

Yes, I think so. Let's follow the issue there.

@jaraco jaraco closed this as completed Sep 2, 2024
@jaraco jaraco added duplicate and removed Needs Triage Issues that need to be evaluated for severity and status. labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants