plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
245 stars 188 forks source link

Upgrade to 5.2.13 fails on zope.container 4.10 #3828

Closed ksuess closed 1 year ago

ksuess commented 1 year ago
An error occurred when trying to install /var/folders/jp/b_42_w2s5ss_m87wcrktdp380000gn/T/tmpte5_4fwvget_dist/zope.container-4.10.tar.gz. Look above this message for any errors that were output by easy_install.
While:
  Installing.
  Getting section instance1.
  Initializing section instance1.
  Installing recipe plone.recipe.zope2instance.
  Getting distribution for 'zope.container==4.10'.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/buildout.py", line 2174, in main
    getattr(buildout, command)(args)
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/buildout.py", line 701, in install
    [self[part]['recipe'] for part in install_parts]
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/buildout.py", line 701, in <listcomp>
    [self[part]['recipe'] for part in install_parts]
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1324, in __getitem__
    options._initialize()
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1432, in _initialize
    self.initialize()
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1438, in initialize
    recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1381, in _install_and_load
    zc.buildout.easy_install.install(
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 957, in install
    return installer.install(specs, working_set)
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 730, in install
    for dist in self._get_dist(req, ws):
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 574, in _get_dist
    dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
  File "/Users/katjasuss/Plone/zhkathch/zhkathdeployment2020/work/zope/lib/python3.8/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)

Buildout with pinning zope.container to 4.5 works fine.

davisagli commented 1 year ago

@ksuess This might be related to https://github.com/buildout/buildout/issues/609

I don't understand the issue fully but here are some tips:

  1. When this happens, I have been able to work around it by installing the package with pip (bin/pip install zope.container==4.10) and then re-running buildout, which now uses the already installed package.
  2. Using Python 3.11 instead of 3.8 seems to help. (Maybe because pip's cache of already downloaded packages is different.)
ksuess commented 1 year ago

Upgrade to 5.2.13 is fine on Python 3.10 with pyScss = 1.4.0 plone.app.drafts = 2.0.0 which fix the import from collections.abc

But be aware that officially supported Python versions are 3.7, 3.8 according to https://plone.org/download/release-schedule.

Too bad about the sunny saturday…

davisagli commented 1 year ago

But be aware that officially supported Python versions are 3.7, 3.8

You're right, I forgot this. I meant that it helped when I saw a similar problem with Plone 6.

mauritsvanrees commented 1 year ago

At the end of last year I had problems with zope.container versions ranging from roughly 4.5 to 4.9. Version 4.10 fixed it for me then, because that had more wheels for Mac available, and it matched what I needed. See the available files.

If no wheel for your system is available, then buildout/pip will try to compile from source, and that may or may not work, depending on OS, Python version, gcc flags, etcetera. And probably on the phase of the moon.

ksuess commented 1 year ago

I'm sticking with my upgrade on Python 3.10 It's fine, even with several add-ons and custom add-ons. Let's invest time in Plone 6 and 7…

mauritsvanrees commented 1 year ago

If you have installed your Python with pyenv, and you have since then upgraded MacOSX, you may need to reinstall all Pythons to fix this. See https://github.com/buildout/buildout/issues/606#issuecomment-1455496247 which I confirmed today after having upgraded last night to MacOS 13.5.

mauritsvanrees commented 1 year ago

Well, with a fresh Python 3.8 and Plone 5.2.11 on a client project, I now get an error building zope.container after all, complaining that it failed to build a wheel:

root: Reading https://pypi.org/simple/zope.container/
Getting distribution for 'zope.container==4.10'.
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [111 lines of output]
...
      src/zope/container/_zope_container_contained.c:115:11: error: implicit declaration of function 'PyString_AS_STRING' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
...
      4 warnings and 4 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for zope.container
ERROR: Could not build wheels for zope.container, which is required to install pyproject.toml-based projects

Workarounds: