GNU bug report logs - #69908
dist-no-built-sources vs. no-dist-built-sources vs. dist-built-sources

Previous Next

Package: automake;

Reported by: Jens Geyer <jensgeyer <at> hotmail.com>

Date: Wed, 20 Mar 2024 01:41:02 UTC

Severity: normal

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69908 in the body.
You can then email your comments to 69908 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Wed, 20 Mar 2024 01:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jens Geyer <jensgeyer <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Wed, 20 Mar 2024 01:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jens Geyer <jensgeyer <at> hotmail.com>
To: bug-automake <at> gnu.org
Subject: dist-no-built-sources vs. no-dist-built-sources vs. dist-built-sources
Date: Tue, 19 Mar 2024 21:38:05 +0100
Hi,

I have seen https://debbugs.gnu.org/49317 and the two commits 13659a7 
and especially 314c55f. I also recognized there is a test case to test 
for the correct behaviour.

Nevertheless I think there is something wrong here. I tried to make it 
work yesterday via AUTOMAKE_OPTIONS (tried both root dir and the 
affected folder) as well as via AM_INIT_AUTOMAKE, neither of them 
produced the expected Makefile. No matter which way I tried, I always 
ended up with

    distdir: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) distdir-am

which, according to both the code in lib/am/distdir.am and the docs 
should not happen, if that option is set.

After looking at these commits again I noticed that although the option 
is named "no-dist-built-sources" (see lib/Automake/Options.pm and the 
docs), the code in bin/automake.in to initialize the DIST_BUILT_SOURCES 
flag tests against sth. else:

    'DIST_BUILT_SOURCES' => !! option 'dist-built-sources',

Which raised the question, whether that feature really works as 
intended, or if it could be broken since 314c55f and the test might not 
work properly for some strange reason?

What am I overlooking? What am I doing wrong?

Thanks,
JensG

PS:The headline refers to the three different variants of that option as 
found in code and commit messages.







Information forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Wed, 20 Mar 2024 20:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 69908 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: jensgeyer <at> hotmail.com
Cc: 69908 <at> debbugs.gnu.org
Subject: Re: bug#69908: dist-no-built-sources vs. no-dist-built-sources vs.
 dist-built-sources
Date: Wed, 20 Mar 2024 14:46:21 -0600
Hi Jens - thanks for the report.

    Nevertheless I think there is something wrong here. 

Quite likely. Can you please send an example tree that shows the failure?

     'DIST_BUILT_SOURCES' => !! option 'dist-built-sources',

Hmm. I had a vague impression that the "no-" was automatically
supported, but I'm not seeing it now.

    or if it could be broken since 314c55f and the test might not 
    work properly for some strange reason?

Certainly possible.

    What am I overlooking? What am I doing wrong?

Probably nothing, x 2 :). --thanks again, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Thu, 21 Mar 2024 23:57:01 GMT) Full text and rfc822 format available.

Message #11 received at 69908 <at> debbugs.gnu.org (full text, mbox):

From: Jens Geyer <jensgeyer <at> hotmail.com>
To: 69908 <at> debbugs.gnu.org
Subject: Re: bug#69908: dist-no-built-sources vs. no-dist-built-sources vs.
 dist-built-sources
Date: Fri, 22 Mar 2024 00:19:14 +0100
[Message part 1 (text/plain, inline)]
Hi Karl,

> Can you please send an example tree that shows the failure?

I modified the existing testscript slightly so I can get a view into 
both configure.ac and Makefile files.

https://gist.github.com/Jens-G/dc9e3fc89d10d1dcf27f289c7e8d5fc8

The output I got from this and dist-no-built-sources.log is rather 
interesting. As it looks, the test is indeed broken from the beginning.

1. Since the tests are run in the specified order, "no-built-sources" 
first followed by "dist-built-sources", the section that modifies 
AM_INIT_AUTOMAKE is run only once, in the first. Consequently, the only 
change in the second round is that another AC_OUTPUT line is added at 
the end - other than that configure.ac looks absolutely identical in 
both cases:

   AC_INIT([dist-no-built-sources], [1.0])
   AM_INIT_AUTOMAKE([no-dist-built-sources])
   AC_CONFIG_FILES([Makefile])
   AC_OUTPUT
   AC_OUTPUT    <<<< this is added in round 2

2. Even if we fix the script so that it properly resets AM_INIT_AUTOMAKE 
in the second round, grepping the generated Makefile for "BUILT_SOURCES" 
still gives the exact same output in both cases, which is also unexpected:

   AM_INIT_AUTOMAKE([no-dist-built-sources])
   BUILT_SOURCES = x.c
   all: $(BUILT_SOURCES)
   distdir: $(BUILT_SOURCES)
   check: $(BUILT_SOURCES)
   install: $(BUILT_SOURCES)
   install-exec: $(BUILT_SOURCES)
       -$(am__rm_f) $(BUILT_SOURCES)


