Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-05-12 08:22:52


On Wednesday 11 May 2005 23:03, David Abrahams wrote:

> >> is printed on the error.
> >>
> >> What do you think?
> >
> > If .rsp file is printed in the log and then deleted, in order to
> > re-run one would have to restore the deleted .rsp file by copying its
> > contents from the log. This works, although it's not uniform with
> > unix-based process (just copy and re-run).
> > On the other hand, if .rsp file is never deleted, then the command
> > line from the log is reusable at any time.
> > I would vote for printing the contents of .rsp, so that all flags are
> > visible in the log, and keeping it intact, so that the compile/link
> > command are reusable at any time later, similar to unix builds.
>
> What do we need to do in order to resolve this? Have we got an
> acceptable plan? This is really a critical problem for me.

We still need to decide what to be done. Options:

1. Grab Matt's code, optionally modifying them so that response files
are not deleted when command fails.

2. Modify V2 so that
- The RSP file is not listed in the target types of generators
- Each action creates RSP file from sources and makes binary
depend on RSP, so that RSP is not removed.

I attach a prototype implementation that implements this idea for
msvc.compile.c++ action, and would appreciate if you try it.

If the behaviour if fine we can made the change for other rules and toolsets.

I'm still not sure which approach is best, but don't care very much either
way.

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2
 --Boundary-00=_ti1gCEe54r5jpbB Content-Type: text/x-diff;
charset="iso-8859-1";
name="msvc.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="msvc.diff"
Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.35
diff -u -r1.35 msvc.jam
--- msvc.jam	23 Nov 2004 09:57:33 -0000	1.35
+++ msvc.jam	12 May 2005 13:20:39 -0000
@@ -225,7 +225,7 @@
generators.register-linker msvc.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB RSP : <toolset>msvc ;
generators.register-archiver msvc.archive : OBJ : STATIC_LIB RSP : <toolset>msvc ;
-generators.register-c-compiler msvc.compile.c++ : CPP : OBJ RSP(%_cpp) : <toolset>msvc ;
+generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : <toolset>msvc ;
generators.register-c-compiler msvc.compile.c : C : OBJ RSP(%_cpp) : <toolset>msvc ;
generators.register-standard msvc.compile.rc : RC : OBJ(%_res) : <toolset>msvc ;
generators.override msvc.compile.rc : rc.resource-compile ;
@@ -267,9 +267,9 @@
{
$(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(<[2]:W)" -c -Fo"$(<[1]:W)"
}
-actions compile.c++
+actions compile.c++ bind RSP
{
- $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(<[2]:W)" -c -Fo"$(<[1]:W)" 
+ $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(RSP:W)" -c -Fo"$(<[1]:W)" && del "$(RSP)"
}
actions compile.rc
@@ -360,7 +360,11 @@
rule compile.c++ ( targets + : sources * : properties * )
{
- common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ;
+ local response-file = $(targets[1]:S=.rsp) ;
+ RSP on $(targets) = $(response-file) ;
+ DEPENDS $(targets) : $(response-file) ;
+ LOCATE on $(response-file) = [ on $(targets[1]) return $(LOCATE) ] ;
+ common.response-file $(targets) : $(sources) : $(response-file) : $(properties) ;
}
rule compile.c ( targets + : sources * : properties * )
 --Boundary-00=_ti1gCEe54r5jpbB-- 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk