diff mbox series

cpupower: Make versioning scheme more obvious and fix version link

Message ID 3513228.LZWGnKmheA@laptop.fritzbox (mailing list archive)
State Changes Requested
Delegated to: Shuah Khan
Headers show
Series cpupower: Make versioning scheme more obvious and fix version link | expand

Commit Message

Thomas Renninger March 6, 2025, 3:27 p.m. UTC
Hi Shuah,

I can darkly remember this was discussed already, but it seems
it's still broken.

Currently there is:
LIB_MAJ=                       0.0.1
LIB_MIN=                       1

Resulting in:
libcpupower.so.0.0.1
libcpupower.so -> libcpupower.so.0.0.1
libcpupower.so.1 -> libcpupower.so.0.0.1

The naming of the variables is confusing (MIN should be MAJ) and the result is wrong.

You get the desired result by:
-LIB_MAJ=                       0.0.1
+LIB_MAJ=                       1.0.1
LIB_MIN=                       1
libcpupower.so.1.0.1
libcpupower.so -> libcpupower.so.1.0.1
libcpupower.so.1 -> libcpupower.so.1.0.1

Correct, but still confusing.
Here my suggestion to fix this with a reasonable (re-)naming:

-----------------

Comments

Shuah Khan March 6, 2025, 8:14 p.m. UTC | #1
On 3/6/25 08:27, Thomas Renninger wrote:
> Hi Shuah,
> 
> I can darkly remember this was discussed already, but it seems
> it's still broken.
> 
> Currently there is:
> LIB_MAJ=                       0.0.1
> LIB_MIN=                       1
> 
> Resulting in:
> libcpupower.so.0.0.1
> libcpupower.so -> libcpupower.so.0.0.1
> libcpupower.so.1 -> libcpupower.so.0.0.1
> 
> The naming of the variables is confusing (MIN should be MAJ) and the result is wrong.
> 
> You get the desired result by:
> -LIB_MAJ=                       0.0.1
> +LIB_MAJ=                       1.0.1
> LIB_MIN=                       1
> libcpupower.so.1.0.1
> libcpupower.so -> libcpupower.so.1.0.1
> libcpupower.so.1 -> libcpupower.so.1.0.1
> 
> Correct, but still confusing.
> Here my suggestion to fix this with a reasonable (re-)naming:

I thought we fixed this one. Guess not. Can you send me a patch
to fix this?

> 
> -----------------
> diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
> index 51a95239fe06..a7d7d335c1ee 100644
> --- a/tools/power/cpupower/Makefile
> +++ b/tools/power/cpupower/Makefile
> @@ -52,8 +52,11 @@ DESTDIR ?=
>   # and _should_ modify the PACKAGE_BUGREPORT definition
>   
>   VERSION:=			$(shell ./utils/version-gen.sh)
> -LIB_MAJ=			0.0.1
> -LIB_MIN=			1
> +LIB_FIX=			1
> +LIB_MIN=			0
> +LIB_MAJ=			1
> +LIB_VER=			$(LIB_MAJ).$(LIB_MIN).$(LIB_FIX)
> +
>   
>   PACKAGE =			cpupower
>   PACKAGE_BUGREPORT =		linux-pm@vger.kernel.org
> @@ -203,9 +206,9 @@ $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
>   $(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
>   	$(ECHO) "  LD      " $@
>   	$(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
> -		-Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
> +		-Wl,-soname,libcpupower.so.$(LIB_VER) $(LIB_OBJS)
>   	@ln -sf $(@F) $(OUTPUT)libcpupower.so
> -	@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MIN)
> +	@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_VER)
>   
>   libcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
>   

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index 51a95239fe06..a7d7d335c1ee 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -52,8 +52,11 @@  DESTDIR ?=
 # and _should_ modify the PACKAGE_BUGREPORT definition
 
 VERSION:=			$(shell ./utils/version-gen.sh)
-LIB_MAJ=			0.0.1
-LIB_MIN=			1
+LIB_FIX=			1
+LIB_MIN=			0
+LIB_MAJ=			1
+LIB_VER=			$(LIB_MAJ).$(LIB_MIN).$(LIB_FIX)
+
 
 PACKAGE =			cpupower
 PACKAGE_BUGREPORT =		linux-pm@vger.kernel.org
@@ -203,9 +206,9 @@  $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
 $(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
 	$(ECHO) "  LD      " $@
 	$(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
-		-Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
+		-Wl,-soname,libcpupower.so.$(LIB_VER) $(LIB_OBJS)
 	@ln -sf $(@F) $(OUTPUT)libcpupower.so
-	@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MIN)
+	@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_VER)
 
 libcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ)