src_suffix getings ignored

daggs <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <trinity-241aabdc-c2b6-40cd-90bd-b93923127f38-1651998456169@3c-app-mailcom-bs14>
Greetings,

I have the following builder:
import os

template_suffix = ".temp"

def convert_path(base, out, src):
    return src.replace(base, out)

def modify_target(target, source, env):
    return convert_path(env['base'], env['out_dir'], str(source[0])), source

def a_action(target, source, action):
    return os.system("echo -" + action + " " + os.path.basename(source))

def a_b_action(target, source, env):
    return a_action(target, source, "a")

def a_c_action(target, source, env):
    return a_action(target, source, "b")

def generate(env, **kwargs):
    builders = {
        'do_a_b' : env.Builder(action = env.Action(a_b_action), suffix = '.c',
                               src_suffix = template_suffix, emitter = modify_target),
        'do_a_c' : env.Builder(action = env.Action(a_c_action), suffix = '.h',
                               src_suffix = template_suffix, emitter = modify_target)
    }

    env.Append(BUILDERS = builders)

def exists(env):
    return true

when I add prints to modify_target, both target and source looks good.
however, when I run it as part of a scons build flow, it fails with the following error:
scons --tree=all --debug=explain -n -Q
scons: *** While building `['/tmp/proj/output/objs/module_a/generated/dir1/file.o']' from `['generated/dir1/file.temp']': Don't know how to build from a source file with suffix `.temp'.  Expected a suffix in this list: ['.c', '.m', '.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm', '.C', '.f', '.for', '.ftn', '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.f77', '.F77', '.f90', '.F90', '.f95', '.F95', '.f03', '.F03', '.f08', '.F08', '.s', '.asm', '.ASM', '.spp', '.SPP', '.sx', '.S', '.d'].

any ideas what I'm doing wrong?

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.