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

Check for required Python version #115

Open
rsdunlapiv opened this issue Nov 18, 2021 · 2 comments
Open

Check for required Python version #115

rsdunlapiv opened this issue Nov 18, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rsdunlapiv
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We need to verify user has recent version of Python and error out during install if not.

@feiliuesmf was using Python 2.7 and did not receive any warning that you need Python 3.6+.

1) On the SGIs, I ran into this error (again building babeltrace with python enabled). This seems like a really odd case where system headers and python 2.7 headers do not agree on POSIX standards. I will need to see if there are alternative solutions including a custom build of python. You can see the python used is 2.7. Gcc used is 9.2.0

In file included from /usr/include/python2.7/pyconfig.h:6,
                 from /usr/include/python2.7/Python.h:8,
                 from py-common.c:31:
/usr/include/python2.7/pyconfig-64.h:1191: error: "_POSIX_C_SOURCE" redefined [-Werror]
 1191 | #define _POSIX_C_SOURCE 200112L
      |
In file included from /usr/include/errno.h:28,
                 from ../../src/logging/log.h:12,
                 from py-common.c:27:
/usr/include/features.h:168: note: this is the location of the previous definition
  168 | # define _POSIX_C_SOURCE 200809L

Describe the solution you'd like

  • Clear description of requirement in the quick start (if not there).
  • Runtime check during install_dependencies.sh - if Python version is < 3.6 then exit with a clear message.
@rsdunlapiv rsdunlapiv added the enhancement New feature or request label Nov 18, 2021
@ryanlong1004
Copy link
Collaborator

@rsdunlapiv I want to confirm before changing the code as the acceptable versions of Python are defined in setup.py:

image

When actually doing the pip install -e ., you get an error.

image

Here, I changed the min version to Python 4 to show you an example of the error.

@rsdunlapiv
Copy link
Contributor Author

@ryanlong1004 we need to check during install_dependencies.sh before pip install is ever run. Babeltrace2 will fail to build the python bindings during install_dependencies.sh if the version of Python is too old.

@ryanlong1004 ryanlong1004 modified the milestone: v0.3.0 Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants