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

Refer to Python with a variable or make inclusion more flexible #4662

Open
onkobu opened this issue Jan 19, 2023 · 3 comments
Open

Refer to Python with a variable or make inclusion more flexible #4662

onkobu opened this issue Jan 19, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@onkobu
Copy link

onkobu commented Jan 19, 2023

Details

Currently .pro-file refers to Python by directly using -Ipython which may or may not exist depending on the target system. Some Linux distributions support even parallel installations of Python incl. a selection mechanism. It'd make life (esp. on Gentoo) much easier if this is expressed through a variable instead that can be overridden during build time. Something like PYTHON3 for INC and LIB is absolutely sufficient.

In the Gentoo ebuild INCLUDEPATH as well as LIBS would be adjusted to also contain best matching Python variant. So it'd be absolutely feasible if -Ipython is just omitted/ suppressable.

Steps to reproduce

Try to build 3.4.0+ on a system with Python other than 3.9 or with a selection mechanism for multi-version Python that keeps LD_PATH and others clean.

Operating system

Recent Gentoo Linux, gcc11, Python 3.10 (and 3.9 and optional 3.8)

SQLiteStudio version

3.4.0, 3.4.1, 3.4.2

It'd be also great to have simple way of determining whether Python must be exactly 3.9 or >=3.9.

@pawelsalawa
Copy link
Owner

It seems that Python is not very compatible between versions. At least at C API or ABI level. I don't remember details right now, but I remember I struggled with it.

This is why linking is currently done explicitly against -lpython3.9. I will keep this issue open in order to improve the plugin compatibility with different Python versions (also in terms of compilation flags), but I need to investigate it first.

@pawelsalawa pawelsalawa added the enhancement New feature or request label Jan 19, 2023
@pawelsalawa pawelsalawa added this to the 3.5.0 milestone Jan 19, 2023
@onkobu
Copy link
Author

onkobu commented Feb 5, 2023

So I'm marking this as experimental and to match 3.9 exactly. Thanks a lot.

@onkobu
Copy link
Author

onkobu commented Feb 21, 2023

Now on Gentoo with 3.4.3 and Python >=3.9, compiles successfully with 3.10 and 3.11. Had to patch the .pro-file to exclude -lpython3.9. This is replaced by the build process with the result of the dynamic lookup through LD-environment variable.

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