Skip to contentSkip to conversation

libdmmp/Makefile: Fix KBUILD_BUILD_TIMESTAMP usage

PATCH In review Sofiane HAMAM 3 participants 11 messages Apr 4, 2025 – Apr 29, 2025 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libdmmp/Makefile: Fix KBUILD_BUILD_TIMESTAMP usage

From: Kéléfa Sané <[email protected]>

Add missing $ (Makefile need to escape '$' as '$$')

---
 libdmmp/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +1 -1
index 172ba045..7e0e2509 100644
@@ -74,7 +74,7 @@ doc: docs/man/dmmp_strerror.3
 docs/man/dmmp_strerror.3:	$(HEADERS)
 	$(Q)TEMPFILE=$(shell mktemp); \
 	cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \
-	[ "$KBUILD_BUILD_TIMESTAMP" ] || \
+	[ "$$KBUILD_BUILD_TIMESTAMP" ] || \
 	    KBUILD_BUILD_TIMESTAMP=`git log -n1 --pretty=%cd --date=iso -- $^`; \
 	export KBUILD_BUILD_TIMESTAMP; \
 	LC_ALL=C \
#1 lore raw

PATCH 2/2 libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes not.

---
 libdmmp/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +1 -1
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden
 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread
 
 all: $(LIBS) doc
-.PHONY:	doc clean install uninstall check speed_test dep_clean
+.PHONY:	doc clean install uninstall check speed_test dep_clean docs/man/dmmp_strerror.3
 
 $(LIBS): $(OBJS)
 	$(Q)$(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS)
#2 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Quoted 20 lines · Sofiane HAMAM

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes not.

---
 libdmmp/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden

 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) -L$(mpathcmddir) -

Quoted 8 lines

lmpathcmd -lpthread

 all: $(LIBS) doc
-.PHONY: doc clean install uninstall check speed_test
dep_clean
+.PHONY: doc clean install uninstall check speed_test
dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right solution. It will cause the time stamps of the man pages to be regenerated on every build.

Martin

Quoted 3 lines

 $(LIBS): $(OBJS)
  $(Q)$(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS)

#3 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Quoted 26 lines · Martin Wilck
Quoted 25 lines · Sofiane HAMAM

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes not.

---
 libdmmp/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden

 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) -L$(mpathcmddir) - lmpathcmd -lpthread

 all: $(LIBS) doc
-.PHONY: doc clean install uninstall check speed_test

Quoted 8 lines
Quoted 4 lines

dep_clean
+.PHONY: doc clean install uninstall check speed_test
dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right solution. It will cause the time stamps of the man pages to be regenerated on every build.

After investigating this some more: AFAICS, your patch 1/2 fixes the erratic behavior in the (normal) case where KBUILD_BUILD_TIMESTAMP is not set and git is available. Previously, in this case, the kernel-doc script would have substituted the current date for KBUILD_BUILD_TIMESTAMP (yielding "April 2025" today). With your fix, KBUILD_BUILD_TIMESTAMP is correctly set to "August 2024".

We need to create a commit that updates the man page time stamps to "August 2024". I'll do this.

Once this is done, the build rule does the right thing, AFAICS. While it will rewrite the man pages if the libdmmp.h timestamp is updated, it won't apply any real changes (visible in "git diff" or "git status") unless libdmmp.h has actually changed.

Am I overlooking something?

Martin

#4 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Hello,

Quoted 47 lines · Martin Wilck
Quoted 24 lines · Martin Wilck
Quoted 23 lines · Sofiane HAMAM

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes not.

---
 libdmmp/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden
 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) -L$(mpathcmddir) -

lmpathcmd -lpthread

Quoted 10 lines
Quoted 6 lines

all: $(LIBS) doc
-.PHONY: doc clean install uninstall check speed_test
dep_clean
+.PHONY: doc clean install uninstall check speed_test
dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right solution. It will cause the time stamps of the man pages to be regenerated on every build.

After investigating this some more: AFAICS, your patch 1/2 fixes the erratic behavior in the (normal) case where KBUILD_BUILD_TIMESTAMP is not set and git is available. Previously, in this case, the kernel-doc script would have substituted the current date for KBUILD_BUILD_TIMESTAMP (yielding "April 2025" today). With your fix, KBUILD_BUILD_TIMESTAMP is correctly set to "August 2024".

