[Scons-users] Testing ninja build generator
Mats Wichmann
mats at wichmann.us
Sun Jun 8 15:27:44 EDT 2025
On 6/6/25 10:43, Mats Wichmann wrote:
> On 6/6/25 06:11, Mats Wichmann wrote:
>> On 6/6/25 02:44, Julien Pommier wrote:
>>> Hi,
>>>
>>> I’m trying the ninja build generator (on macOS, with SCons 4.9.1),
>>> and have run so far into two small issues:
>>>
>>> - ninja build commands seem to be incorrectly generated for this type
>>> of SCons command, with two chained sub-commands:
>>>
>>> target = env.Command("run.sh", “run.sh.txt", [ Copy("$TARGET",
>>> "$SOURCE"), Chmod("$TARGET", 0o755) ])
>>
>> That's a List Action.
>
> Okay, now I look at the failure - the action is a list action, but it's
> not failing *because* it's a list action, it's failing because it didn't
> construct the right rule for the *first* action string. The tool does
> have a mapping of some of the special action functions (Copy included,
> but not Chmod), but doesn't seem to be doing the right thing with that
> information. So that example is broken on two levels... sigh.
As an FYI, PR #4732 *should* fix the first two problems. Sort of.
The quoting story should be okay.
The use of a list action will at least execute the first command in the
list if it looks like a recognized one. This is probably fragile. And
the *second* command in your action won't happen - the ninja tool
doesn't recognize the special Chmod action function, and as far as I can
see has no way of handling one of those - it understands ones like Copy
or Install that take a source and target, or ones that take no
arguments, but not one that takes a target and a mode. The logic around
this stuff (as supposed to straightforward build commands) feels like a
lot of baling wire.
We haven't really figured out to do with the different-quoting problem.
More information about the Scons-users
mailing list