bugGNU roff - Bugs: bug #61052, .version file not updated as...

 
 

bug #61052: .version file not updated as aggressively as it should be

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Tue 17 Aug 2021 10:31:34 PM UTC
   
 
Category:  General Severity:  3 - Normal
Item Group:  Build/Installation Status:  Need Info
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 20 Jun 2022 09:09:33 AM UTC, comment #14: 
Bjarni Ingi Gislason <bjarniig>
Mon 20 Jun 2022 09:04:37 AM UTC, comment #13: 

  Is is just an update to History according to
https://lists.gnu.org/archive/html/groff/2022-06/msg00225.html

Bjarni Ingi Gislason <bjarniig>
Mon 20 Jun 2022 07:14:26 AM UTC, comment #12: 


comment #11:

> Savannah seems to have eaten comment #10... Branden, did you save a copy of what you posted?


No, and unfortunately I don't recall what it was.  Possibly just a reference to the current discussion with Bruno Haible.

https://lists.gnu.org/archive/html/groff/2022-06/msg00001.html

G. Branden Robinson <gbranden>
Group administrator
Mon 20 Jun 2022 02:32:07 AM UTC, comment #11: 

Savannah seems to have eaten comment #10... Branden, did you save a copy of what you posted?

Dave <barx>
Group Member
Thu 16 Jun 2022 01:12:25 AM UTC, comment #10: 



G. Branden Robinson <gbranden>
Group administrator
Mon 28 Mar 2022 11:38:27 PM UTC, comment #9: 

  Changes in am-files:

(CONFIG_HEADER is a variable set in " Makefile.in" but unused.)

1) "src/roff/nroff/nroff.am": target "nroff", adding dependency
"$(CONFIG_HEADER)" (as suggested in comment #1, and comment #7 pointing
out it being missing).

2) "Makefile.am": target "$(top_srcdir)/.version" adding dependency
"$(CONFIG_HEADER)".

  show a new line early in the output of "make ..." between
"lib/wctype.h" and "test-nroff":

  GEN      lib/wctype.h
echo 1.22.4.4268-b759b > ../.version-t && mv ../.version-t ../.version
  GEN      test-nroff
make  all-am

  Result: no test failure of
"src/roff/nroff/tests/verbose_option_works.sh"

Bjarni Ingi Gislason <bjarniig>
Tue 22 Mar 2022 05:48:13 PM UTC, comment #8: 

Reopening.  Commit 450179ef reverted the commit referenced in comment #6.  As the reverting commit message says, full reasoning can be found at https://lists.gnu.org/archive/html/groff/2022-03/msg00051.html.

Dave <barx>
Group Member
Wed 16 Mar 2022 06:17:41 PM UTC, comment #7: 

comment #1:

> For the problem reported, once the above is done, adding
> a dependency on the .version file to the nroff target in
> nroff.am should do the trick.


This step was never done.  Was it deemed unnecessary, or was this an oversight?

Dave <barx>
Group Member
Mon 23 Aug 2021 04:29:29 AM UTC, comment #6: 


commit c1bb33e5beec25b4059bca3cc4529b738ec486c7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Aug 21 11:09:38 2021 +1000

    Update .version file more aggressively.

    * Makefile.am: Regenerate a temporary version string file on every
      build, but update the real version file's mtime only if its contents
      change.

      (.version.tree): New target.  Mark it phony, populating it with
      `$(VERSION)` with every `make` if the `.tarball-version` file {created
      by `dist-hook`} doesn't exist.

      ($(top_srcdir)/.version): Depend on foregoing target.  If the tarball
      version file and the target do not exist, copy `.tree` file into
      place.  Compare this file with `.tree` file; if they differ, move the
      `.tree` file to this one.

      (MOSTLYCLEANFILES): Add `.version.tree`.

    Fixes <https://savannah.gnu.org/bugs/?61052>.  Thanks to Bjarni Ingi
    Gislason for the report.


G. Branden Robinson <gbranden>
Group administrator
Sat 21 Aug 2021 04:26:41 AM UTC, comment #5: 

I think I have it now.  "make distcheck" works fine.


