[Scons-users] Strage behavior of Alias() method for executables on unix platforms

Managan, Rob managan1 at llnl.gov
Thu Jul 5 12:24:44 EDT 2012


This intrigued me so I ran it myself.
First I ran it with the some_program alias commented out

mantle[10] scons --tree=prune some_program
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: *** Do not know how to make File target `some_program'
(/Users/managan1/Downloads/scons_test/some_program). Stop.
+-some_program
scons: building terminated because of errors.

As expected scons said it did not know how to make some_program.

With the alias I get:

mantle[11] scons --tree=prune some_program
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/program.o -c src/program.cpp
+-some_program
+-build/program.o
| +-src/program.cpp
| +-/usr/bin/g++
+-/usr/bin/g++
scons: done building targets.

And just in case it helps anyone, when I set duplicate=1

mantle[16] scons --tree=prune some_program
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/program.o -c build/program.cpp
+-some_program
+-build/program.o
| +-build/program.cpp
| +-/usr/bin/g++
+-/usr/bin/g++
scons: done building targets.







On 7/5/12 5:20 AM, "Gary Oberbrunner" <garyo at oberbrunner.com> wrote:


>On Thu, Jul 5, 2012 at 7:15 AM, Alexey Petruchik <i100500 at gmail.com>

>wrote:

>> Actually variant_dir in this example is useless. Removing variant_dir

>> changes nothing because "scons some_program" still works, but this time

>>like

>> "scons src/some_program". And I wonder how expected behavior could be

>>non

>> consistent across multiple platforms.

>

>Try scons --tree=prune to see the whole dependency tree. There must

>be a target of some kind called some_program under your top dir.

>




*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Rob Managan email managan at llnl.gov
LLNL phone: 925-423-0903
P.O. Box 808, L-095 FAX: 925-422-3389
Livermore, CA 94551-0808



More information about the Scons-users mailing list