Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pythran for openSUSE:Factory checked in at 2022-03-16 21:30:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pythran (Old) and /work/SRC/openSUSE:Factory/.python-pythran.new.25692 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pythran" Wed Mar 16 21:30:30 2022 rev:2 rq:961960 version:0.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pythran/python-pythran.changes 2022-02-03 23:16:33.172585576 +0100 +++ /work/SRC/openSUSE:Factory/.python-pythran.new.25692/python-pythran.changes 2022-03-16 21:30:38.927406472 +0100 @@ -1,0 +2,5 @@ +Tue Mar 15 07:59:46 UTC 2022 - Martin Li??ka <mli...@suse.cz> + +- Add gcc12-fixes.patch in order to fix GCC 12 building issues. + +------------------------------------------------------------------- New: ---- gcc12-fixes.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pythran.spec ++++++ --- /var/tmp/diff_new_pack.6spMeu/_old 2022-03-16 21:30:39.523406924 +0100 +++ /var/tmp/diff_new_pack.6spMeu/_new 2022-03-16 21:30:39.531406930 +0100 @@ -1,5 +1,5 @@ # -# spec file for package python-pythran +# spec file # # Copyright (c) 2022 SUSE LLC # @@ -53,6 +53,7 @@ # Tests are only availble in github archive Source0: https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz Source99: python-pythran-rpmlintrc +Patch0: gcc12-fixes.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -76,8 +77,8 @@ BuildRequires: %{python_module pytest} BuildRequires: %{python_module pythran = %{version}} BuildRequires: %{python_module wheel} -BuildRequires: unzip BuildRequires: gcc-c++ +BuildRequires: unzip %endif BuildArch: noarch %python_subpackages @@ -87,6 +88,7 @@ %prep %setup -q -n pythran-%{version} +%patch0 -p1 find -name '*.hpp' -exec chmod -x {} + sed -i '1{/env python/d}' pythran/run.py ++++++ gcc12-fixes.patch ++++++ The patch contains 2 upstream changes needed for building with GCC 12. >From e06d2c95bf88f84f9e570eeece5c3408fd8f24fe Mon Sep 17 00:00:00 2001 From: serge-sans-paille <serge.guel...@telecom-bretagne.eu> Date: Mon, 14 Mar 2022 16:10:12 +0100 Subject: [PATCH] Move mult operator for str to the appropriate ns --- pythran/pythonic/include/types/str.hpp | 11 +++-- pythran/pythonic/types/str.hpp | 64 +++++++++++++------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/pythran/pythonic/include/types/str.hpp b/pythran/pythonic/include/types/str.hpp index 329de1c1d..5aa526692 100644 --- a/pythran/pythonic/include/types/str.hpp +++ b/pythran/pythonic/include/types/str.hpp @@ -318,6 +318,12 @@ namespace types std::ostream &operator<<(std::ostream &os, chr const &s); std::ostream &operator<<(std::ostream &os, str const &s); + + str operator*(str const &s, long n); + str operator*(long t, str const &s); + str operator*(chr const &s, long n); + str operator*(long t, chr const &s); + } namespace operator_ @@ -356,11 +362,6 @@ struct assignable<char const[N]> { }; PYTHONIC_NS_END -pythonic::types::str operator*(pythonic::types::str const &s, long n); -pythonic::types::str operator*(long t, pythonic::types::str const &s); -pythonic::types::str operator*(pythonic::types::chr const &s, long n); -pythonic::types::str operator*(long t, pythonic::types::chr const &s); - namespace std { template <> diff --git a/pythran/pythonic/types/str.hpp b/pythran/pythonic/types/str.hpp index 6e9bc241f..ee540a73b 100644 --- a/pythran/pythonic/types/str.hpp +++ b/pythran/pythonic/types/str.hpp @@ -655,6 +655,38 @@ namespace types { return os << s.c_str(); } + + str operator*(str const &s, long n) + { + if (n <= 0) + return str(); + str other; + other.resize(s.size() * n); + auto where = other.chars().begin(); + for (long i = 0; i < n; i++, where += s.size()) + std::copy(s.chars().begin(), s.chars().end(), where); + return other; + } + + str operator*(long t, str const &s) + { + return s * t; + } + + str operator*(chr const &s, long n) + { + if (n <= 0) + return str(); + str other; + other.resize(n); + std::fill(other.chars().begin(), other.chars().end(), s.c); + return other; + } + + str operator*(long t, chr const &c) + { + return c * t; + } } namespace operator_ @@ -686,38 +718,6 @@ namespace operator_ } PYTHONIC_NS_END -pythonic::types::str operator*(pythonic::types::str const &s, long n) -{ - if (n <= 0) - return pythonic::types::str(); - pythonic::types::str other; - other.resize(s.size() * n); - auto where = other.chars().begin(); - for (long i = 0; i < n; i++, where += s.size()) - std::copy(s.chars().begin(), s.chars().end(), where); - return other; -} - -pythonic::types::str operator*(long t, pythonic::types::str const &s) -{ - return s * t; -} - -pythonic::types::str operator*(pythonic::types::chr const &s, long n) -{ - if (n <= 0) - return pythonic::types::str(); - pythonic::types::str other; - other.resize(n); - std::fill(other.chars().begin(), other.chars().end(), s.c); - return other; -} - -pythonic::types::str operator*(long t, pythonic::types::chr const &c) -{ - return c * t; -} - namespace std { >From 343cb724d857fe8adcef071ab088df2c02ba0d4c Mon Sep 17 00:00:00 2001 From: Jonathan Wakely <jwak...@redhat.com> Date: Mon, 14 Mar 2022 10:11:00 +0000 Subject: [PATCH] Add default constructor to string_iterator A type must be default constructible to meet the forward iterator requirements. GCC 12 won't compile `std::reverse_iterator<string_iterator>` without this change. --- pythran/pythonic/include/types/str.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/pythran/pythonic/include/types/str.hpp b/pythran/pythonic/include/types/str.hpp index 329de1c1d..a0df45905 100644 --- a/pythran/pythonic/include/types/str.hpp +++ b/pythran/pythonic/include/types/str.hpp @@ -231,6 +231,7 @@ namespace types struct string_iterator : std::iterator<std::random_access_iterator_tag, str, std::ptrdiff_t, str *, str> { std::string::const_iterator curr; + string_iterator() = default; string_iterator(std::string::const_iterator iter) : curr(iter) { }