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

"ZIP does not support timestamps before 1980" on pip install lazy-object-proxy #418

Closed
bersbersbers opened this issue Sep 2, 2021 · 3 comments
Labels

Comments

@bersbersbers
Copy link

Probably related: pypa/pip#9910

[09:44:28] user@host:project$ python --version
Python 3.10.0rc1

[09:47:45] user@host:project$ pip --version
pip 21.2.4 from /data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/site-packages/pip (python 3.10)

[09:44:16] user@host:project$ pip install lazy-object-proxy
Collecting lazy-object-proxy
  Using cached lazy-object-proxy-1.6.0.tar.gz (44 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: lazy-object-proxy
  Building wheel for lazy-object-proxy (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /data2/user/opt/pyenv/versions/3.10.0rc1/bin/python3.10 /data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp13p6yazy
       cwd: /tmp/pip-install-nr5pawif/lazy-object-proxy_931df5c0ebdf4772b86536b5cda508f5
  Complete output (84 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/lazy_object_proxy
  copying src/lazy_object_proxy/utils.py -> build/lib.linux-x86_64-3.10/lazy_object_proxy
  copying src/lazy_object_proxy/slots.py -> build/lib.linux-x86_64-3.10/lazy_object_proxy
  copying src/lazy_object_proxy/compat.py -> build/lib.linux-x86_64-3.10/lazy_object_proxy
  copying src/lazy_object_proxy/simple.py -> build/lib.linux-x86_64-3.10/lazy_object_proxy
  copying src/lazy_object_proxy/_version.py -> build/lib.linux-x86_64-3.10/lazy_object_proxy
  copying src/lazy_object_proxy/__init__.py -> build/lib.linux-x86_64-3.10/lazy_object_proxy
  copying src/lazy_object_proxy/utils_py3.py -> build/lib.linux-x86_64-3.10/lazy_object_proxy
  running build_ext
  building 'lazy_object_proxy.cext' extension
  creating build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/src
  creating build/temp.linux-x86_64-3.10/src/lazy_object_proxy
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG /data2/user/opt -fPIC -Isrc/lazy_object_proxy -I/data2/user/opt/pyenv/versions/3.10.0rc1/include/python3.10 -c src/lazy_object_proxy/cext.c -o build/temp.linux-x86_64-3.10/src/lazy_object_proxy/cext.o
  gcc: warning: /data2/user/opt: linker input file unused because linking not done
  gcc -pthread -shared -L/data2/user/opt/pyenv/versions/3.10.0rc1/lib -L/data2/user/opt/pyenv/versions/3.10.0rc1/lib build/temp.linux-x86_64-3.10/src/lazy_object_proxy/cext.o -o build/lib.linux-x86_64-3.10/lazy_object_proxy/cext.cpython-310-x86_64-linux-gnu.so
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/utils.py -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/slots.py -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/cext.cpython-310-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/compat.py -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/simple.py -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/_version.py -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/__init__.py -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  copying build/lib.linux-x86_64-3.10/lazy_object_proxy/utils_py3.py -> build/bdist.linux-x86_64/wheel/lazy_object_proxy
  running install_egg_info
  running egg_info
  writing src/lazy_object_proxy.egg-info/PKG-INFO
  writing dependency_links to src/lazy_object_proxy.egg-info/dependency_links.txt
  writing top-level names to src/lazy_object_proxy.egg-info/top_level.txt
  reading manifest file 'src/lazy_object_proxy.egg-info/SOURCES.txt'
  adding license file 'LICENSE'
  adding license file 'AUTHORS.rst'
  writing manifest file 'src/lazy_object_proxy.egg-info/SOURCES.txt'
  Copying src/lazy_object_proxy.egg-info to build/bdist.linux-x86_64/wheel/lazy_object_proxy-1.6.0-py3.10.egg-info
  running install_scripts
  adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
  adding license file "AUTHORS.rst" (matched pattern "AUTHORS*")
  creating build/bdist.linux-x86_64/wheel/lazy_object_proxy-1.6.0.dist-info/WHEEL
  creating '/tmp/pip-wheel-01vtgwnt/tmp1y3cujw4/lazy_object_proxy-1.6.0-cp310-cp310-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
  Traceback (most recent call last):
    File "/data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
      main()
    File "/data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 248, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 221, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 207, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 258, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 65, in <module>
      setup(
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 361, in run
      wf.write_files(archive_root)
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/wheel/wheelfile.py", line 124, in write_files
      self.write(path, arcname)
    File "/tmp/pip-build-env-8y__t1k3/overlay/lib/python3.10/site-packages/wheel/wheelfile.py", line 135, in write
      zinfo = ZipInfo(arcname or filename, date_time=get_zipinfo_datetime(st.st_mtime))
    File "/data2/user/opt/pyenv/versions/3.10.0rc1/lib/python3.10/zipfile.py", line 362, in __init__
      raise ValueError('ZIP does not support timestamps before 1980')
  ValueError: ZIP does not support timestamps before 1980
  ----------------------------------------
  ERROR: Failed building wheel for lazy-object-proxy
Failed to build lazy-object-proxy
ERROR: Could not build wheels for lazy-object-proxy which use PEP 517 and cannot be installed directly
@bersbersbers
Copy link
Author

bersbersbers commented Sep 2, 2021

I have found out that this is caused by me having SOURCE_DATE_EPOCH=0. I use that to obtain reproducible output from TeX Live. After unset SOURCE_DATE_EPOCH, pip install lazy-object-proxy works again.

I wonder if this is expected behavior or should be fixed.

@agronholm
Copy link
Contributor

An open question is whether wheel should record timestamps at all, or use the earliest possible one. I think this could be fixed in wheel as it is, by forcing a minimum file timestamp of 1980-01-01.

@agronholm agronholm added the bug label Dec 22, 2021
@pxl-th
Copy link

pxl-th commented Jun 29, 2022

I was hitting this error every time when trying to install python packages inside BinaryBuilder.
Maybe it is worth considering setting strict_timestamps=False.

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

No branches or pull requests

3 participants