bugmake - Bugs: bug #30723, implicit re-executing of subdirs...

 
 

bug #30723: implicit re-executing of subdirs breaks $(origin) with make-3.82

Submitter:  Mike Frysinger <vapier>
Submitted:  Tue 10 Aug 2010 05:22:11 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.82 Operating System:  Any
Fixed Release:  4.0 Triage Status:  Verified
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 10 Aug 2010 08:31:26 AM UTC, comment #4: 

yes, that patch fixes things for me.  now i get the "expected":
Makefile:240: * mixed implicit and normal rules.  Stop.

but that is something to take up with glibc maintainers

Mike Frysinger <vapier>
Tue 10 Aug 2010 07:13:52 AM UTC, comment #3: 

Hm, I believe I found the bug.  Please try this patch:

--- main.c      19 Jul 2010 07:10:53 -0000      1.243
+++ main.c      10 Aug 2010 07:12:15 -0000
@@ -2093,6 +2093,7 @@
             const char *pv = define_makeflags (1, 1);
             char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
             sprintf (p, "MAKEFLAGS=%s", pv);
+            p = allocated_variable_expand (p);
             putenv (p);
           }


Paul D. Smith <psmith>
Group administrator
Tue 10 Aug 2010 05:55:05 AM UTC, comment #2: 

i tried to recreate a reduced test case but failed, but then i realized i was testing on a diff machine that had make-3.81

here is a simple reduced test case ... forget about glibc ;)

$ tar xf origin-breakage.tar.bz2
$ cd origin-breakage
$ make-3.82 x=1
config.make:1: x=1 origin=command line
config.make:3: x=1 origin=command line
rm -f foo/foo
make-3.82 -C foo
make-3.82[1]: Entering directory `/home/vapier/origin-breakage/foo'
../config.make:1: x=1 origin=command line
../config.make:3: x=1 origin=command line
Makefile:2: foo: No such file or directory
touch foo
make-3.82[1]: Leaving directory `/home/vapier/origin-breakage/foo'
make-3.82[1]: Entering directory `/home/vapier/origin-breakage/foo'
../config.make:1: x=1 origin=environment
../config.make:3: x= origin=file
make-3.82[1]: `foo' is up to date.
make-3.82[1]: Leaving directory `/home/vapier/origin-breakage/foo'
rm -f foo/foo

$ make-3.81 x=1
config.make:1: x=1 origin=command line
config.make:3: x=1 origin=command line
rm -f foo/foo
make-3.81 -C foo
make-3.81[1]: Entering directory `/home/vapier/origin-breakage/foo'
../config.make:1: x=1 origin=command line
../config.make:3: x=1 origin=command line
Makefile:2: foo: No such file or directory
touch foo
make-3.81[1]: Leaving directory `/home/vapier/origin-breakage/foo'
make-3.81[1]: Entering directory `/home/vapier/origin-breakage/foo'
../config.make:1: x=1 origin=command line
../config.make:3: x=1 origin=command line
make-3.81[1]: `foo' is up to date.
make-3.81[1]: Leaving directory `/home/vapier/origin-breakage/foo'
rm -f foo/foo

Mike Frysinger <vapier>
Tue 10 Aug 2010 05:53:48 AM UTC, comment #1: 

Hm.  Is there any way for you to provide a smaller example?  I tried to follow your directions but I think the build failed for some other reason, earlier than the problem you hit:

make[2]: *** No rule to make target `.../glibc-2.11.2/build/elf/soinit.os', needed by `.../glibc-2.11.2/build/libc.so'.  Stop.
make[2]: Leaving directory `.../glibc-2.11.2/sunrpc'
make[1]: *** [sunrpc/install-headers] Error 2
make[1]: Leaving directory `.../glibc-2.11.2'
make: *** [install-headers] Error 2

Up until that point, every invocation of config.make had shown origin=command line.

I tried to create a little makefile to represent what I think you said (when you say depends on generated files, do you mean like make include files where make generates them and auto-re-execs itself?  Or something different?) but I couldn't get that to fail either.

Paul D. Smith <psmith>
Group administrator
Tue 10 Aug 2010 05:22:11 AM UTC, original submission:  

upgrading from make-3.81 to make-3.82 seems to break the origin marking of variables and thus command line variable overriding.  using glibc here as my example.

to reproduce (warning: do not run as root):
  tar xf glibc-2.11.2.tar.bz2
  cd glibc-2.11.2
  mkdir build
  cd build
  ../configure --prefix=/usr -q
  sed -i '/^install_root/{h;s:.*:$(warning install_root=$(install_root) origin=$(origin install_root)):;H;x;H;x}' config.make
  make install-headers install_root=$PWD/foo

the local config.make file has a default:
install_root =
but we're overriding it on the command line, so that should always be ignored

glibc will basically do a `make -C ..`, and here you'll see the correct behavior:
.../config.make:8: install_root=$PWD/foo origin=command line
.../config.make:10: install_root=$PWD/foo origin=command line

but the makefile logic in there depends on generated files.  so make will generate those files, leave the subdir, and then re-enter it.  upon re-entry though, we now see:
.../config.make:8: install_root=$PWD/foo origin=environment
.../config.make:10: install_root= origin=file

obviously that is incorrect ;)

Mike Frysinger <vapier>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #21181:  origin-breakage.tar.bz2 added by vapier (383B - application/x-bzip2)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by vapier (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-08-10 psmith Component VersionNone 3.82
    2010-08-10 psmith Item GroupNone Bug
        StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Operating SystemNone Any
        Fixed ReleaseNone 4.0
        Triage StatusNone Verified
    2010-08-10 vapier Attached File- Added origin-breakage.tar.bz2, #21181

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code