Have fun,

JensG










[Message part 2 (text/html, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Fri, 22 Mar 2024 08:13:02 GMT) Full text and rfc822 format available.

Message #14 received at 69908 <at> debbugs.gnu.org (full text, mbox):

From: Jens Geyer <jensgeyer <at> hotmail.com>
To: 69908 <at> debbugs.gnu.org
Subject: Re: bug#69908: dist-no-built-sources vs. no-dist-built-sources vs.
 dist-built-sources
Date: Fri, 22 Mar 2024 09:11:54 +0100
Hi,

I just realized the last part might be confusing.

What I meant by "looks identical" is only the output of the *second* 
grep (see linked script), not the whole file:

   BUILT_SOURCES = x.c
   all: $(BUILT_SOURCES)
   distdir: $(BUILT_SOURCES)
   check: $(BUILT_SOURCES)
   install: $(BUILT_SOURCES)
   install-exec: $(BUILT_SOURCES)
       -$(am__rm_f) $(BUILT_SOURCES)

Have fun,

JensG








Information forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Fri, 22 Mar 2024 22:58:02 GMT) Full text and rfc822 format available.

Message #17 received at 69908 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: jensgeyer <at> hotmail.com
Cc: 69908 <at> debbugs.gnu.org
Subject: Re: bug#69908: dist-no-built-sources vs. no-dist-built-sources vs.
 dist-built-sources
Date: Fri, 22 Mar 2024 16:27:30 -0600
    The output I got from this and dist-no-built-sources.log is rather 
    interesting. As it looks, the test is indeed broken from the beginning.

Thank you very much, Jens. We'll deal with this asap. Your original
analysis that we simply don't recognize the right option name is looking
correct :) :(.

(Bogdan, want to give it a look? I am consumed with other projects for
the time being.) --thanks, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Thu, 22 Aug 2024 21:31:01 GMT) Full text and rfc822 format available.

Message #20 received at 69908 <at> debbugs.gnu.org (full text, mbox):

