zodb / relstorage

A backend for ZODB that stores pickles in a relational database.
Other
55 stars 46 forks source link

Version 3.1.2 fails to install using buildout #405

Closed icemac closed 4 years ago

icemac commented 4 years ago

Minimal buildout.cfg:

[buildout]
parts = eggs

[eggs]
recipe = zc.recipe.egg
eggs = Relstorage==3.1.2

Steps to reproduce:

$ python3.7 -m venv rel312
$ cd rel312
$ bin/pip install zc.buildout
$ vi buildout.cfg
$ bin/buildout

Result:

Installing eggs.
Getting distribution for 'Relstorage'.
WARNING: The easy_install command is deprecated and will be removed in a future version.
warning: no files found matching '*.test' under directory 'src'
warning: no files found matching '*.c' under directory 'src'
warning: no files found matching '*.ipp' under directory 'include'
warning: no previously-included files matching 'relstorage.*.rst' found under directory 'docs'
warning: no previously-included files matching '_build' found under directory 'docs'
clang: error: no such file or directory: 'src/relstorage/cache/cache.c'
clang: error: no input files
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1
An error occurred when trying to install .../cache/dist/RelStorage-3.1.2.tar.gz. Look above this message for any errors that were output by easy_install.
While:
  Installing eggs.
  Getting distribution for 'Relstorage'.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File ".../lib/python3.7/site-packages/zc/buildout/buildout.py", line 2174, in main
    getattr(buildout, command)(args)
  File ".../lib/python3.7/site-packages/zc/buildout/buildout.py", line 817, in install
    installed_files = self[part]._call(recipe.install)
  File ".../lib/python3.7/site-packages/zc/buildout/buildout.py", line 1603, in _call
    return f()
  File ".../eggs/zc.recipe.egg-2.0.7-py3.7.egg/zc/recipe/egg/egg.py", line 227, in install
    reqs, ws = self.working_set()
  File ".../eggs/zc.recipe.egg-2.0.7-py3.7.egg/zc/recipe/egg/egg.py", line 87, in working_set
    allow_unknown_extras=bool_option(buildout_section, 'allow-unknown-extras')
  File ".../eggs/zc.recipe.egg-2.0.7-py3.7.egg/zc/recipe/egg/egg.py", line 168, in _working_set
    allow_unknown_extras=allow_unknown_extras)
  File ".../lib/python3.7/site-packages/zc/buildout/easy_install.py", line 957, in install
    return installer.install(specs, working_set)
  File ".../lib/python3.7/site-packages/zc/buildout/easy_install.py", line 682, in install
    for dist in self._get_dist(requirement, ws):
  File ".../lib/python3.7/site-packages/zc/buildout/easy_install.py", line 574, in _get_dist
    dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
  File ".../lib/python3.7/site-packages/zc/buildout/easy_install.py", line 1745, in _move_to_eggs_dir_and_compile
    [tmp_loc] = glob.glob(os.path.join(tmp_dest, '*'))
ValueError: not enough values to unpack (expected 1, got 0)

Version 3.1.1 installs fine with the same scenario. I get the same error when using Python 2.7. I am running on MacOS.

icemac commented 4 years ago

Installation via pip is fine.

jamadden commented 4 years ago

Interesting, we just did several buildouts yesterday on both macOS and Linux using 3.1.2 and they were fine. 3.1.2 contains manylinux and macOS wheels for both 2.7 and 3.7 so I don't understand why you would be compiling from source.

jamadden commented 4 years ago

3.1.2 contains manylinux and macOS wheels for both 2.7 and 3.7

No, actually the macOS wheel for 3.7 was missing for some reason. I've uploaded it manually.

icemac commented 4 years ago

Hm, I only see macOS wheels for 3.7 and 3.8. But nevertheless the problem seems to be in the sdist.

jamadden commented 4 years ago

Hm, I only see macOS wheels for 3.7 and 3.8.

Yeah, I'm noticing that now too. All the uploads must have failed for some reason. I'm uploading the missing macOS wheels now. Give it a few minutes and try again.

But nevertheless the problem seems to be in the sdist.

Well, maybe. But the error is not what it seems. no such file or directory: 'src/relstorage/cache/cache.c' makes perfect sense: There never is a cache.c file, because this code is written in C++. There's a cache.cpp file at the correct place, correctly included in the sdist. The question is why is it looking for a .c file. I suspect it has something to do with the presence of Cython (or rather, its absence in your environment and the fallback code that runs when its not available; there's probably something hardcoded to .c).

jamadden commented 4 years ago

Yeah, that's what it is. https://github.com/zodb/relstorage/blob/af57d6c1d5c985f2315fee0e41f71c2caa222f24/setup.py#L22-L28

icemac commented 4 years ago

Adding Cython to the eggs section in buildout.cfg does not help. But installing it using pip alongside zc.buildout fixes the installation.

jamadden commented 4 years ago

Using the beta version of zc.buildout would also fix the problem, because it respects the pyproject.toml that RelStorage includes.

jamadden commented 4 years ago

All the binary wheels are uploaded now.

icemac commented 4 years ago

Thank you!