Opened 15 years ago

Last modified 15 years ago

#215 new defect

Redundant target rebuilding

Reported by: kucevol@… Owned by: somebody
Priority: major Milestone: M12
Component: component1 Version:
Keywords: Cc:

Description

Version:

dkucevol@localhost> bjam --version
Boost.Build V2 (Milestone 12)
Boost.Jam 03.1.16

The example code follows:

dkucevol@localhost>cat test.h
#ifndef __TEST_H__
#define __TEST_H__

#endif // __TEST_H__

dkucevol@localhost>cat test.cpp
#include "test.h"
int main()
{
  return 0;
}

dkucevol@localhost> cat Jamfile
exe test :
        test.cpp

: <runtime-link>static
;

And header file - test.h was touch future date:

dkucevol@localhost>ll test.h
-rw-r--r-- 1 dkucevol users 60 2009-06-26 10:00 test.h

And my test target is rebuilding permanently:). It's ok!

dkucevol@localhost> bjam test; bjam test
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, you may not be able to build C++ programs.
warning: Use the "--toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 13 targets...
...updating 2 targets...
gcc.compile.c++ bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test.o
gcc.link bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test
...updated 2 targets...
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, you may not be able to build C++ programs.
warning: Use the "--toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 13 targets...
...updating 2 targets...
gcc.compile.c++ bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test.o
gcc.link bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test
...updated 2 targets...

But, if i comment this header:

dkucevol@localhost> cat test.cpp
//#include "test.h"

int main()
{
  return 0;
}

This target continued rebuilding :(.

dkucevol@localhost>bjam test; bjam test
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, you may not be able to build C++ programs.
warning: Use the "--toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 13 targets...
...updating 2 targets...
gcc.compile.c++ bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test.o
gcc.link bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test
...updated 2 targets...
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, you may not be able to build C++ programs.
warning: Use the "--toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 13 targets...
...updating 2 targets...
gcc.compile.c++ bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test.o
gcc.link bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test
...updated 2 targets...

But, if i removed this commenting header:

dkucevol@localhost> cat test.cpp
int main()
{
  return 0;
}
dkucevol@localhost> bjam test; bjam test
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, you may not be able to build C++ programs.
warning: Use the "--toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 12 targets...
...updating 2 targets...
gcc.compile.c++ bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test.o
gcc.link bin/gcc-4.1.2/begun_v/address-model-64/link-static/runtime-link-static/threading-multi/test
...updated 2 targets...
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, you may not be able to build C++ programs.
warning: Use the "--toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 12 targets...

And test target stopped rebuilding!!! :) Looks like bjam processes even commented out headers.

Change History (1)

comment:1 by Md Abdur Rahim, 15 years ago

Milestone: M12
Note: See TracTickets for help on using tickets.