From: Bogdan <bogdro <at> gmx.com>
To: automake-patches <at> gnu.org, 69908 <at> debbugs.gnu.org
Cc: jensgeyer <at> hotmail.com
Subject: [bug#69908][PATCH] Fix for no-dist-built-sources
Date: Thu, 22 Aug 2024 23:29:51 +0200
[Message part 1 (text/plain, inline)]
Hello.

Thank you for reporting the issue.

I believe I have fixed the defect. The attached patch assumes that
"no-dist-built-sources" is the right option name, following the
documentation and the Options.pm file.

Automake itself has been changed to process the option correctly,
distdir.am got the reversed condition fixed (!) and a new test has
been added based on the one provided in the defect report (thank you!).

All tests with "dist" in the name pass.

--
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
[automake-no-dist-built-sources-mail.diff (text/x-patch, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Thu, 22 Aug 2024 21:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#69908; Package automake. (Mon, 24 Feb 2025 18:41:01 GMT) Full text and rfc822 format available.

Message #26 received at 69908 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: bogdro <at> gmx.com, 69908 <at> debbugs.gnu.org, jensgeyer <at> hotmail.com
Subject: Re: bug#69908: [PATCH] Fix for no-dist-built-sources
Date: Mon, 24 Feb 2025 11:39:41 -0700
    The attached patch assumes that
    "no-dist-built-sources" is the right option name

Yes, good. I played around with the test some more for cleanliness, but
didn't touch your changes to the code. Hopefully "no-dist-built-sources"
now operates as intended. Pushed and closing ... thanks Bogdan. -k

-----------------------------------------------------------------------------
dist: correct sense of no-dist-built-sources option.

Primarily from https://bugs.gnu.org/69908.

* bin/automake.in (preprocess_file) <DIST_BUILT_SOURCES>:
make the option name be "no-dist-built-sources",
per Options.pm and automake.texi; then set it with a single !.
* lib/am/distdir.am (distdir) [DIST_BUILT_SOURCES]: insert the
dependency on $(BUILT_SOURCES) when DIST_BUILT_SOURCES is true,
not false; i.e., sense was reversed.
* t/dist-no-built-sources.sh: edit the test configure.ac
in the no-dist-built-sources case. Rename the testopt value to
match the Automake option.
* NEWS: mention this.
diff --git a/NEWS b/NEWS
index 26b433314..da6b5e493 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,10 @@ New in 1.x:
     is set to "false", do nothing but exit unsuccessfully, also to match
     previous behavior. (bug#74434)

+  - The no-dist-built-sources Automake option hopefully now operates as
+    intended, i.e., omits the dependency on $(BUILT_SOURCES) for the
+    distdir target. (bug#69908)
+
   - The compile script is more robust to Windows configurations;
     specifically, avoiding double-path translation on MSYS. (bug#75939)

diff --git a/bin/automake.in b/bin/automake.in
index 7e5a5f295..70c512af2 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -6922,7 +6922,7 @@ sub preprocess_file
 		 'SHAR'        => !! option 'dist-shar',
 		 'ZIP'         => !! option 'dist-zip',
 		 'ZSTD'        => !! option 'dist-zstd',
-		 'DIST_BUILT_SOURCES' => !! option 'dist-built-sources',
+		 'DIST_BUILT_SOURCES' => ! option 'no-dist-built-sources',

 		 'INSTALL-INFO' =>  ! option 'no-installinfo',
 		 'INSTALL-MAN'  =>  ! option 'no-installman',
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index d7e4916b5..b214ab2f2 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -76,10 +76,10 @@ AM_RECURSIVE_TARGETS += distdir distdir-am
 endif %?SUBDIRS%

 if %?DIST_BUILT_SOURCES%
-distdir:
+distdir: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) distdir-am
 else !%?DIST_BUILT_SOURCES%
-distdir: $(BUILT_SOURCES)
+distdir:
 	$(MAKE) $(AM_MAKEFLAGS) distdir-am
 endif !%?DIST_BUILT_SOURCES%

diff --git a/t/dist-no-built-sources.sh b/t/dist-no-built-sources.sh
index 4f838b9ce..a3d57881f 100644
--- a/t/dist-no-built-sources.sh
+++ b/t/dist-no-built-sources.sh
@@ -19,15 +19,28 @@
 . test-init.sh

 # the tests are almost the same, so do a loop with a couple conditionals.
-for testopt in no-built-sources dist-built-sources; do
+# 
+# test-init.sh creates configure.ac with an AM_INIT_AUTOMAKE call with
+# no options. The default is [no-no-]dist-built-sources, i.e., distdir
+# does depend on $(BUILT_SOURCES), so test that first. (There is no
+# Automake option named dist-built-sources, only --no-no-dist-built-sources.)
+# 
+# The second time around, add the no-dist-built-sources option,
+# and the distdir target should not depend on anything.
+#
+for testopt in dist-built-sources no-dist-built-sources; do

-  if test "$testopt" = no-built-sources; then
+  if test "$testopt" = no-dist-built-sources; then
     sed -e 's/AM_INIT_AUTOMAKE/AM_INIT_AUTOMAKE([no-dist-built-sources])/' \
         configure.ac >configure.tmp
-    cmp configure.ac configure.tmp && fatal_ 'failed to edit configure.ac'
+    cmp configure.ac configure.tmp \
+    && fatal_ 'failed to edit configure.ac for dist-built-sources'
     mv -f configure.tmp configure.ac
   fi

+#printf "\n\f test=$testopt, configure.ac is:\n"
+#cat configure.ac
+
   cat >> configure.ac << 'END'
 AC_OUTPUT
 END
@@ -43,8 +56,8 @@ y.c:
 	cp x.c y.c # simulate 'undetectable' dependency on x.c
 EOF

-  if test "$testopt" = no-built-sources; then
-    touch y.c # no-built-sources dist needs to have all files already there
+  if test "$testopt" = no-dist-built-sources; then
+    touch y.c # no-dist-built-sources dist needs to have all files already
   else
     : # with default $(BUILT_SOURCES) dep, will try to build y.c by the rule
   fi
@@ -55,6 +68,9 @@ EOF
   ./configure
   run_make dist

+#printf "\n\f test=$testopt, Makefile has:\n"
+#grep ^distdir: Makefile
+
   # In any case, the tarball should contain y.c, but not x.c.
   # The tarball is always named based on $0, regardless of our options.
   pkg_ver=$me-1.0
@@ -63,15 +79,19 @@ EOF
   tar tf "${pkg_ver}".tar "${pkg_ver}"/y.c

   # And x.c should have been built only for the built-sources version.
-  if test "$testopt" = no-built-sources; then
+  if test "$testopt" = no-dist-built-sources; then
     # no-built-sources should not have generated this
     ! test -e x.c
+    grep 'distdir:$' Makefile
   else
     # built-sources build should have it
     test -e x.c
+    grep 'distdir: \$(BUILT_SOURCES)' Makefile
   fi

   # If the test runs fast enough, the make dist second time through
   # won't do anything since the tarball will be considered up to date.
   rm -f "${pkg_ver}".tar.gz "${pkg_ver}".tar
 done
+
+:

compile finished at Mon Feb 24 10:29:51 2025




Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Mon, 24 Feb 2025 18:41:02 GMT) Full text and rfc822 format available.

Notification sent to Jens Geyer <jensgeyer <at> hotmail.com>:
bug acknowledged by developer. (Mon, 24 Feb 2025 18:41:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Mar 2025 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.