[devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6

Dmitry V. Levin ldv на altlinux.org
Ср Сен 23 09:13:05 MSK 2020


On Wed, Sep 23, 2020 at 02:11:43AM +0000, Ivan Zakharyaschev wrote:
> Update of /people/imz/packages/perl-AptPkg.git
> 
> Changes statistics since common ancestor `0.1.26-alt4.qa1.2-1-g0a9f2dc' follows:
>  perl-AptPkg.spec | 27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
> 
> Changelog since common ancestor `0.1.26-alt4.qa1.2-1-g0a9f2dc' follows:
> commit e018e7c26124d6b7a1d7e4265d254c084790a4b3
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Tue Sep 15 00:25:42 2020 +0300
> 
>     0.1.26-alt6
>     
>     - (.spec) Just added some compiler flags (which don't change anything)
>       to be sure that APT API has not been used wrongly and will not be.
>       (Namely, to be sure that if a method override was intended, it would
>       actually be overriding and not hiding a virtual method and that it
>       would be marked "override" for future.)
> 
> commit 1165ebffa2e4788baed39685235f0ddc0df434c5
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Mon Sep 14 22:41:37 2020 +0300
> 
>     (.spec) C++ standard increased for std::optional from the new APT
>     
>     Luckily, lcc >= 1.24.11 (in p9_e2k) already knows about c++17.
> 
> commit a0142aab1f4adc12b478115080d09eb85645437f
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Wed Sep 23 05:07:57 2020 +0300
> 
>     -Wsuggest-override (as an error) enabled on e2k, too
>     
>     Luckily, lcc >= 1.24.11 (in p9_e2k) already knows about it.
> 
> commit bc95cd60a593528787517c87371ebb745da154c3
> Merge: 18992a2 0c79c96
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Wed Sep 23 04:59:33 2020 +0300
> 
>     Merge branch 'altM/80P'
> 
> commit 18992a2efd110a18f6450c864ae0076c110a54a6
> Merge: 7308232 853dd6a
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Wed Sep 23 04:59:10 2020 +0300
> 
>     merge -s ours altM/80P~5
> 
> commit 0c79c968b346e6a8a23b3a7689f54f58a867a04c
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Tue Sep 15 00:25:04 2020 +0300
> 
>     0.1.26-alt5.M80P.1
>     
>     - (.spec) Just added some compiler flags (which don't change anything)
>       to be sure that APT API has not been used wrongly and will not be.
>       (Namely, to be sure that if a method override was intended, it would
>       actually be overriding and not hiding a virtual method and that it
>       would be marked "override" for future.)
> 
> commit 191e2e74f2a57e6393b9977f84f64ced17b94da6
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Mon Sep 14 21:45:38 2020 +0300
> 
>     -Wsuggest-override (as an error) as a style enforcement
>     
>     to make sure we haven't missed any overrides.
>     
>     If have marked all overrides now, in future, when API changes, the
>     compiler would detect dependent required changes of the methods that
>     are intended to be overrides.
> 
> commit 9c2d17bbb3283adb897681e9005e71709dbdedaa
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Mon Sep 14 21:43:54 2020 +0300
> 
>     -Woverloaded-virtual made an error (to avoid API misuse)
>     
>     This helps prevent coding errors when an override of a method was
>     intended, but it has a wrong signature: then it would trigger this
>     warning, because the overriding method in the derived class hides all
>     other overloaded methods from the base class (according to the C++
>     standard).
> 
> commit f7280bbfc84341251e3a823e1d933c60f504688e
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Wed Sep 23 02:30:38 2020 +0300
> 
>     (.spec) on e2k, %%remove_optflags -Wno-error
>     
>     This package is built fine on e2k.
> 
> commit 32cd920fbe83caf32b5b82c3d4c8af00e69cca4f
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Wed Sep 23 02:20:48 2020 +0300
> 
>     (.spec) separate things necessary only for running the stupid tests
>     
>     ||: was there to ignore the dirty tests.
>     
>     Unfortunately, the only way not to run the tests given the current
>     definition of %%perl_vendor_build is via %%_{without,disable}_test:
>     
>     _perl_vendor_MM_build() {
>             %{?_without_smp:NPROCS=1; : NOTE: SMP-incompatible}
>             %{?_disable_smp:NPROCS=1; : NOTE: SMP-incompatible}
>             : looking for PREREQ dependencies
>             %__perl Makefile.PL PRINT_PREREQ=1 "$@" </dev/null | tee .perl.req
>             : writing Makefile
>             %__perl Makefile.PL PREFIX=%_prefix INSTALLDIRS=vendor "$@" </dev/null
>             : running make
>             %make_build OPTIMIZE="%{!?_enable_debug:%perl_vendor_optflags}%{?_enable_debug:%optflags}%{?_enable_Werror: -Werror}" CP="%__cp -p"
>             %{?!_without_test:%{?!_disable_test:: running tests; LD_BIND_NOW=1 PERL_DL_NONLAZY=1 %__make test CP="%__cp -p" %{?_enable_debug:TEST_VERBOSE=1} </dev/null}}
>     }
>     
>     Here one can also see why %%optflags had no effect without %%def_enable debug.
> 
> commit 853dd6a57dad32af0e3ac91d0be719e154be820c
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Mon Sep 14 21:19:37 2020 +0300
> 
>     in p8, compile as gnu++11 to ensure the code is ready for it
> 
> commit 730823255802a76ad3598ebf771cc55c7cabac8f
> Author: Ivan Zakharyaschev <imz на altlinux.org>
> Date:   Wed Sep 23 04:57:07 2020 +0300
> 
>     (.spec) just comment why the custom -std flag was needed
>     
>     ...and add a newline (for simpler merges).
> 
> Full diff since common ancestor `0.1.26-alt4.qa1.2-1-g0a9f2dc' follows:
> diff --git a/perl-AptPkg.spec b/perl-AptPkg.spec
> index 4d23441..f36dd7c 100644
> --- a/perl-AptPkg.spec
> +++ b/perl-AptPkg.spec
> @@ -3,7 +3,7 @@
>  
>  Name: perl-AptPkg
>  Version: 0.1.26
> -Release: alt5
> +Release: alt6
>  
>  Summary: Perl interface to libapt-pkg
>  License: GPLv2+
> @@ -14,7 +14,8 @@ Source: libapt-pkg-perl-%version.tar
>  Patch: %name-%version-%release.patch
>  
>  # Automatically added by buildreq on Wed Oct 12 2011
> -BuildRequires: apt gcc-c++ libapt-devel perl-devel
> +BuildRequires: gcc-c++ libapt-devel perl-devel
> +%{?!_without_test:%{?!_disable_test:BuildPreReq: apt}}
>  
>  %description
>  A Perl interface to APT's libapt-pkg which provides modules
> @@ -24,13 +25,22 @@ inspection of the binary package cache and source package details.
>  %prep
>  %setup -n libapt-pkg-perl-%version
>  %patch -p1
> -cp -a /etc/apt/* t/cache/etc/
> +%{?!_without_test:%{?!_disable_test:cp -a /etc/apt/* t/cache/etc/}}
>  
>  %build
> +# Needed by APT API:
> +%add_optflags -std=gnu++17
> +
>  %ifarch %e2k
> -%add_optflags -std=c++14
> +%remove_optflags -Wno-error
>  %endif
> -%perl_vendor_build INC=-I%_includedir/rpm ||:
> +
> +# To avoid some errors on API change:
> +%add_optflags -Werror=overloaded-virtual
> +# A style enforcement: always use the keyword, which helps to avoid API misuse
> +%add_optflags -Werror=suggest-override
> +
> +%perl_vendor_build INC=-I%_includedir/rpm %{?!_without_test:%{?!_disable_test:||:}}
>  
>  %install
>  %perl_vendor_install
> @@ -45,6 +55,13 @@ cp -a /etc/apt/* t/cache/etc/
>  	%perl_vendor_autolib/AptPkg/AptPkg.so
>  
>  %changelog
> +* Tue Sep 15 2020 Ivan Zakharyaschev <imz на altlinux.org> 0.1.26-alt6
> +- (.spec) Just added some compiler flags (which don't change anything)
> +  to be sure that APT API has not been used wrongly and will not be.
> +  (Namely, to be sure that if a method override was intended, it would
> +  actually be overriding and not hiding a virtual method and that it
> +  would be marked "override" for future.)

Вот смотрю я на это и думаю, что бы у нас было в репозитории, если бы для
каждой библиотеки надо было бы каждый раз вручную патчить всех её
клиентов, чтобы синхронизировать compiler flags?

Просьба считать это письмо за blanket disapprove на все сборочные задания,
реализующие такой подход.

Пожалуйста, используйте pkg-config или аналоги.  Спасибо,


-- 
ldv


Подробная информация о списке рассылки Devel