Add variable MSVC_USE_SCRIPT_ARGS to pass args to MSVC_USE_SCRIPT#4102
Conversation
|
Nope. |
|
Actually keep this PR, but change to be a separate variable.. |
…e script MSVC_USE_SCRIPT.
@bdbaddog Done per your comments. |
|
@bdbaddog What do I need to do for this PR? The status (no comments, no merge in days) looks not good. |
looks not good? We do the best that we can. |
|
As discussed in #4106, it might be better if the variable name for the string argument(s) when using MSVC_USE_SCRIPT is MSVC_USE_SCRIPT_ARGS (item 1 in #4106). There is a second use case where a pass-through argument could be allowed when using the "normal" msvc detection that is likely a better use of the variable name MSVC_SCRIPT_ARGS (item 2 in #4106). |
Is it likely that you'd need to specify both? If not having two different variable names may only cause confusion.. |
|
Also does it make sense for any _SCRIPT_ARTS to be a subst()'able string? |
…CRIPT_ARGS (per discussion with jcbrill)
I'm not sure. MSVC_USE_SCRIPT_ARGS probably should accept a scalar string or a list of strings. A list of string arguments can be more palatable from a user perspective. Also, it would likely be a good idea to verify the argument is in fact a string or that the flattened list contains all strings and otherwise raise a user argument exception immediately with a sensible error message. It is probably bad news to pass an incorrect type down through the script environment calls. This is what I have been using in my implementation: |
|
Off-topic trivia: Any guesses? |
Do you have a copy of the debug log for both and/or what happens if you just run that on the command line? (I don't have MSVC 6 anywhere at the moment) |
|
Renamed variable per discussion in #4106 also the variable can now be a list or space separated.
I'll agree, but I think out of scope of this particular PR? As is this PR is usable and will solve an existing issue for some users. |
I already know the answer. This nicely encapsulates the issues with debugging this sort of problem. The crux of the problem is the aggressively minimal SCons environment in which the msvc batch files are executed: when run directly from the command-line there are no errors/warnings. To add insult to injury, even when the MSCommon debugging is enabled, the "raw" stdout is not logged. SCons does not include some of the windows system environment variables used by the setenv.cmd batch file. SetEnv.cmd fragment: The PROCESSOR_ARCHITECTURE and PROCESSOR_ARCHITEW6432 environment variables are not defined. This causes the else clause to be executed. On 64-bit platforms, the x64 compiler is installed in the x64 folder. On 32-bit platforms, the 64-bit compiler is installed in the x86_x64 folder. Therefore, x86_x64 does not exist and the message is echoed to stdout. The message "The x64 compilers are not currently installed" is in fact generated when executed from SCons. If the output were captured it would look something like this (taken from my own tools): The warning is innocuous and generated because the "OS" environment variable is not defined. The older files expect OS to be defined. This is why the msvc 6.0 paths are in quotes: the batch file thinks it is 95/98/ME since OS is not "Windows_NT" In addition, the SDK setenv.cmd batch files expect delayed expansion to be enabled which is typically not the default in a windows shell. The /x86 target environment is "incomplete" but works anyway. Here is the resulting environment for the x86 invocation: Due to delayed expansion not being enabled, !PATH!, !Include!, and !Lib! are not expanded. Also, the Framework path is incomplete due to "windir" not being defined. SDK 6.0 contains stand-alone msvc 8.0 compilers. I have a mind-bending intermediate windows batch file that sets the environment as appropriate in a setlocal/local block, calls the SDK batch file, and "exports" the non-windows wow64/system variables back into what would be the msvc batch file environment. If interested, I could attach. |
|
@bdbaddog sure. |
|
@yuzhichang - do the changes I've made work for your use model? If so I'll go ahead and merge. |
|
@bdbaddog LGTM. Thanks for the review. |
| <cvar name="MSVC_USE_SCRIPT_ARGS"> | ||
| <summary> | ||
| <para> | ||
| Provides arguments passed to the script &cv-MSVC_USE_SCRIPT;. |
There was a problem hiding this comment.
Nitpick: since this is a reference to a different consvar, prefer using linked form: &cv-link-MSVC_USE_SCRIPT;. Perhaps the maintainer can just edit this change in?
I installed multiple VS(VS2005, VS2015) and Windows SDK 6.0 on Win7. I want to use C++ compiler in VS2015, and Windows SDK 6.0, to build apps that target Windows 2003 server 32bit edition.
Contributor Checklist:
CHANGES.txt(and read theREADME.rst)