[libcxx-dev] [llvm-dev] libc++ tests won't run due to a breaking change in Python 3.8 libraries

Brian Cain via libcxx-dev libcxx-dev at lists.llvm.org
Thu Dec 5 12:52:57 PST 2019


Moved to libcxx-dev.

How about this?

     def platform_ver(self):
-        _, ver, _ = platform.linux_distribution()
-        ver = ver.lower().strip().replace(' ', '-')
-        return ver # Permitted to be None.
+        if 'linux_distribution' in dir(platform):
+            _, ver, _ = platform.linux_distribution()
+            ver = ver.lower().strip().replace(' ', '-')
+            return ver # Permitted to be None.
+        else:
+            return None



On Thu, Dec 5, 2019 at 12:28 PM Sergej Jaskiewicz via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> The libc++ tests rely on the `platform.linux_distribution()` API [1],
> which is deprecated since Python 3.5 and removed [2] in Python 3.8, which
> is already released. This API is used to XFAIL certain tests based on the
> linux distro.
>
> So, I can’t run libc++ tests when the only Python I have is 3.8.
>
> Yes, I know, I could use Python 2, but I really don’t want to, since it
> will die in less than a month [3].
>
> The proposed solution is to use the distro package [3], but AFAIK the LLVM
> community doesn’t want to depend on third-party packages.
>
> Any ideas how this can be dealt with?
>
> [1]
> https://github.com/llvm/llvm-project/blob/c8f0d3e130d336f49c204b9ee317bf99be192a82/libcxx/utils/libcxx/test/target_info.py#L194-L216
>
> [2]
> https://docs.python.org/3.7/library/platform.html#platform.linux_distribution
>
> [3] https://pythonclock.org
>
> [4] https://pypi.org/project/distro/
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


-- 
-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20191205/74813b6b/attachment.html>


More information about the libcxx-dev mailing list