diff mbox series

[SRU,JAMMY,MANTIC,UNSTABLE] UBUNTU: [Packaging] Statically link libcpupower into cpupower tool

Message ID 20231206000024.1285161-1-dimitri.ledkov@canonical.com
State New
Headers show
Series [SRU,JAMMY,MANTIC,UNSTABLE] UBUNTU: [Packaging] Statically link libcpupower into cpupower tool | expand

Commit Message

Dimitri John Ledkov Dec. 6, 2023, midnight UTC
BugLink: https://bugs.launchpad.net/bugs/2035971

Currently we ship tools for every kernel flavour and backport, and
each one of them may have new features in cpupower &
libcpupower. Statically link those in, such that there are no
installation conflicts. This resolves all current file conflicts
between multiple kernel flavours in the Ubuntu Archive.

Separately, a public libcpupower1 & libcpupower-dev for non-kernel /
non-linux-tools use cases will be provided separately, under a stable
soname (not flavour or kernel version specific).

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
 debian/rules.d/2-binary-arch.mk | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

You-Sheng Yang Dec. 6, 2023, 2:32 a.m. UTC | #1
Identical to what's currently lying in the experimental kernels queue.

Acked-By: You-Sheng Yang <vicamo.yang@canonical.com>

On Wed, Dec 6, 2023 at 8:01 AM Dimitri John Ledkov
<dimitri.ledkov@canonical.com> wrote:
>
> BugLink: https://bugs.launchpad.net/bugs/2035971
>
> Currently we ship tools for every kernel flavour and backport, and
> each one of them may have new features in cpupower &
> libcpupower. Statically link those in, such that there are no
> installation conflicts. This resolves all current file conflicts
> between multiple kernel flavours in the Ubuntu Archive.
>
> Separately, a public libcpupower1 & libcpupower-dev for non-kernel /
> non-linux-tools use cases will be provided separately, under a stable
> soname (not flavour or kernel version specific).
>
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> ---
>  debian/rules.d/2-binary-arch.mk | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index cbd5e1f065..c7f6d47057 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -676,13 +676,11 @@ ifeq ($(do_tools_acpidbg),true)
>         cd $(builddirpa)/tools/power/acpi && make clean && make CFLAGS="-g -O2 -static -I$(builddirpa)/include" CROSS_COMPILE=$(CROSS_COMPILE) acpidbg
>  endif
>  ifeq ($(do_tools_cpupower),true)
> -       # Allow for multiple installed versions of cpupower and libcpupower.so:
> -       # Override LIB_MIN in order to to generate a versioned .so named
> -       # libcpupower.so.$(abi_release) and link cpupower with that.
>         make -C $(builddirpa)/tools/power/cpupower \
>                 CROSS_COMPILE=$(CROSS_COMPILE) \
>                 CROSS=$(CROSS_COMPILE) \
> -               LIB_MIN=$(abi_release) CPUFREQ_BENCH=false
> +               STATIC=true \
> +               CPUFREQ_BENCH=false
>  endif
>  ifeq ($(do_tools_perf),true)
>         cd $(builddirpa) && $(kmake) $(defconfig)
> @@ -732,10 +730,6 @@ endif
>  ifeq ($(do_tools_cpupower),true)
>         install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
>                 $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> -       # Install only the full versioned libcpupower.so.$(abi_release), not
> -       # the usual symlinks to it.
> -       install -m644 $(builddirpa)/tools/power/cpupower/libcpupower.so.$(abi_release) \
> -               $(toolspkgdir)/usr/lib/
>  endif
>  ifeq ($(do_tools_perf),true)
>         install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> --
> 2.34.1
>
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Manuel Diewald Dec. 6, 2023, 10:32 a.m. UTC | #2
On Wed, Dec 06, 2023 at 12:00:24AM +0000, Dimitri John Ledkov wrote:
> BugLink: https://bugs.launchpad.net/bugs/2035971
> 
> Currently we ship tools for every kernel flavour and backport, and
> each one of them may have new features in cpupower &
> libcpupower. Statically link those in, such that there are no
> installation conflicts. This resolves all current file conflicts
> between multiple kernel flavours in the Ubuntu Archive.
> 
> Separately, a public libcpupower1 & libcpupower-dev for non-kernel /
> non-linux-tools use cases will be provided separately, under a stable
> soname (not flavour or kernel version specific).
> 
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> ---
>  debian/rules.d/2-binary-arch.mk | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index cbd5e1f065..c7f6d47057 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -676,13 +676,11 @@ ifeq ($(do_tools_acpidbg),true)
>  	cd $(builddirpa)/tools/power/acpi && make clean && make CFLAGS="-g -O2 -static -I$(builddirpa)/include" CROSS_COMPILE=$(CROSS_COMPILE) acpidbg
>  endif
>  ifeq ($(do_tools_cpupower),true)
> -	# Allow for multiple installed versions of cpupower and libcpupower.so:
> -	# Override LIB_MIN in order to to generate a versioned .so named
> -	# libcpupower.so.$(abi_release) and link cpupower with that.
>  	make -C $(builddirpa)/tools/power/cpupower \
>  		CROSS_COMPILE=$(CROSS_COMPILE) \
>  		CROSS=$(CROSS_COMPILE) \
> -		LIB_MIN=$(abi_release) CPUFREQ_BENCH=false
> +		STATIC=true \
> +		CPUFREQ_BENCH=false
>  endif
>  ifeq ($(do_tools_perf),true)
>  	cd $(builddirpa) && $(kmake) $(defconfig)
> @@ -732,10 +730,6 @@ endif
>  ifeq ($(do_tools_cpupower),true)
>  	install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
>  		$(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> -	# Install only the full versioned libcpupower.so.$(abi_release), not
> -	# the usual symlinks to it.
> -	install -m644 $(builddirpa)/tools/power/cpupower/libcpupower.so.$(abi_release) \
> -		$(toolspkgdir)/usr/lib/
>  endif
>  ifeq ($(do_tools_perf),true)
>  	install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> -- 
> 2.34.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Should we target focal as well?

Acked-by: Manuel Diewald <manuel.diewald@canonical.com>
Dimitri John Ledkov Dec. 6, 2023, 11:38 a.m. UTC | #3
On Wed, 6 Dec 2023 at 10:33, Manuel Diewald
<manuel.diewald@canonical.com> wrote:
>
> On Wed, Dec 06, 2023 at 12:00:24AM +0000, Dimitri John Ledkov wrote:
> > BugLink: https://bugs.launchpad.net/bugs/2035971
> >
> > Currently we ship tools for every kernel flavour and backport, and
> > each one of them may have new features in cpupower &
> > libcpupower. Statically link those in, such that there are no
> > installation conflicts. This resolves all current file conflicts
> > between multiple kernel flavours in the Ubuntu Archive.
> >
> > Separately, a public libcpupower1 & libcpupower-dev for non-kernel /
> > non-linux-tools use cases will be provided separately, under a stable
> > soname (not flavour or kernel version specific).
> >
> > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> > ---
> >  debian/rules.d/2-binary-arch.mk | 10 ++--------
> >  1 file changed, 2 insertions(+), 8 deletions(-)
> >
> > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> > index cbd5e1f065..c7f6d47057 100644
> > --- a/debian/rules.d/2-binary-arch.mk
> > +++ b/debian/rules.d/2-binary-arch.mk
> > @@ -676,13 +676,11 @@ ifeq ($(do_tools_acpidbg),true)
> >       cd $(builddirpa)/tools/power/acpi && make clean && make CFLAGS="-g -O2 -static -I$(builddirpa)/include" CROSS_COMPILE=$(CROSS_COMPILE) acpidbg
> >  endif
> >  ifeq ($(do_tools_cpupower),true)
> > -     # Allow for multiple installed versions of cpupower and libcpupower.so:
> > -     # Override LIB_MIN in order to to generate a versioned .so named
> > -     # libcpupower.so.$(abi_release) and link cpupower with that.
> >       make -C $(builddirpa)/tools/power/cpupower \
> >               CROSS_COMPILE=$(CROSS_COMPILE) \
> >               CROSS=$(CROSS_COMPILE) \
> > -             LIB_MIN=$(abi_release) CPUFREQ_BENCH=false
> > +             STATIC=true \
> > +             CPUFREQ_BENCH=false
> >  endif
> >  ifeq ($(do_tools_perf),true)
> >       cd $(builddirpa) && $(kmake) $(defconfig)
> > @@ -732,10 +730,6 @@ endif
> >  ifeq ($(do_tools_cpupower),true)
> >       install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
> >               $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> > -     # Install only the full versioned libcpupower.so.$(abi_release), not
> > -     # the usual symlinks to it.
> > -     install -m644 $(builddirpa)/tools/power/cpupower/libcpupower.so.$(abi_release) \
> > -             $(toolspkgdir)/usr/lib/
> >  endif
> >  ifeq ($(do_tools_perf),true)
> >       install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> > --
> > 2.34.1
>
> Should we target focal as well?
>

Possibly, but I didn't check if this patch applies cleanly there. but
even without taking this back to focal, things will be mostly resolved
in focal as well. As all the hwe kernels will get it via backports
from jammy. And the remaining conflicting flavours in focal will
remain those that are not default. So like two -lts-ga cloud kernels,
and there is little reason to ever install both of them. So like
number of affected users on focal, after sruing this change to jammy
with backports is very small.

> Acked-by: Manuel Diewald <manuel.diewald@canonical.com>
>
Dimitri John Ledkov Dec. 7, 2023, 6:57 a.m. UTC | #4
Applied to UNSTABLE

On Wed, 6 Dec 2023 at 00:00, Dimitri John Ledkov
<dimitri.ledkov@canonical.com> wrote:
>
> BugLink: https://bugs.launchpad.net/bugs/2035971
>
> Currently we ship tools for every kernel flavour and backport, and
> each one of them may have new features in cpupower &
> libcpupower. Statically link those in, such that there are no
> installation conflicts. This resolves all current file conflicts
> between multiple kernel flavours in the Ubuntu Archive.
>
> Separately, a public libcpupower1 & libcpupower-dev for non-kernel /
> non-linux-tools use cases will be provided separately, under a stable
> soname (not flavour or kernel version specific).
>
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> ---
>  debian/rules.d/2-binary-arch.mk | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index cbd5e1f065..c7f6d47057 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -676,13 +676,11 @@ ifeq ($(do_tools_acpidbg),true)
>         cd $(builddirpa)/tools/power/acpi && make clean && make CFLAGS="-g -O2 -static -I$(builddirpa)/include" CROSS_COMPILE=$(CROSS_COMPILE) acpidbg
>  endif
>  ifeq ($(do_tools_cpupower),true)
> -       # Allow for multiple installed versions of cpupower and libcpupower.so:
> -       # Override LIB_MIN in order to to generate a versioned .so named
> -       # libcpupower.so.$(abi_release) and link cpupower with that.
>         make -C $(builddirpa)/tools/power/cpupower \
>                 CROSS_COMPILE=$(CROSS_COMPILE) \
>                 CROSS=$(CROSS_COMPILE) \
> -               LIB_MIN=$(abi_release) CPUFREQ_BENCH=false
> +               STATIC=true \
> +               CPUFREQ_BENCH=false
>  endif
>  ifeq ($(do_tools_perf),true)
>         cd $(builddirpa) && $(kmake) $(defconfig)
> @@ -732,10 +730,6 @@ endif
>  ifeq ($(do_tools_cpupower),true)
>         install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
>                 $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> -       # Install only the full versioned libcpupower.so.$(abi_release), not
> -       # the usual symlinks to it.
> -       install -m644 $(builddirpa)/tools/power/cpupower/libcpupower.so.$(abi_release) \
> -               $(toolspkgdir)/usr/lib/
>  endif
>  ifeq ($(do_tools_perf),true)
>         install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> --
> 2.34.1
>
Roxana Nicolescu Jan. 4, 2024, 7:28 p.m. UTC | #5
On 06/12/2023 01:00, Dimitri John Ledkov wrote:
> BugLink: https://bugs.launchpad.net/bugs/2035971
>
> Currently we ship tools for every kernel flavour and backport, and
> each one of them may have new features in cpupower &
> libcpupower. Statically link those in, such that there are no
> installation conflicts. This resolves all current file conflicts
> between multiple kernel flavours in the Ubuntu Archive.
>
> Separately, a public libcpupower1 & libcpupower-dev for non-kernel /
> non-linux-tools use cases will be provided separately, under a stable
> soname (not flavour or kernel version specific).
>
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> ---
>   debian/rules.d/2-binary-arch.mk | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index cbd5e1f065..c7f6d47057 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -676,13 +676,11 @@ ifeq ($(do_tools_acpidbg),true)
>   	cd $(builddirpa)/tools/power/acpi && make clean && make CFLAGS="-g -O2 -static -I$(builddirpa)/include" CROSS_COMPILE=$(CROSS_COMPILE) acpidbg
>   endif
>   ifeq ($(do_tools_cpupower),true)
> -	# Allow for multiple installed versions of cpupower and libcpupower.so:
> -	# Override LIB_MIN in order to to generate a versioned .so named
> -	# libcpupower.so.$(abi_release) and link cpupower with that.
>   	make -C $(builddirpa)/tools/power/cpupower \
>   		CROSS_COMPILE=$(CROSS_COMPILE) \
>   		CROSS=$(CROSS_COMPILE) \
> -		LIB_MIN=$(abi_release) CPUFREQ_BENCH=false
> +		STATIC=true \
> +		CPUFREQ_BENCH=false
>   endif
>   ifeq ($(do_tools_perf),true)
>   	cd $(builddirpa) && $(kmake) $(defconfig)
> @@ -732,10 +730,6 @@ endif
>   ifeq ($(do_tools_cpupower),true)
>   	install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
>   		$(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
> -	# Install only the full versioned libcpupower.so.$(abi_release), not
> -	# the usual symlinks to it.
> -	install -m644 $(builddirpa)/tools/power/cpupower/libcpupower.so.$(abi_release) \
> -		$(toolspkgdir)/usr/lib/
>   endif
>   ifeq ($(do_tools_perf),true)
>   	install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
Applied to mantic, jammy master-next branches. Thanks!
I took the liberty to include mantic and jammy in the launchpad bug.
diff mbox series

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index cbd5e1f065..c7f6d47057 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -676,13 +676,11 @@  ifeq ($(do_tools_acpidbg),true)
 	cd $(builddirpa)/tools/power/acpi && make clean && make CFLAGS="-g -O2 -static -I$(builddirpa)/include" CROSS_COMPILE=$(CROSS_COMPILE) acpidbg
 endif
 ifeq ($(do_tools_cpupower),true)
-	# Allow for multiple installed versions of cpupower and libcpupower.so:
-	# Override LIB_MIN in order to to generate a versioned .so named
-	# libcpupower.so.$(abi_release) and link cpupower with that.
 	make -C $(builddirpa)/tools/power/cpupower \
 		CROSS_COMPILE=$(CROSS_COMPILE) \
 		CROSS=$(CROSS_COMPILE) \
-		LIB_MIN=$(abi_release) CPUFREQ_BENCH=false
+		STATIC=true \
+		CPUFREQ_BENCH=false
 endif
 ifeq ($(do_tools_perf),true)
 	cd $(builddirpa) && $(kmake) $(defconfig)
@@ -732,10 +730,6 @@  endif
 ifeq ($(do_tools_cpupower),true)
 	install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
 		$(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
-	# Install only the full versioned libcpupower.so.$(abi_release), not
-	# the usual symlinks to it.
-	install -m644 $(builddirpa)/tools/power/cpupower/libcpupower.so.$(abi_release) \
-		$(toolspkgdir)/usr/lib/
 endif
 ifeq ($(do_tools_perf),true)
 	install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)