[Scons-users] Testing ninja build generator
Mats Wichmann
mats at wichmann.us
Fri Jun 6 08:11:12 EDT 2025
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. A bug in the ninja tool's handling of list actions
was just fixed, I wonder if it would help your case. If you feel
adventurous, could you try the current version of the Utils module?
https://github.com/SCons/scons/blob/master/SCons/Tool/ninja_tool/Utils.py
> - it looks like the http communication part between ninja and scons does not like whitespaces in target filenames, for example this command will fail:
>
> target = env.Textfile("run me.sh", “foobar");
>
> the error is:
>
> File "/opt/homebrew/Cellar/python at 3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1283, in _validate_path
> raise InvalidURL(f"URL can't contain control characters. {url!r} "
> http.client.InvalidURL: URL can't contain control characters. '/?build=run me.sh' (found at least ' ')
> ninja: build stopped: subcommand failed.scons: *** [build.ninja] CalledProcessError : Command 'ninja' returned non-zero exit status 1.
If the data is encoded as a URL, that would be correct - can't use a
space. Sounds like those ought to be escaped somewhere. Of course
spaces in filenames are evil anyway :-)
Do you have a slightly more complete testcase you can share?
> Irrelevant to this bug report: I’ve been using scons for maybe 20 years, and I’m still very happy with my initial choice of using SCons. It is powerful, it is reliable, its cache is great. Thanks for this wonderful piece of software.
Thanks for the kind words!
More information about the Scons-users
mailing list