Bug 1796

Summary: print directories where make enters
Product: Sisyphus Reporter: imz <vanyaz>
Component: rpm-buildAssignee: placeholder <placeholder>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 CC: arseny, glebfm, imz, ldv, php-coder, placeholder, vt
Version: unstable   
Hardware: all   
OS: Linux   

Description imz 2002-12-30 20:38:58 MSK
When examining build failures, it is useful to know in which directory the compilation failed. 

When looking on some programs\' build output, it is not clear in which directory it happened, because the top-level make doesn\'t print the initial directory. 

I suggest that rpmbuild appends --print-directory to MAKEFLAGS environment variable (or some alternative way to get the same beahviour).

---
For example, pine build:

Making Pine and rpload/rpdump.
make CC=cc DEBUG= OPTIMIZE=-pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686 EXTRADRIVERS=mbox maildir EXTRASPECIALS=MAILSPOOL=/var/mail SSLDIR=/var/lib/ssl SSLINCLUDE=/usr/include SSLLIB=/usr/lib SSLCERTS=/var/lib/ssl/certs -f makefile.lnx
cc -pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686     -DLNX -DSYSTYPE=\\\&quot;LNX\\\&quot; -DMOUSE -Imy_util -Ipure_recode -DRECODEG_PINE   -c -o mailview.o mailview.c
mailview.c: In function `encoding_editorial\':
mailview.c:2002: `ENCODING_DISCLAIMER\' undeclared (first use in this function)
mailview.c:2002: (Each undeclared identifier is reported only once
mailview.c:2002: for each function it appears in.)
mailview.c:4086:9: warning: \&quot;_WINDOWS\&quot; is not defined
make: *** [mailview.o] Error 1
error: Bad exit status from /home/ivan/rpm/tmp/rpm-tmp.33535 (%build)

After appending --print-directory to MAKEFLAGS in pine.spec like this:

%build

MAKEFLAGS=\&quot;$MAKEFLAGS --print-directory\&quot; \\
./build ....

the output contains more information:

Making Pine and rpload/rpdump.
make CC=cc DEBUG= OPTIMIZE=-pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686 EXTRADRIVERS=mbox maildir EXTRASPECIALS=MAILSPOOL=/var/mail SSLDIR=/var/lib/ssl SSLINCLUDE=/usr/include SSLLIB=/usr/lib SSLCERTS=/var/lib/ssl/certs -f makefile.lnx
make: Entering directory `/var/SRC/ivan/rpm/BUILD/pine4.51/pine\'
cc -pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686     -DLNX -DSYSTYPE=\\\&quot;LNX\\\&quot; -DMOUSE -Imy_util -Ipure_recode -DRECODEG_PINE   -c -o mailview.o mailview.c
mailview.c: In function `encoding_editorial\':
mailview.c:2002: `ENCODING_DISCLAIMER\' undeclared (first use in this function)
mailview.c:2002: (Each undeclared identifier is reported only once
mailview.c:2002: for each function it appears in.)
mailview.c:4086:9: warning: \&quot;_WINDOWS\&quot; is not defined
make: *** [mailview.o] Error 1
make: Leaving directory `/var/SRC/ivan/rpm/BUILD/pine4.51/pine\'
error: Bad exit status from /home/ivan/rpm/tmp/rpm-tmp.33535 (%build)

---
The directory information can be parsed by Emacs compilation mode, and the places can be found.

rpm-build-4.0.4-alt12

Comment 1 Dmitry V. Levin 2003-01-02 23:05:25 MSK
Added setting of MAKEFLAGS=\&quot;--print-directory\&quot; variable to %___build_pre macro.
Will be available in next rpm-build release.
Comment 2 Dmitry V. Levin 2003-01-02 23:05:25 MSK
Added setting of MAKEFLAGS=\&quot;--print-directory\&quot; variable to %___build_pre macro.
Will be available in next rpm-build release.
Comment 3 Dmitry V. Levin 2003-02-05 21:37:52 MSK
Implemented in 4.0.4-alt13
Comment 4 Dmitry V. Levin 2003-02-05 21:37:52 MSK
Implemented in 4.0.4-alt13
Comment 5 imz 2003-02-06 16:46:50 MSK
I see it:

rpm --eval=%dump 2&gt;&amp;1 | grep MAKEFLAGS
        MAKEFLAGS=\&quot;--print-directory\&quot;

but it doesn\'t seem to work (tested on pine.spec). Perhaps, the variable should exported. (In pine.spec, make is called as a subprocess of a script.)
Comment 6 imz 2003-02-06 16:46:50 MSK
I see it:

rpm --eval=%dump 2&gt;&amp;1 | grep MAKEFLAGS
        MAKEFLAGS=\&quot;--print-directory\&quot;

but it doesn\'t seem to work (tested on pine.spec). Perhaps, the variable should exported. (In pine.spec, make is called as a subprocess of a script.)
Comment 7 Dmitry V. Levin 2003-02-07 16:00:54 MSK
Indeed.
Comment 8 Dmitry V. Levin 2003-02-07 16:00:54 MSK
Indeed.
Comment 9 Dmitry V. Levin 2003-02-10 09:20:09 MSK
Will be fixed in upcoming release.
Comment 10 Dmitry V. Levin 2003-02-10 09:20:09 MSK
Will be fixed in upcoming release.