We need to create a commit that updates the man page time stamps to "August 2024". I'll do this.

Quoted 6 lines

Once this is done, the build rule does the right thing, AFAICS. While it will rewrite the man pages if the libdmmp.h timestamp is updated, it won't apply any real changes (visible in "git diff" or "git status") unless libdmmp.h has actually changed.

Am I overlooking something?

Depending on the order the files are written on disk during the git clone/archive extraction (is dmmp_strerror.3 written before or after libdmmp.h ?), the build rule will either run or not.
But, as you wrote, with your latest patch, it does not matter at all because the rewritten timestamp will be exactly the same.

Apart from this little quirk without any consequence, it looks good to me.

The only future problem I can imagine is if libdmmp.h is updated without updating the timestamps (again).
In this case, we will either get the timestamps from the sources or from git.

Thanks for looking into this!

Quoted 3 lines

Martin

Regards,

Signature · 2 lines
Yoann Congal
Smile ECS
#5 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Quoted 74 lines · Yoann Congal

Hello,

Quoted 63 lines · Martin Wilck
Quoted 26 lines · Martin Wilck
Quoted 25 lines · Sofiane HAMAM

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes
not.

---
 libdmmp/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden

 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) - L$(mpathcmddir) -
lmpathcmd -lpthread

Quoted 12 lines
Quoted 6 lines

 all: $(LIBS) doc
-.PHONY:    doc clean install uninstall check speed_test dep_clean
+.PHONY:    doc clean install uninstall check speed_test dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right solution.
It will cause the time stamps of the man pages to be regenerated on
every build.

After investigating this some more: AFAICS, your patch 1/2 fixes the
erratic behavior in the (normal) case where KBUILD_BUILD_TIMESTAMP is
not set and git is available. Previously, in this case, the kernel- doc
script would have substituted the current date for KBUILD_BUILD_TIMESTAMP (yielding "April 2025" today). With your fix,
KBUILD_BUILD_TIMESTAMP is correctly set to "August 2024".

We need to create a commit that updates the man page time stamps to "August 2024". I'll do this.

Once this is done, the build rule does the right thing, AFAICS. While
it will rewrite the man pages if the libdmmp.h timestamp is updated, it
won't apply any real changes (visible in "git diff" or "git status")
unless libdmmp.h has actually changed.

Quoted 1 line

Am I overlooking something?

Depending on the order the files are written on disk during the git clone/archive extraction (is dmmp_strerror.3 written before or after libdmmp.h ?), the build rule will either run or not.
But, as you wrote, with your latest patch, it does not matter at all because the rewritten timestamp will be exactly the same.

Quoted 7 lines

Apart from this little quirk without any consequence, it looks good to me.

The only future problem I can imagine is if libdmmp.h is updated without updating the timestamps (again).
In this case, we will either get the timestamps from the sources or from git.

That shouldn't happen because as soon as someone changes libdmmp.h and runs "make", the timestamps will be updated. Even if it does, the worst possible outcome is an outdated timestamp in the man pages, which we've seem to have had for several years now.
Also, the actual content of libdmmp.h has hardly changed over years.

If someone can contribute a better fix, we'll apply it happily. But I'd rather not want to have to check in the man pages after every build.

Regards
Martin

#6 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Quoted 84 lines · Martin Wilck
Quoted 74 lines · Yoann Congal

Hello,

Quoted 63 lines · Martin Wilck
Quoted 26 lines · Martin Wilck
Quoted 25 lines · Sofiane HAMAM

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes
not.

---
 libdmmp/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden
 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) -

L$(mpathcmddir) -
lmpathcmd -lpthread

Quoted 12 lines
Quoted 6 lines

all: $(LIBS) doc
-.PHONY: doc clean install uninstall check speed_test
dep_clean
+.PHONY: doc clean install uninstall check speed_test
dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right solution.
It will cause the time stamps of the man pages to be regenerated on
every build.

After investigating this some more: AFAICS, your patch 1/2 fixes the
erratic behavior in the (normal) case where KBUILD_BUILD_TIMESTAMP is
not set and git is available. Previously, in this case, the kernel- doc
script would have substituted the current date for KBUILD_BUILD_TIMESTAMP (yielding "April 2025" today). With your fix,
KBUILD_BUILD_TIMESTAMP is correctly set to "August 2024".

We need to create a commit that updates the man page time stamps to "August 2024". I'll do this.

Once this is done, the build rule does the right thing, AFAICS. While
it will rewrite the man pages if the libdmmp.h timestamp is updated, it
won't apply any real changes (visible in "git diff" or "git status")
unless libdmmp.h has actually changed.

Quoted 1 line

Am I overlooking something?

Depending on the order the files are written on disk during the git clone/archive extraction (is dmmp_strerror.3 written before or after libdmmp.h ?), the build rule will either run or not.
But, as you wrote, with your latest patch, it does not matter at all because the rewritten timestamp will be exactly the same.

Quoted 7 lines

Apart from this little quirk without any consequence, it looks good to me.

The only future problem I can imagine is if libdmmp.h is updated without updating the timestamps (again).
In this case, we will either get the timestamps from the sources or from git.

Quoted 8 lines

That shouldn't happen because as soon as someone changes libdmmp.h and runs "make", the timestamps will be updated. Even if it does, the worst possible outcome is an outdated timestamp in the man pages, which we've seem to have had for several years now.
Also, the actual content of libdmmp.h has hardly changed over years.

If someone can contribute a better fix, we'll apply it happily. But I'd rather not want to have to check in the man pages after every build.

Our (Yocto project) situation is quite different: We build from scratch every time and the sources are only kept during the compilation, erased after.
So we will use in our integration the 2 patches of this series to force a reproducible build of the manpages.

Thanks!

Quoted 2 lines

Regards
Martin

Signature · 2 lines
Yoann Congal
Smile ECS
#7 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Quoted 113 lines · Yoann Congal
Quoted 107 lines · Martin Wilck
Quoted 89 lines · Yoann Congal

Hello,

Le lun. 7 avr. 2025 à 12:32, Martin Wilck <[email protected]> a écrit :

Quoted 70 lines · Martin Wilck
Quoted 28 lines · Sofiane HAMAM
Quoted 27 lines

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes
not.

---
 libdmmp/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -

fvisibility=hidden
 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) - L$(mpathcmddir) -
lmpathcmd -lpthread

Quoted 13 lines
Quoted 6 lines

 all: $(LIBS) doc
-.PHONY:    doc clean install uninstall check speed_test dep_clean
+.PHONY:    doc clean install uninstall check speed_test dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right solution.
It will cause the time stamps of the man pages to be regenerated
on
every build.

After investigating this some more: AFAICS, your patch 1/2 fixes
the
erratic behavior in the (normal) case where KBUILD_BUILD_TIMESTAMP
is
not set and git is available. Previously, in this case, the kernel-
doc
script would have substituted the current date for KBUILD_BUILD_TIMESTAMP (yielding "April 2025" today). With your fix,
KBUILD_BUILD_TIMESTAMP is correctly set to "August 2024".

We need to create a commit that updates the man page time stamps to
"August 2024". I'll do this.

Once this is done, the build rule does the right thing, AFAICS. While
it will rewrite the man pages if the libdmmp.h timestamp is updated, it
won't apply any real changes (visible in "git diff" or "git status")
unless libdmmp.h has actually changed.

Quoted 1 line

Am I overlooking something?

Depending on the order the files are written on disk during the git
clone/archive extraction (is dmmp_strerror.3 written before or after
libdmmp.h ?), the build rule will either run or not. But, as you wrote, with your latest patch, it does not matter at all
because the rewritten timestamp will be exactly the same.

Apart from this little quirk without any consequence, it looks good
to me.

Quoted 5 lines

The only future problem I can imagine is if libdmmp.h is updated without updating the timestamps (again).
In this case, we will either get the timestamps from the sources or
from git.

That shouldn't happen because as soon as someone changes libdmmp.h and
runs "make", the timestamps will be updated. Even if it does, the worst
possible outcome is an outdated timestamp in the man pages, which we've
seem to have had for several years now.
Also, the actual content of libdmmp.h has hardly changed over years.

Quoted 4 lines

If someone can contribute a better fix, we'll apply it happily. But I'd
rather not want to have to check in the man pages after every build.

Quoted 7 lines

