Skip to contentSkip to conversation

cpupower: Make versioning scheme more obvious and fix version link

PATCH In review Thomas Renninger 2 participants 2 messages Mar 6, 2025 CPU power monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpupower: Make versioning scheme more obvious and fix version link

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:

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

tools/power/cpupower/Makefile +7 -4
index 51a95239fe06..a7d7d335c1ee 100644
@@ -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 =		[email protected]
@@ -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)
 
maintainer
#1 lore raw
Quoted 24 lines · Thomas Renninger

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:

(quoted diff) +1 -1
-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

Quoted 2 lines

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?

Quoted 22 lines

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

tools/power/cpupower/Makefile +5 -2
index 51a95239fe06..a7d7d335c1ee 100644
@@ -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 =		[email protected]
@@ -203,9 +206,9 @@ $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
  $(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)

tools/power/cpupower/Makefile $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS) · line 214

Quoted 10 lines
tools/power/cpupower/Makefile +2 -2
  	$(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