Re: [Rpm-maint] [rpm-software-management/rpm] WIP: Use Python Stable ABI for the bindings (PR #2674)

2023-10-02 Thread Petr Viktorin
> Requiring Python >= 3.7 is not a problem, I'm just curious as to what makes 
> that particular version special.

[`PySlice_GetIndicesEx`](https://docs.python.org/3/c-api/slice.html#c.PySlice_GetIndicesEx)
 uses a deprecated implementation (on all Python versions) if ABI compatibility 
with 3.6 is needed.
That implementation is only unsafe in rather exotic edge cases ([indexing by an 
object that has side-effects on conversion to `int`, or another thread changing 
a sequence size](https://github.com/python/cpython/issues/72054)), but it does 
emit a compile-time warning.
If y'all can live with the warning, I think (but haven't checked), that would 
allow ABI compatibility with Python 3.4+. But, IMO it's better to use 
version-specific ABI for such old Python versions.

> Requiring Python >= 3.7 is not a problem, I'm just curious as to what makes 
> that particular version special. Cmake >= 3.26 is too new for us to require 
> though, but this shouldn't be hard to do manually. Looking at the cmake's 
> FindPython module, something like target_compile_definitions(_rpm PRIVATE 
> Py_LIMITED_API=x) (where x is the desired version obviosly) for in 
> python/CMakeLists.txt I suppose. There's something about linking to a 
> specific library too, but according to 
> https://docs.python.org/3/c-api/stable.html that's a Windows-only thing.

Here's what's different for stable ABI builds:

- Compiling with `Py_LIMITED_API=0x0307`, so only “stable” API is allowed.
- Naming the `.so` appropriately. Currently `cmake` outputs `_rpm.so`, which 
doesn't need to change -- any Python will load it. In the future CMake *might* 
switch to `_rpm.cpython-311-x86_64-linux-gnu.so`/`_rpm.abi3.so`, but I bet 
it'll use a `cmake_policy` for that kind of change, so there'll be plenty of 
time to adjust.
- On Windows, linking with a different Python library if appropriate

So, yeah, adding `target_compile_definitions(_rpm PRIVATE 
Py_LIMITED_API=Py_LIMITED_API=0x0307)` will do the trick.
But it might be better to use CMake's `Development.SABIModule` if it's 
available?


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2674#issuecomment-1743057129
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps not available on Mac OS, rpmbuild now fails (Issue #2682)

2023-10-02 Thread Panu Matilainen
That question doesn't really make sense in the upstream context because there's 
no "elfdeps dependency" anywhere.

Building the elfdeps tool requires the libelf library. I'm not aware of it 
being a Linux-only thing but that doesn't much.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2682#issuecomment-1742735265
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps not available on Mac OS, rpmbuild now fails (Issue #2682)

2023-10-02 Thread Emmanuel Lécharny
@pmatilai Fine. Should I understand that the elfdeps depedency is platform 
dependent?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2682#issuecomment-1742724041
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm installation on MacBook M2 Pro (Discussion #2684)

2023-10-02 Thread Panu Matilainen
Closed #2684 as resolved.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2684
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm installation on MacBook M2 Pro (Discussion #2684)

2023-10-02 Thread Panu Matilainen
That's not something the rpm upstream can help with, this would be a packaging 
matter in brew. How that all works or who maintains it there, we have no idea.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2684#discussioncomment-7161972
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps not available on Mac OS, rpmbuild now fails (Issue #2682)

2023-10-02 Thread Panu Matilainen
Closed #2682 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2682#event-10522821207
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps not available on Mac OS, rpmbuild now fails (Issue #2682)

2023-10-02 Thread Panu Matilainen
We don't provide builds or packaging for any platform. You need to report that 
to whoever maintains that build/package.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2682#issuecomment-1742530085
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint