[Scons-users] Need Help - Renaming an input file does not re-trigger SCons builder

Basil Mathew iambasilmathew at gmail.com
Thu Feb 1 23:41:59 EST 2018


Hello all,

I am fairly new to SCons and to Python; hence, please excuse if this is a
silly question.

I am using SCons version "v2.4.0.rel_2.4.0:3365:9259ea1c13d7". I was
playing around with some very basic topics in SCons to get myself
acquainted with SCons when I came across the strange scenario that SCons
does not execute the builder when I rename one of the input file to a
target without changing its content. I was really surprised since I was
expecting the SCons to recognize that the input files list has
changed(though not its content) and execute the builder. Please see the
content of the SConstruct file that I have been using.

import os
import sys
import SCons
import subprocess

DefaultEnvironment(tools = [])

input_files_list = []
process_option_list = []
process_exec_cmd_line = ''
target_name = ''

def command_process_executor_builder(target, source, env):
    target_file_path_name = target[0].get_abspath()

    print "############### Executing Process"

    return None

def build():
    global input_files_list, process_option_list, process_exec_cmd_line,
target_name

    env = DefaultEnvironment(tools = [])
    a = Action(command_process_executor_builder, varlist=['my_arg',
'PROCESS_EXEC_CMD_LINE', 'PROCESS_OPTION_LIST'])

    proc_exec_bldr = Builder(action = a)

    env['my_arg'] = 'default-value'
    env['PROCESS_EXEC_CMD_LINE'] = process_exec_cmd_line
    env['PROCESS_OPTION_LIST'] = process_option_list

    env.Append(BUILDERS = {'Foo' : proc_exec_bldr})

    result1 = env.Foo("__proc_done.txt",    [

"src/work/dds/codeSymbols.grl",

"src/work/dds/gtypes_dds_1.grl",

"src/work/dds/iopt_memmap.grl",

"src/work/dds/@ecu_add_test.grl"
                                            ]
                    )


build()

I was wondering if this is the default behaviour of SCons when it comes to
renaming input files or if there is some mistake with the way I am using
SCons. If this is indeed the default behaviour of SCons, can some one let
me know the reason behind this.

Thank you

Basil Mathew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180202/399bac81/attachment-0001.html>


More information about the Scons-users mailing list