Our (Yocto project) situation is quite different: We build from scratch every time and the sources are only kept during the compilation, erased after.
So we will use in our integration the 2 patches of this series to force a reproducible build of the manpages.

Thanks!

Can I take this as an acked-by: from your part?
Or @Ben could you give it a review?

Martin

Acked-by
#8 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Quoted 121 lines · Martin Wilck
Quoted 119 lines · Yoann Congal
Quoted 107 lines · Martin Wilck
Quoted 89 lines · Yoann Congal

Hello,

Le lun. 7 avr. 2025 à 12:32, Martin Wilck <[email protected]> a écrit :

Quoted 70 lines · Martin Wilck
Quoted 28 lines · Sofiane HAMAM
Quoted 27 lines

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes
not.

---
 libdmmp/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -

fvisibility=hidden
LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) -
L$(mpathcmddir) -
lmpathcmd -lpthread

Quoted 13 lines
Quoted 6 lines

all: $(LIBS) doc
-.PHONY: doc clean install uninstall check speed_test
dep_clean
+.PHONY: doc clean install uninstall check speed_test
dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right solution.
It will cause the time stamps of the man pages to be regenerated
on
every build.

After investigating this some more: AFAICS, your patch 1/2 fixes
the
erratic behavior in the (normal) case where KBUILD_BUILD_TIMESTAMP
is
not set and git is available. Previously, in this case, the kernel-
doc
script would have substituted the current date for KBUILD_BUILD_TIMESTAMP (yielding "April 2025" today). With your fix,
KBUILD_BUILD_TIMESTAMP is correctly set to "August 2024".

We need to create a commit that updates the man page time stamps to
"August 2024". I'll do this.

Once this is done, the build rule does the right thing, AFAICS. While
it will rewrite the man pages if the libdmmp.h timestamp is updated, it
won't apply any real changes (visible in "git diff" or "git status")
unless libdmmp.h has actually changed.

Quoted 1 line

Am I overlooking something?

Depending on the order the files are written on disk during the git
clone/archive extraction (is dmmp_strerror.3 written before or after
libdmmp.h ?), the build rule will either run or not. But, as you wrote, with your latest patch, it does not matter at all
because the rewritten timestamp will be exactly the same.

Apart from this little quirk without any consequence, it looks good
to me.

Quoted 5 lines

The only future problem I can imagine is if libdmmp.h is updated without updating the timestamps (again).
In this case, we will either get the timestamps from the sources or
from git.

That shouldn't happen because as soon as someone changes libdmmp.h and
runs "make", the timestamps will be updated. Even if it does, the worst
possible outcome is an outdated timestamp in the man pages, which we've
seem to have had for several years now.
Also, the actual content of libdmmp.h has hardly changed over years.

Quoted 4 lines

If someone can contribute a better fix, we'll apply it happily. But I'd
rather not want to have to check in the man pages after every build.

Our (Yocto project) situation is quite different: We build from scratch every time and the sources are only kept during the compilation, erased after.
So we will use in our integration the 2 patches of this series to force a reproducible build of the manpages.

Quoted 3 lines
Quoted 1 line

Thanks!

Can I take this as an acked-by: from your part?

You can!

FYI, I participated in the patch development and am already in the Signed-off-by list if you did not notice.

Quoted 3 lines

Or @Ben could you give it a review?

Martin

Signature · 2 lines
Yoann Congal
Smile ECS
#9 lore raw

Re: [PATCH 2/2] libdmmp/Makefile: Add target docs/man/dmmp_strerror.3 to .PHONY list

Quoted 141 lines · Yoann Congal

Le mar. 29 avr. 2025 à 22:06, Martin Wilck <[email protected]> a écrit :

Quoted 139 lines · Yoann Congal
Quoted 136 lines

Le lun. 7 avr. 2025 à 16:42, Martin Wilck <[email protected]> a écrit :

Quoted 121 lines · Yoann Congal
Quoted 98 lines

Hello,

Le lun. 7 avr. 2025 à 12:32, Martin Wilck <[email protected]> a écrit :

Quoted 75 lines · Martin Wilck
Quoted 28 lines · Sofiane HAMAM
Quoted 27 lines

From: Kéléfa Sané <[email protected]>