diff --git a/Makefile.am b/Makefile.am
index a6b016dc..9be78af9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -922,8 +922,17 @@ SUFFIXES += .man
 # Version files - see script 'build-aux/git-gen-version'
 EXTRA_DIST += $(top_srcdir)/.version
 BUILT_SOURCES += $(top_srcdir)/.version
-$(top_srcdir)/.version:
-       echo $(VERSION) > $@-t && mv $@-t $@
+# Regenerate a temporary version string file on every build, but update
+# the real version file's mtime only if its contents change.
+.PHONY: .version.tree
+.version.tree:
+       test -f $(distdir)/.tarball-verion || echo $(VERSION) > $@
+$(top_srcdir)/.version: .version.tree
+       if ! test -f $(distdir)/.tarball-version; then \
+         test -f $@ || cp .version.tree $@; \
+         cmp -s .version.tree $@ || cp .version.tree $@; \
+       fi
+MOSTLYCLEANFILES += .version.tree
 dist-hook:
        echo $(VERSION) > $(distdir)/.tarball-version


G. Branden Robinson <gbranden>
Group administrator
Sat 21 Aug 2021 01:42:26 AM UTC, comment #4: 

Nope, that doesn't work for the "make dist" target.

Back to the drawing board.

G. Branden Robinson <gbranden>
Group administrator
Sat 21 Aug 2021 01:04:20 AM UTC, comment #3: 

I got it working.  Current patch.


diff --git a/Makefile.am b/Makefile.am
index a6b016dc..eb01f935 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -922,8 +922,15 @@ SUFFIXES += .man
 # Version files - see script 'build-aux/git-gen-version'
 EXTRA_DIST += $(top_srcdir)/.version
 BUILT_SOURCES += $(top_srcdir)/.version
-$(top_srcdir)/.version:
-       echo $(VERSION) > $@-t && mv $@-t $@
+# Regenerate a temporary version string file on every build, but update
+# the real version file's mtime only if its contents change.
+.PHONY: $(top_srcdir)/.version.tmp
+$(top_srcdir)/.version.tmp:
+       echo $(VERSION) > $@
+$(top_srcdir)/.version: $(top_srcdir)/.version.tmp
+       test -f $@ || cp $@.tmp $@
+       cmp -s $@.tmp $@ || mv $@.tmp $@
+       $(RM) -f $@.tmp
 dist-hook:
        echo $(VERSION) > $(distdir)/.tarball-version


G. Branden Robinson <gbranden>
Group administrator
Sat 21 Aug 2021 12:09:00 AM UTC, comment #2: 

That plan did not survive contact with the enemy.  I'll keep sawing away.

G. Branden Robinson <gbranden>
Group administrator
Fri 20 Aug 2021 11:57:50 PM UTC, comment #1: 

It appears that Makefile.am lets the .version file get incredibly stale.

Here's mine.

+version+
$ cat .version
1.22.4.rc2.3-bf01
-version-

Since it's not the mtime but the contents that matter, I think I will make a .PHONY target for the temporary .version-t and then use cmp and mv to replace .version with it if they differ.  This way .version-t will get updated on every build, but it'll only trigger an avalanche of dependency builds after actual commits (or rebases) change the version string.

For the problem reported, once the above is done, adding a dependency on the .version file to the nroff target in nroff.am should do the trick.

G. Branden Robinson <gbranden>
Group administrator
Tue 17 Aug 2021 10:31:34 PM UTC, original submission:  

Subject: Different version in "nroff" from that in "groff"

  There is sometimes a difference between the version in "nroff" and
in "groff",

for example:

groff 2784-198aca

nroff 2790-c4f0

"nroff" get its version from PACKAGE-VERSION in the Makefile

"groff" from build/src/libs/libgroff/version.cpp

  This causes failure in src/roff/nroff/tests/verbose_option_works.sh.

Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-16 gbranden StatusConfirmed Need Info
        Planned Release1.23.0 None
    2022-03-22 barx StatusFixed Confirmed
        Open/ClosedClosed Open
    2022-03-05 gbranden CategoryNone General
    2021-08-23 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2021-08-21 gbranden SummaryDifferent version in &quot;nroff&quot; from that in &quot;groff&quot; .version file not updated as aggressively as it should be
    2021-08-20 gbranden StatusNone In Progress
        Assigned toNone gbranden

    Back to the top

    Powered by Savane 3.12