deadsnakes / issues

Issues for https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
86 stars 6 forks source link

Possible regression with Python 3.10.1-1+focal3 and psycopg-binary / venv #191

Closed nth10sd closed 2 years ago

nth10sd commented 2 years ago

description

Installing psycopg-binary==2.8.6 on Ubuntu 20.04 on GitHub Actions works with python3.10-dev 3.10.1-1+focal2 but not with python3.10-dev 3.10.1-1+focal3.

os information

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

uname -a

Linux fv-az203-222 5.11.0-1022-azure #23~20.04.1-Ubuntu SMP Fri Nov 19 10:20:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Failure log:

warnings.warn(
  running install
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py", line 593, in <module>
      setup(name="psycopg2-binary",
    File "/venv-py310/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
      return run_commands(dist)
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
      dist.run_commands()
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
      self.run_command(cmd)
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
      cmd_obj.run()
    File "/venv-py310/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 335, in run
      self.run_command('install')
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 985, in run_command
      cmd_obj.ensure_finalized()
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
      self.finalize_options()
    File "/venv-py310/lib/python3.10/site-packages/setuptools/command/install.py", line 45, in finalize_options
      orig.install.finalize_options(self)
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 366, in finalize_options
      self.finalize_unix()
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 539, in finalize_unix
      self.select_scheme("posix_prefix")
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 564, in select_scheme
      _select_scheme(self, name)
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 127, in _select_scheme
      vars(ob).update(_remove_set(ob, _scheme_attrs(_resolve_scheme(name))))
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 153, in _scheme_attrs
      return {
    File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 154, in <dictcomp>
      f'install_{key}': scheme[key]
  KeyError: 'headers'
  ----------------------------------------
  Running setup.py clean for psycopg2-binary
  ERROR: Failed building wheel for psycopg2-binary

We were trying to run the following in docker (having installed libpq-dev gcc python3.10 python3.10-dev python3.10-venv python3-pip python3-wheel build-essential via apt-get:

RUN python3.10 -m venv /venv-py310

ENV VIRTUAL_ENV=/venv-py310
ENV PATH="/venv-py310/bin:$PATH"

RUN mkdir /build
WORKDIR /build
COPY someapp someapp/
COPY setup.py .

RUN pip install --no-cache-dir --upgrade pip setuptools wheel ;
RUN pip install --no-cache-dir --upgrade -e . ;  # psycopg2-binary, listed as a dependency here, fails at this step with python3.10-dev 3.10.1-1+focal3 but not with python3.10-dev 3.10.1-1+focal2

We tried to pin 3.10.1-1+focal2 as a workaround but it seems to no longer be available.

nth10sd commented 2 years ago

Are these changes in focal3 a likely cause? Or should the docker commands I listed above be changed?

nth10sd commented 2 years ago

Things seemed to work with 3.10.1-1+focal1 as well.

asottile commented 2 years ago

do you have a link to the action output?

nth10sd commented 2 years ago

It's in a private repo, sorry, but here's a larger snippet:

Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.6-py3-none-any.whl (97 kB)
Building wheels for collected packages: psycopg2-binary
  Building wheel for psycopg2-binary (setup.py): started
  Building wheel for psycopg2-binary (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /venv-py310/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-t1lq9aap
       cwd: /tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/
  Complete output (99 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.10
  creating build/lib.linux-x86_64-3.10/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.10/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.10/psycopg2
  running build_ext
  creating build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/psycopg
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_asis.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_binary.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_binary.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_datetime.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_datetime.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_list.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_list.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_pboolean.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pboolean.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_pdecimal.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pdecimal.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_pfloat.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pfloat.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_pint.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pint.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/adapter_qstring.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_qstring.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/aix_support.c -o build/temp.linux-x86_64-3.10/psycopg/aix_support.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/bytes_format.c -o build/temp.linux-x86_64-3.10/psycopg/bytes_format.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/column_type.c -o build/temp.linux-x86_64-3.10/psycopg/column_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/connection_int.c -o build/temp.linux-x86_64-3.10/psycopg/connection_int.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/connection_type.c -o build/temp.linux-x86_64-3.10/psycopg/connection_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/conninfo_type.c -o build/temp.linux-x86_64-3.10/psycopg/conninfo_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/cursor_int.c -o build/temp.linux-x86_64-3.10/psycopg/cursor_int.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/cursor_type.c -o build/temp.linux-x86_64-3.10/psycopg/cursor_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/diagnostics_type.c -o build/temp.linux-x86_64-3.10/psycopg/diagnostics_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/error_type.c -o build/temp.linux-x86_64-3.10/psycopg/error_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/green.c -o build/temp.linux-x86_64-3.10/psycopg/green.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/libpq_support.c -o build/temp.linux-x86_64-3.10/psycopg/libpq_support.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/lobject_int.c -o build/temp.linux-x86_64-3.10/psycopg/lobject_int.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/lobject_type.c -o build/temp.linux-x86_64-3.10/psycopg/lobject_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/microprotocols.c -o build/temp.linux-x86_64-3.10/psycopg/microprotocols.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/microprotocols_proto.c -o build/temp.linux-x86_64-3.10/psycopg/microprotocols_proto.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/notify_type.c -o build/temp.linux-x86_64-3.10/psycopg/notify_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/pqpath.c -o build/temp.linux-x86_64-3.10/psycopg/pqpath.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.10/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/replication_connection_type.c -o build/temp.linux-x86_64-3.10/psycopg/replication_connection_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/replication_cursor_type.c -o build/temp.linux-x86_64-3.10/psycopg/replication_cursor_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/replication_message_type.c -o build/temp.linux-x86_64-3.10/psycopg/replication_message_type.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/solaris_support.c -o build/temp.linux-x86_64-3.10/psycopg/solaris_support.o -Wdeclaration-after-statement
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=120009 -DHAVE_LO64=1 -I/venv-py310/include -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/typecast.c -o build/temp.linux-x86_64-3.10/psycopg/typecast.o -Wdeclaration-after-statement
    Running setup.py install for psycopg2-binary: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /venv-py310/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-j3nr2u0n/install-record.txt --single-version-externally-managed --compile --install-headers /venv-py310/include/site/python3.10/psycopg2-binary
         cwd: /tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/
    Complete output (34 lines):
    running install
    /venv-py310/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py", line 593, in <module>
        setup(name="psycopg2-binary",
      File "/venv-py310/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
        return run_commands(dist)
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
        dist.run_commands()
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
        self.run_command(cmd)
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 985, in run_command
        cmd_obj.ensure_finalized()
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/venv-py310/lib/python3.10/site-packages/setuptools/command/install.py", line 45, in finalize_options
        orig.install.finalize_options(self)
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 366, in finalize_options
        self.finalize_unix()
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 539, in finalize_unix
        self.select_scheme("posix_prefix")
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 564, in select_scheme
        _select_scheme(self, name)
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 127, in _select_scheme
        vars(ob).update(_remove_set(ob, _scheme_attrs(_resolve_scheme(name))))
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 153, in _scheme_attrs
        return {
      File "/venv-py310/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 154, in <dictcomp>
        f'install_{key}': scheme[key]
    KeyError: 'headers'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /venv-py310/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u5omxv1z/psycopg2-binary_e13413a58c174fcb95a8a731e59cb346/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-j3nr2u0n/install-record.txt --single-version-externally-managed --compile --install-headers /venv-py310/include/site/python3.10/psycopg2-binary Check the logs for full command output.
The command '/bin/sh -c pip install --no-cache-dir --upgrade -e . ;' returned a non-zero code: 1
asottile commented 2 years ago

fwiw your company should consider sponsoring if you're looking for support

nth10sd commented 2 years ago

fwiw your company should consider sponsoring if you're looking for support

Just sent a little something over from my own personal finances, I'm grateful for your help as a fellow open source contributor.

(I'll grab a cheaper dinner tonight or skip a drink)

asottile commented 2 years ago

I'm not sure I have enough information to reproduce, it looks like the setuptools version might be involved as well? I know they recently shipped a pretty significant breaking change

the error looks like they're trying to index into sysconfig schemes but using the distutils name (in sysconfig it's include, in distutils it's headers)

additionally, it's a little odd to be building psycopg2-binary, usually the point of that package is to have prebuilt wheels (which it looks like are only available for 3.10 in 2.9.1+

nth10sd commented 2 years ago

it looks like the setuptools version might be involved as well? I know they recently shipped a pretty significant breaking change

the error looks like they're trying to index into sysconfig schemes but using the distutils name (in sysconfig it's include, in distutils it's headers)

This! I pinned setuptools to 59.8.0 and the error was fixed! Thanks!

(I'm unsure if your focal3 changes are related then, though)

UncleOwen commented 2 years ago

Hmm, interesting. I'm seeing the same behavior on my personal pet project. And that is still on setuptools 59.2.0. Could you please have a look at https://gitlab.com/UncleOwen/primes - just git clone and tox -e py310 should trigger the bug.

And I'm seeing this behavior on two machines. One was updated from focal2 to focal3 in the morning, the other one in the afternoon. And on both cases, that's when the build started failing.

asottile commented 2 years ago

can you retry with the latest version of setuptools? I believe upstream has fixed the headers / include mismatch

UncleOwen commented 2 years ago

👍 Build works again!