Linuxbrew fails to install Chapel after Python 3.9 upgrade

The chapel formula on Linuxbrew depends on python3.9. So when python3.9 is upgraded an attempt is made to rebuild the chapel formula:

|> brew upgrade
==> Upgrading 1 outdated package:
python@3.9 3.9.0_2 -> 3.9.0_3
==> Upgrading python@3.9 3.9.0_2 -> 3.9.0_3 
==> Downloading https://linuxbrew.bintray.com/bottles/python%403.9-3.9.0_3.x86_64_linux.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/4e/4eb66e5ad6e5715d51c0285c631fcfb23c3074f154ebbb9fc829783d02f26f98?__gda
######################################################################## 100.0%
==> Pouring python@3.9-3.9.0_3.x86_64_linux.bottle.tar.gz
==> /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.0_3/bin/python3 -s setup.py --no-user-cfg install --force --verbose 
==> /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.0_3/bin/python3 -s setup.py --no-user-cfg install --force --verbose 
==> /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.0_3/bin/python3 -s setup.py --no-user-cfg install --force --verbose 
==> Caveats
Python has been installed as
  /home/linuxbrew/.linuxbrew/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /home/linuxbrew/.linuxbrew/opt/python@3.9/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /home/linuxbrew/.linuxbrew/lib/python3.9/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.0_3: 4,025 files, 74.7MB
Removing: /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.0_2... (4,066 files, 75.3MB)
==> No outdated dependents to upgrade!
==> Checking for dependents of upgraded formulae...
==> Reinstalling 1 broken dependent from source:
chapel
==> Downloading https://github.com/chapel-lang/chapel/releases/download/1.23.0/chapel-1.23.0.tar.gz
Already downloaded: /home/users/russel/.cache/Homebrew/downloads/3c74c09ef402f87f74ea1a41034318eebd5508f1f2cda6faaabc56f2aa00a562--chapel-1.23.0.tar.gz
==> Reinstalling chapel 
==> make
==> make chpldoc
Last 15 lines from /home/users/russel/.cache/Homebrew/Logs/chapel/02.make:
ERROR: Cannot install -r chpldoc-requirements.txt (line 11), -r chpldoc-requirements.txt (line 12) and Sphinx==1.8.5 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested Sphinx==1.8.5
    sphinx-rtd-theme 0.4.3 depends on sphinx
    sphinxcontrib-chapeldomain 0.0.15 depends on Sphinx<1.6.999 and >=1.6.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
make[2]: *** [Makefile:81: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.23.0_1/libexec/third-party/chpl-venv/install/linux64-x86_64/py3.9/chpl-virtualenv/bin/sphinx-build] Error 1
make[1]: *** [Makefile:91: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.23.0_1/libexec/third-party/chpl-venv/install/linux64-x86_64/py3.9/chpl-virtualenv/bin/sphinx-build] Error 2
make: *** [Makefile:128: third-party-chpldoc-venv] Error 2

READ THIS: https://docs.brew.sh/Troubleshooting

I guess the problem is the over-prescription of sphinx in the chapel formula?

Hi Russel

I’m surprised this worked with python 3.9 before - Sphinx 1.8.5 requires Python 3.4 or earlier, if my memory serves.

We’ve updated our python requirements for the master branch to use later versions of many of these packages so that we’re more up to date with Python 3. The problem you’re encountering here (as I think you said) is that the version of sphinxcontrib-chapeldomain in the Chapel repository had not updated its setup.py Sphinx requirements to reflect updates to the requirements.txt file. This is also a longer standing problem, though - I’m not sure how it was built with 3.9 at all, since the setup.py mismatch has been unnoticed there for well over a year. Removing the sphinx limitation may help, but it also may cause the build to run into the 3.4 requirement that it should have seen before.

Hope that helps,
Lydia

Just to make sure I’m following this (where I’m likely missing many relevant details): I think Russel’s using the 1.23 version of Chapel and that our recent Python/Sphinx changes should only affect those working from our main development branch—is that right Lydia? Is there anything Russel might do to get 1.23 limping along in the meantime?

-Brad

Yup! If he has the ability to modify the included copy of sphinxcontrib-chapeldomain in the 1.23 third-party/chpl-venv directory, removing the Sphinx version number requirements in the setup.py file may get it to work. But I’m still uncertain why it was ever able to build with Python 3.9, since my memory is that Sphinx 1.8.5 only supports Python 3.4 or lower

Lydia