-
-
Notifications
You must be signed in to change notification settings - Fork 330
[WIP] Improve SCons AddOption option handling #3436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I've rejiggered |
I actually think that disallowing space separators and nargs >1 is the cleanest fix. (for the latter case, |
Some more poking today and I think this is very difficult problem to solve because of the chicken-and-egg situation involved. The command line is processed once, before the SConscripts are read, because you have to. (a) you might have an argument that tells you a different file to use than This doesn't actually seem to have broken hundreds of users as one might expect if there were lots of users of the functionality, but there are several filed issues on the topic - three noted in the original message here. If we want to make it consistent I'm more convinced than before that the only clean way to do that is what is in the previous comment. I've confirmed the no-more-than-one-option-argument case needs only a two-line patch in I can't see how this could break many people: the more-than-one option-argument case can't work (the tests added here show that); the one-option-argument-with-space case can work, although it's basically by accident - in some configurations it will fail but in some it works - and we still have that option-argument made available as a target as well, which is wrong. But is it conceivable there are users who depend on the one-arg case who don't look at the |
Currently, an option-with-arg added with AddOption has some problems. If the form "--opt=arg" is used, handling is correct, but if the form "--opt arg" is used, the arg ends up considered as one of the targets supplied on the command line. If the option is specified with nargs > 1, there will always be spaces as separators, and so these always fall into the hole. This commit adds two test cases. Closes SCons#2748 Closes SCons#2805 Closes SCons#2977 Signed-off-by: Mats Wichmann <[email protected]>
Collect nargs arguments and get them off the lefover-args list Signed-off-by: Mats Wichmann <[email protected]>
This one is force-updated to keep from going completely stale. I'm going to close the PR presently, and keep the tracking branch. |
I'm going to close this one. I'll resubmit the testcases so we have them around. |
The two tests originally proposed in SCons#3436, now withdrawn, are added along with a new .exclude_tests to not run them, since they'd currently be in a failing state. Needed to fix runtest.py, wasn't completely correctly processing .exclude_tests files. Signed-off-by: Mats Wichmann <[email protected]>
The two tests originally proposed in SCons#3436, now withdrawn, are added along with a new .exclude_tests to not run them, since they'd currently be in a failing state. Needed to fix runtest.py, wasn't completely correctly processing .exclude_tests files. Signed-off-by: Mats Wichmann <[email protected]>
The two tests originally proposed in SCons#3436, now withdrawn, are added along with a new .exclude_tests to not run them, since they'd currently be in a failing state. Needed to fix runtest.py, wasn't completely correctly processing .exclude_tests files. Signed-off-by: Mats Wichmann <[email protected]>
Currently, an option-with-arg added to a project with
AddOption
has some problems. If the form--opt=arg
is used, handling is correct, but if the whitespace=separated form--opt arg
is used,arg
ends up considered as one of the targets supplied on the command line. If the option is specified withnargs
> 1, there will always be whitespace as separators, and so these always fall into the hole, and depending on the rest of the command line, probably will trigger an error that the option required nargs arguments.Work in progress: test cases added, solution still needed.
Closes #2748
Closes #2805
Closes #2977
Signed-off-by: Mats Wichmann [email protected]
Contributor Checklist:
master/src/CHANGES.txt
directory (and read theREADME.txt
in that directory)