Discussion:
[Scons-users] Need Help - Renaming an input file does not re-trigger SCons builder
Basil Mathew
2018-02-02 04:41:59 UTC
Permalink
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
Bill Deegan
2018-02-02 05:20:20 UTC
Permalink
So if you change:
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"
]
)

to
result1 = env.Foo("src/work/dds/codeSymbols.grl", [

"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"
]
)

It doesn't rebuild?
I'm not sure what you're saying you're changing which is not resulting in
an action running.
(Also please don't change the color of the text, it makes it quite hard to
read)

-Bill
SCons Project Co-Manager
Post by Basil Mathew
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 = ''
target_file_path_name = target[0].get_abspath()
print "############### Executing Process"
return None
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",
]
)
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
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Basil Mathew
2018-02-02 06:30:17 UTC
Permalink
Hello Bill,

Thank you for the reply, sorry about the coloring, intention was to make it
easier to read

What I meant to convey was that if I just rename one of the input file
without modifying the content (for e.g src/work/dds/gtypes_dds_1.grl to
src/work/dds/gtypes_dds.grl ), I do not see the action
"command_process_executor_builder" running.

I make the following change:

1. I rename the file src/work/dds/gtypes_dds_1.grl to
src/work/dds/gtypes_dds.grl in the file system
2. I change the SConstruct as shown below

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"
]
)

to
result1 = env.Foo("src/work/dds/codeSymbols.grl", [

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

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

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

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

Thank you
Basil
Post by Basil Mathew
result1 = env.Foo("__proc_done.txt", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
ecu_add_test.grl"
]
)
to
result1 = env.Foo("src/work/dds/codeSymbols.grl", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
ecu_add_test.grl"
]
)
It doesn't rebuild?
I'm not sure what you're saying you're changing which is not resulting in
an action running.
(Also please don't change the color of the text, it makes it quite hard to
read)
-Bill
SCons Project Co-Manager
Post by Basil Mathew
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 = ''
target_file_path_name = target[0].get_abspath()
print "############### Executing Process"
return None
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",
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
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Basil Mathew
2018-02-02 07:09:31 UTC
Permalink
Hello Bill,

Please ignore my earlier e-mail, there was an error from my side in the
attached example, I did not intend to modify the target name, the target
name remains the same, please excuse

What I meant to convey was that if I just rename one of the input file
without modifying the file content (for e.g src/work/dds/gtypes_dds_1.grl
to src/work/dds/gtypes_dds.grl ), I do not see the action
"command_process_executor_builder" running.

I make the following change:

1. I rename the file src/work/dds/gtypes_dds_1.grl to
src/work/dds/gtypes_dds.grl in the file system
2. I change the SConstruct as shown below

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"
]
)

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

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

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

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

Thank you
Post by Basil Mathew
Hello Bill,
Thank you for the reply, sorry about the coloring, intention was to make
it easier to read
What I meant to convey was that if I just rename one of the input file
without modifying the content (for e.g src/work/dds/gtypes_dds_1.grl to
src/work/dds/gtypes_dds.grl ), I do not see the action
"command_process_executor_builder" running.
1. I rename the file src/work/dds/gtypes_dds_1.grl to
src/work/dds/gtypes_dds.grl in the file system
2. I change the SConstruct as shown below
result1 = env.Foo("__proc_done.txt", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
]
)
to
result1 = env.Foo("src/work/dds/codeSymbols.grl", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds.grl",
"src/work/dds/iopt_memmap.grl",
]
)
Thank you
Basil
Post by Basil Mathew
result1 = env.Foo("__proc_done.txt", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
ecu_add_test.grl"
]
)
to
result1 = env.Foo("src/work/dds/codeSymbols.grl", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
ecu_add_test.grl"
]
)
It doesn't rebuild?
I'm not sure what you're saying you're changing which is not resulting in
an action running.
(Also please don't change the color of the text, it makes it quite hard
to read)
-Bill
SCons Project Co-Manager
Post by Basil Mathew
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 = ''
target_file_path_name = target[0].get_abspath()
print "############### Executing Process"
return None
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",
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
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Dirk Baechle
2018-02-02 08:01:37 UTC
Permalink
Hi Basil,

