List Info

Thread: v2: ALWAYS without effect?




v2: ALWAYS without effect?
country flaguser name
Germany
2007-08-09 08:49:28
Hi!

I'm using boost build v2 from the sandbox svn:
	URL: h
ttp://svn.boost.org/svn/boost/trunk/tools/build/v2
	Revision: 38489
And bjam (built from cvs somewhen):
	Boost.Jam  Version 3.1.15. OS=LINUX.

I have a main.cpp with some program and the following
Jamroot:

	exe main : main.cpp ;
	ALWAYS main ;
	install all : main : <location>dist ;

when I execute bjam release multiple times "main"
is built once and not
updated:

$ bjam-cvs release
...found 16 targets...
...updating 7 targets...
MkDir1 bin
MkDir1 bin/gcc-4.1.2
MkDir1 bin/gcc-4.1.2/release
gcc.compile.c++ bin/gcc-4.1.2/release/main.o
gcc.link bin/gcc-4.1.2/release/main
MkDir1 dist
gcc.link dist/main
...updated 7 targets...
$ bjam-cvs release
...found 16 targets...
$

I expect it to be updated everytime, because I marked it as
"ALWAYS".
What's wrong here?

Frank

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: v2: ALWAYS without effect?
user name
2007-08-09 10:22:26
Frank Birbacher wrote:

> Hi!
> 
> I'm using boost build v2 from the sandbox svn:
> URL: h
ttp://svn.boost.org/svn/boost/trunk/tools/build/v2
> Revision: 38489
> And bjam (built from cvs somewhen):
> Boost.Jam  Version 3.1.15. OS=LINUX.
> 
> I have a main.cpp with some program and the following
Jamroot:
> 
> exe main : main.cpp ;
> ALWAYS main ;
> install all : main : <location>dist ;

ALWAYS is low-level bjam builtin that applies to low-level
bjam targets. It does not work for Boost.Build targets.
I'm afraid we don't have any easy way to get this
functionality.

- Volodya


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: v2: ALWAYS without effect?
user name
2007-08-09 10:37:22
Vladimir Prus wrote, on 8/9/2007 11:22 AM:
> Frank Birbacher wrote:
>
>   
>> Hi!
>>
>> I'm using boost build v2 from the sandbox svn:
>> URL: h
ttp://svn.boost.org/svn/boost/trunk/tools/build/v2
>> Revision: 38489
>> And bjam (built from cvs somewhen):
>> Boost.Jam  Version 3.1.15. OS=LINUX.
>>
>> I have a main.cpp with some program and the
following Jamroot:
>>
>> exe main : main.cpp ;
>> ALWAYS main ;
>> install all : main : <location>dist ;
>>     
>
> ALWAYS is low-level bjam builtin that applies to
low-level
> bjam targets. It does not work for Boost.Build
targets.
> I'm afraid we don't have any easy way to get this
functionality.
>
> - Volodya
>   

We've solved a similar problem.  We had a file that included
a build 
time that we wanted rebuilt.  It's something like this:

obj app_timestamp : app_timestamp.cpp ;
exe app : app_timestamp ;
install dist : app ;
make timestamp-hack : dist app_timestamp : delete_run ;
local RM = [ common.rm-command ] ;
actions delete_run
{
    $(RM) $(>[2])
}

The "dist" on the make line is to make sure the
delete happens after the 
install -- "app_timestamp" is what gets deleted. 
If you just want to 
relink every time, this would probably work:

exe app : app_timestamp.cpp ;
install dist : app ;
make timestamp-hack : dist app : delete_run ;
local RM = [ common.rm-command ] ;
actions delete_run
{
    $(RM) $(>[2])
}

HTH,

Phillip
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: v2: ALWAYS without effect?
country flaguser name
Germany
2007-08-09 17:50:38
Vladimir Prus schrieb:
> ALWAYS is low-level bjam builtin that applies to
low-level
> bjam targets. It does not work for Boost.Build
targets.

What is a "low-level bjam target"? ALWAYS doesn't
work on source files.
But would intermediate generated targets work?

I'm defining a new source file type which can be translated
to a
resource script ".rc". This ".rc" file
includes svn version information
and I need to generate a new one not based on file
timestamps but on
"svnversion" information. This version can just
change without bjam
noticing it. So I would prefer bjam to just rebuild the file
every time.

So the general question is: How can I teach bjam to update
files based
on an arbitrary function instead of a timestamp test.

> I'm afraid we don't have any easy way to get this
functionality.

Is this already the answer?

Meanwhile I'll try to use Phillip's idea of removing the
generated file.

Frank

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: v2: ALWAYS without effect?
country flaguser name
Russian Federation
2007-08-15 13:43:01
On Friday 10 August 2007 02:50:38 Frank Birbacher wrote:
> Vladimir Prus schrieb:
> > ALWAYS is low-level bjam builtin that applies to
low-level
> > bjam targets. It does not work for Boost.Build
targets.
> 
> What is a "low-level bjam target"? ALWAYS
doesn't work on source files.
> But would intermediate generated targets work?

There are three kinds of targets in Boost.Build.

So called "main targets" or
"metatargets" are what users
defines in Jamfiles. See build/targets.jam for
implementation.
When a metatarget is built, generators and other mechanism
produce a tree of "virtual targets", see
build/virtual-target.jam.
Finally, each virtual target is converted into actual bjam
target (by calling the 'actualize' method). bjam target is
just
a string. ALWAYS works on bjam targets only.

By looking at notfile-target in build/virtual-target.jam
you
can see a virtual target that makes bjam target always
updated,
using the same ALWAYS builtin. So, I suppose you
can create a custom class derived from file-target and
modify
it to call ALWAYS on real bjam target.

> I'm defining a new source file type which can be
translated to a
> resource script ".rc". This ".rc"
file includes svn version information
> and I need to generate a new one not based on file
timestamps but on
> "svnversion" information. This version can
just change without bjam
> noticing it. So I would prefer bjam to just rebuild the
file every time.
> 
> So the general question is: How can I teach bjam to
update files based
> on an arbitrary function instead of a timestamp test.

It is not possible now. I was thinking about implementing
signature-based
checks -- where the build command will be checksummed by
default, but
which can be trivially extended to checksum just about
anything. Nothing
concrete was done.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )