WIP: Fix ninja warnings/exceptions
Try to normalize errors/warnings. One warning which was just a bare class instantition (thus, a no-op) now warns; two failures which used to raise SConsWarning now raise ImportError since that's what they are (has no visible effect to the user); another now raises UserError, as it is raised for an error in SConscripts.
There are no API or documentation impacts of this change, just consistency.
Fixes #4036
Contributor Checklist:
- [ ] I have created a new test or updated the unit tests to cover the new/changed functionality.
- [X] I have updated
CHANGES.txt(and read theREADME.rst) - [ ] I have updated the appropriate documentation
Ah. This fails tests, because there are places where the warning (that wasn't previously raised) is triggered, and since it didn't happen before, the tests are not written to expect it and now show unexpected output. Will need to update the tests (or drop the change).
test/ninja/generated_sources_alias.py
test/ninja/ninja_command_line.py
That's more interesting than I expected - looks like this is an internal action - it comes from the Textfile builder, and the comments in SCons/Tool/ninja/NinjaState.py make me think a different action name was expected. Here's one of the new warnings:
> scons: warning: Found unhandled function action '_action', generating SCons command to build
> Note: this is less efficient than using Ninja. You can write your own ninja build generator for this function using NinjaRegisterFunctionHandler
> File "/home/mats/github/scons/scripts/scons.py", line 97, in <module>
Flagging this WIP/draft until some questions are answered.
@mwichmann Is this still viable, or should it be closed?
@mwichmann Is this still viable, or should it be closed?
Well, the state hasn't changed: ninja (mildly) misuses some stuff, and "fixing" it causes some tests to go awry, making the change a little bigger than I was up for at the time, with possibly no real benefit. I can possibly be talking into dropping it, since I've never gone back to do the "further investigation".
I'll revisit this someday, no need to have it hanging around here for now.