NASA-SW-VnV / homebrew-core

Homebrew formulae from NASA - Software Verification and Validation
5 stars 3 forks source link

IKOS installation fails #1

Closed dschuessler closed 5 years ago

dschuessler commented 5 years ago

brew install nasa-sw-vnv/core/ikos fails with the following error message:

==> Installing nasa-sw-vnv/core/ikos
==> Downloading https://github.com/nasa-sw-vnv/ikos/releases/download/v2.1/ikos-2.1.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/107311216/9
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/4e/8b/75469c270ac544265f0020aa7c4ea925c5
######################################################################## 100.0%
==> python -c import setuptools... --no-user-cfg install --prefix=/private/tmp/ikos--homebrew-vi
Last 15 lines from /Users/dennis/Library/Logs/Homebrew/ikos/01.python:
-c
import setuptools, tokenize
__file__ = 'setup.py'
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
  .replace('\r\n', '\n'), __file__, 'exec'))
--no-user-cfg
install
--prefix=/private/tmp/ikos--homebrew-virtualenv-20181212-49529-ennkdu/target
--install-scripts=/private/tmp/ikos--homebrew-virtualenv-20181212-49529-ennkdu/target/bin
--single-version-externally-managed
--record=installed.txt

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
error in virtualenv setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

macOS 10.14.2

lieuwex commented 5 years ago

gist-logs for ikos: https://gist.github.com/lieuwex/2095140a17db65b810d3f6150799c4e3

arthaud commented 5 years ago

Hi @dschuessler,

I am running macOS High Sierra at work, and brew install nasa-sw-vnv/core/ikos works. I luckily got my hand on a macOS Mojave, and I still can't reproduce the bug. I am still investigating.

What version of python are you using, and how did you install it? The output of which python and python --version could help. I personally use the python package of homebrew.

arthaud commented 5 years ago

I found a lot of similar issues on Github:

Please try to upgrade setuptools using:

$ pip install --upgrade setuptools

(you might need to add sudo)

lieuwex commented 5 years ago

Thanks, for me, that was it! First I tried to run your suggested fix, but it would use the brewed python2. After unlinking that and using the system's python and pip installation succeeded. It might be worth adding a flag to build using the brewed python, but I'm not sure how one would do that.

arthaud commented 5 years ago

I think this is doable, look at the formula for postgresql and vim.

dschuessler commented 5 years ago

It didn't do it for me. Installation fails with system Python (2.7.10, /usr/bin/Python) in my PATH as well as with Hombrew Python (3.7.1,/usr/local/opt/python/libexec/bin/Python). Both directories are the output of python which respectively.

arthaud commented 5 years ago

This is weird. I'm pretty sure the problem is that setuptools is outdated. Maybe pip install did not install the latest version at the right location? What is the output of python -c "import setuptools; print(setuptools.__version__)"? I get 40.5.0 with python2 and python3 from homebrew.

dschuessler commented 5 years ago

Output of python -c "import setuptools; print(setuptools.__version__)" is 40.5.0 with Homebrew Python and 18.5 with system Python. Pip is not present when using the latter. Do you suggest touching system Python?

arthaud commented 5 years ago

No, you shouldn't touch the system python, this is probably not supported by Apple. IKOS should be able to work with the system python. I need to fix this. I was finally able to reproduce the error. I think I have a fix.

arthaud commented 5 years ago

I did a lot of digging. This is actually a bug in the setup.py of virtualenv. They are using features that are not available with setuptools 18.5 (default on macOS).

Full log:

$ wget https://files.pythonhosted.org/packages/4e/8b/75469c270ac544265f0020aa7c4ea925c5284b23e445cf3aa8b99f662690/virtualenv-16.1.0.tar.gz
$ tar xf virtualenv-16.1.0.tar.gz
$ cd virtualenv-16.1.0
$ python setup.py install
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
error in virtualenv setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

I don't know if we should open an issue on hombrew or virtualenv.

arthaud commented 5 years ago

It looks like they don't really care..

I will update the formula to use python from homebrew, if it's fine with you.

arthaud commented 5 years ago

My patch should fix the issue.

Please tell me if you still have problems.

lieuwex commented 5 years ago

@arthaud This seems to work for me, thanks!