Hello,

Le lun. 7 avr. 2025 à 12:32, Martin Wilck <mwi...@suse.com> a écrit :
>
> On Mon, 2025-04-07 at 10:53 +0200, Martin Wilck wrote:
> > On Fri, 2025-04-04 at 14:29 +0200, Sofiane HAMAM wrote:
> > > From: Kéléfa Sané <kelefa.s...@smile.fr>
> > >
> > > 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.
> > >
> > > Signed-off-by: Yoann Congal <yoann.con...@smile.fr>
> > > Signed-off-by: Sofiane HAMAM <sofiane.ha...@smile.fr>
> > > Signed-off-by: Kelefa Sane <kelefa.s...@smile.fr>
> > > ---
> > >  libdmmp/Makefile | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libdmmp/Makefile b/libdmmp/Makefile
> > > index 7e0e2509..187bcb8c 100644
> > > --- a/libdmmp/Makefile
> > > +++ b/libdmmp/Makefile
> > > @@ -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
> > >
> >
> > 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?

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!

>
> Martin
>

Regards,
-- 
Yoann Congal
Smile ECS

Reply via email to