ALT Linux Team development discussions
 help / color / mirror / Atom feed
* Re: [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6
  @ 2020-09-23  6:13 ` Dmitry V. Levin
  2020-09-23  6:32   ` Sergey V Turchin
  2020-09-23 10:38   ` Ivan Zakharyaschev
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry V. Levin @ 2020-09-23  6:13 UTC (permalink / raw)
  To: ALT Devel discussion list

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6
  2020-09-23  6:13 ` [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6 Dmitry V. Levin
@ 2020-09-23  6:32   ` Sergey V Turchin
  2020-09-23  6:34     ` Dmitry V. Levin
  2020-09-23 10:38   ` Ivan Zakharyaschev
  1 sibling, 1 reply; 5+ messages in thread
From: Sergey V Turchin @ 2020-09-23  6:32 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Wednesday, 23 September 2020 09:13:05 MSK Dmitry V wrote:

[...]
> Пожалуйста, используйте pkg-config или аналоги.  Спасибо,
Например, prf-файл для qmake и cmake-конфиги. Почему их до сих пор не было? 
;-)

-- 
Regards, Sergey.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6
  2020-09-23  6:32   ` Sergey V Turchin
@ 2020-09-23  6:34     ` Dmitry V. Levin
  2020-09-23  6:37       ` Sergey V Turchin
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry V. Levin @ 2020-09-23  6:34 UTC (permalink / raw)
  To: ALT Devel discussion list

On Wed, Sep 23, 2020 at 09:32:50AM +0300, Sergey V Turchin wrote:
> On Wednesday, 23 September 2020 09:13:05 MSK Dmitry V wrote:
> 
> [...]
> > Пожалуйста, используйте pkg-config или аналоги.  Спасибо,
> Например, prf-файл для qmake и cmake-конфиги. Почему их до сих пор не было? 

Конфиги для pkg-config универсальнее - все умеют их поддерживать.


-- 
ldv


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6
  2020-09-23  6:34     ` Dmitry V. Levin
@ 2020-09-23  6:37       ` Sergey V Turchin
  0 siblings, 0 replies; 5+ messages in thread
From: Sergey V Turchin @ 2020-09-23  6:37 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Wednesday, 23 September 2020 09:34:58 MSK Dmitry V wrote:
> On Wed, Sep 23, 2020 at 09:32:50AM +0300, Sergey V Turchin wrote:
> > On Wednesday, 23 September 2020 09:13:05 MSK Dmitry V wrote:
> > 
> > [...]
> > 
> > > Пожалуйста, используйте pkg-config или аналоги.  Спасибо,
> > 
> > Например, prf-файл для qmake и cmake-конфиги. Почему их до сих пор не
> > было?
> 
> Конфиги для pkg-config универсальнее - все умеют их поддерживать.
Хотя, да. Они оба умеют.

-- 
Regards, Sergey.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6
  2020-09-23  6:13 ` [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6 Dmitry V. Levin
  2020-09-23  6:32   ` Sergey V Turchin
@ 2020-09-23 10:38   ` Ivan Zakharyaschev
  1 sibling, 0 replies; 5+ messages in thread
From: Ivan Zakharyaschev @ 2020-09-23 10:38 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 5736 bytes --]

Hello!

On Wed, 23 Sep 2020, Dmitry V. Levin wrote:

> 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 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 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).

> > 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 или аналоги.  Спасибо,

Из бесспорных флагов, которые должны по-хорошему получаться через 
pkg-config -- только -std в данном случае. Тоже об этом задумывался, но не 
реализовал. Эту часть можно принять бесспорно как то, что следует всё ж 
реализовать, чтобы так по-глупому не патчить CXXFLAGS каждый раз, когда 
что-то случается.

Что касается -Wsuggest-override и т.п. -- это, с одной стороны, зона 
ответственности самого проекта, который использует библиотеку APT, 
свойство его исходного кода. (Тогда этому, конечно, более хорошее место не 
в спек-файле, а в Makefile и аналогах.) Приводить его в соответствие при 
возникшем желании можно независимо.

С другой стороны, включение этих флагов придаёт больше уверенности в том, 
что мы избежим поломки задуманного поведения этих клиентов при внесении 
изменения в API APT, поэтому как у изменявшего API APT у меня возникает 
желание blanket-включения этих флагов у всех клиентов (в тех кусочках 
кода, которые используют это API).

Т.е. их включение с одной стороны -- по желанию мейнтейнеров проектов 
клиентов, а с другой стороны -- пожелание (но не строгое требование с 
формальной точки зрения собираемости) мейнтейнера APT.

Мне кажется, их можно один раз добавить в проекты и больше не менять, не 
возвращаться к этому в клиентах. А потом для спокойствия мейнтейнеров APT 
ещё добавить в pkg-config APT-а. :)

-- 
Best regards,
Ivan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-23 10:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23  6:13 ` [devel] [SCM] packages/perl-AptPkg: tags/0.1.26-alt6 Dmitry V. Levin
2020-09-23  6:32   ` Sergey V Turchin
2020-09-23  6:34     ` Dmitry V. Levin
2020-09-23  6:37       ` Sergey V Turchin
2020-09-23 10:38   ` Ivan Zakharyaschev

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git