here's my advice: Drop your current approach and start anew. Have you already read our ToolsForFools guide in the Wiki?
Sorry for being so blunt, but it looks like you're trying hard to link your own "build steps" into SCons.
Don't do that...wrap the actual transformation of *.grl into "something else" into a proper Builder. SCons will do the rest.

Best regards, and keep those questions coming,

Dirk
Post by Basil Mathew
Hello Bill,
Please ignore my earlier e-mail, there was an error from my side in the
attached example, I did not intend to modify the target name, the target
name remains the same, please excuse
What I meant to convey was that if I just rename one of the input file
without modifying the file content (for e.g
src/work/dds/gtypes_dds_1.grl
to src/work/dds/gtypes_dds.grl ), I do not see the action
"command_process_executor_builder" running.
1. I rename the file src/work/dds/gtypes_dds_1.grl to
src/work/dds/gtypes_dds.grl in the file system
2. I change the SConstruct as shown below
result1 = env.Foo("__proc_done.txt", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.
grl",
"src/work/dds/iopt_memmap.grl",
grl"
]
)
to
result1 = env.Foo( "__proc_done.txt" , [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds.grl",
"src/work/dds/iopt_memmap.grl",
grl"
]
)
Thank you
On Fri, Feb 2, 2018 at 12:00 PM, Basil Mathew
Post by Basil Mathew
Hello Bill,
Thank you for the reply, sorry about the coloring, intention was to
make
Post by Basil Mathew
it easier to read
What I meant to convey was that if I just rename one of the input
file
Post by Basil Mathew
without modifying the content (for e.g src/work/dds/gtypes_dds_1.grl
to
Post by Basil Mathew
src/work/dds/gtypes_dds.grl ), I do not see the action
"command_process_executor_builder" running.
1. I rename the file src/work/dds/gtypes_dds_1.grl to
src/work/dds/gtypes_dds.grl in the file system
2. I change the SConstruct as shown below
result1 = env.Foo("__proc_done.txt", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
]
)
to
result1 = env.Foo("src/work/dds/codeSymbols.grl", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds.grl",
"src/work/dds/iopt_memmap.grl",
]
)
Thank you
Basil
On Fri, Feb 2, 2018 at 10:50 AM, Bill Deegan
Post by Basil Mathew
result1 = env.Foo("__proc_done.txt", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
ecu_add_test.grl"
]
)
to
result1 = env.Foo("src/work/dds/codeSymbols.grl", [
"src/work/dds/codeSymbols.grl",
"src/work/dds/gtypes_dds_1.grl",
"src/work/dds/iopt_memmap.grl",
ecu_add_test.grl"
]
)
It doesn't rebuild?
I'm not sure what you're saying you're changing which is not
resulting in
Post by Basil Mathew
Post by Basil Mathew
an action running.
(Also please don't change the color of the text, it makes it quite
hard
Post by Basil Mathew
Post by Basil Mathew
to read)
-Bill
SCons Project Co-Manager
On Thu, Feb 1, 2018 at 8:41 PM, Basil Mathew
Post by Basil Mathew
Hello all,
I am fairly new to SCons and to Python; hence, please excuse if
this is
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
a silly question.
I am using SCons version "v2.4.0.rel_2.4.0:3365:9259ea1c13d7". I
was
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
playing around with some very basic topics in SCons to get myself
acquainted with SCons when I came across the strange scenario that
SCons
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
does not execute the builder when I rename one of the input file to
a
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
target without changing its content. I was really surprised since I
was
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
expecting the SCons to recognize that the input files list has
changed(though not its content) and execute the builder. Please see
the
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
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 = ''
target_file_path_name = target[0].get_abspath()
print "############### Executing Process"
return None
global input_files_list, process_option_list,
process_exec_cmd_line,
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
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",
ecu_add_test.grl"
]
)
build()
I was wondering if this is the default behaviour of SCons when it
comes
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
to renaming input files or if there is some mistake with the way I
am using
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
SCons. If this is indeed the default behaviour of SCons, can some
one let
Post by Basil Mathew
Post by Basil Mathew
Post by Basil Mathew
me know the reason behind this.
Thank you
Basil Mathew
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Sent from my Android with K-9 Mail.
Loading...