When checking out the git repos, sometimes, target docs/man/dmmp_strerror.3 is newer that the prerequisite libdmmp/libdmmp.h this leads to a non reproducible behavior:
Sometimes, the timestamps are updated in the manpages, sometimes
not.

---
 libdmmp/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +0 -0
index 7e0e2509..187bcb8c 100644
@@ -20,7 +20,7 @@ CFLAGS += $(LIB_CFLAGS) -

fvisibility=hidden
 LIBDEPS += $(shell $(PKG_CONFIG) --libs json-c) - L$(mpathcmddir) -
lmpathcmd -lpthread

Quoted 16 lines
Quoted 8 lines

 all: $(LIBS) doc
-.PHONY:    doc clean install uninstall check speed_test
dep_clean
+.PHONY:    doc clean install uninstall check speed_test
dep_clean docs/man/dmmp_strerror.3

I've seen the issue you refer to, but this is not the right
solution.
It will cause the time stamps of the man pages to be regenerated
on
every build.

After investigating this some more: AFAICS, your patch 1/2 fixes
the
erratic behavior in the (normal) case where KBUILD_BUILD_TIMESTAMP
is
not set and git is available. Previously, in this case, the kernel-
doc
script would have substituted the current date for KBUILD_BUILD_TIMESTAMP (yielding "April 2025" today). With your
fix,
KBUILD_BUILD_TIMESTAMP is correctly set to "August 2024".

We need to create a commit that updates the man page time stamps to
"August 2024". I'll do this.

Once this is done, the build rule does the right thing, AFAICS.
While
it will rewrite the man pages if the libdmmp.h timestamp is updated, it
won't apply any real changes (visible in "git diff" or "git status")
unless libdmmp.h has actually changed.

Quoted 1 line

Am I overlooking something?

Depending on the order the files are written on disk during the
git
clone/archive extraction (is dmmp_strerror.3 written before or
after
libdmmp.h ?), the build rule will either run or not. But, as you wrote, with your latest patch, it does not matter at
all
because the rewritten timestamp will be exactly the same.

Apart from this little quirk without any consequence, it looks
good
to me.

Quoted 7 lines

The only future problem I can imagine is if libdmmp.h is updated
without updating the timestamps (again).
In this case, we will either get the timestamps from the sources
or
from git.

That shouldn't happen because as soon as someone changes libdmmp.h
and
runs "make", the timestamps will be updated. Even if it does, the
worst
possible outcome is an outdated timestamp in the man pages, which
we've
seem to have had for several years now.
Also, the actual content of libdmmp.h has hardly changed over years.

Quoted 5 lines

If someone can contribute a better fix, we'll apply it happily. But
I'd
rather not want to have to check in the man pages after every build.

Our (Yocto project) situation is quite different: We build from scratch every time and the sources are only kept during the compilation, erased after.
So we will use in our integration the 2 patches of this series to force a reproducible build of the manpages.

Thanks!

Quoted 8 lines
Quoted 1 line

Can I take this as an acked-by: from your part?

You can!

FYI, I participated in the patch development and am already in the Signed-off-by list if you did not notice.

On the first one, but not on the second, which simply updated the time stamps.

Well I guess that one is so obvious that no specific review is necessary. I'll add your acked-by nonetheless, thanks!

Regards
Martin

Reviewed-by on v1 1/2
#10 lore raw
In reply to Sofiane HAMAM
Quoted 21 lines · Sofiane HAMAM

From: Kéléfa Sané <[email protected]>

Add missing $ (Makefile need to escape '$' as '$$')

---
 libdmmp/Makefile | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +1 -1
index 172ba045..7e0e2509 100644
@@ -74,7 +74,7 @@ doc: docs/man/dmmp_strerror.3
  docs/man/dmmp_strerror.3:	$(HEADERS)
  	$(Q)TEMPFILE=$(shell mktemp); \
  	cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \
-	[ "$KBUILD_BUILD_TIMESTAMP" ] || \
+	[ "$$KBUILD_BUILD_TIMESTAMP" ] || \
Quoted 4 lines

      KBUILD_BUILD_TIMESTAMP=git log -n1 --pretty=%cd -- date=iso -- $^; \
  export KBUILD_BUILD_TIMESTAMP; \
  LC_ALL=C \