[Scons-users] Checking for specific versions of visual studio

Bill Deegan bill at baddogconsulting.com
Fri Oct 30 19:35:47 EDT 2015


+1 on keeping the warning.
If you ask for version x and it's not available then you've gone to the
trouble to request a specific version, you should be notified.
Arguably that should be an error.

Now if you wanted to be able to silence the warning in your SConstruct, or
via command line, that would be in keeping with SCons's general philosophy.


-Bill

On Fri, Oct 30, 2015 at 11:59 AM, William Blevins <wblevins001 at gmail.com>
wrote:

>
>
> On Fri, Oct 30, 2015 at 5:50 PM, Brian Cody <brian.j.cody at gmail.com>
> wrote:
>
>> Follow up! (now using SCons 2.4.0)
>>
>> This particular error goes away if in msvc.py, we handle exists this way:
>> def exists(env):
>>     return msvc_exists(env['MSVC_VERSION'])
>>
>> We could check for the presence of that key and send a None in the case
>> the key isn't set. I don't think this should break any existing behavior.
>> Maybe I'll look into how to run scons internal tests, see if I can expose
>> the bug, and then submit a fix?
>>
>>
>>
>> Also in vc.py line 428 we issue a nagging warning that doesn't help
>> anyone. This warning basically says "you created an environment for visual
>> studio 9.0 but you only have visual studio xx installed'. Well that's
>> factual information, but who cares? That's the point of exists. So because
>> I created an environment for a target I may or may not be building, I'm
>> going to get nagged? The other SCons warning printout in this file is very
>> different. It tells you if you've created an environment with conflicting
>> MSVC and MSVS versions. This to me feels proper.
>>
>> So this one is less clear to me, but I'd petition nuking the warning. If
>> we don't, then there's no way with the aid of scons to query for the
>> presence of a tool before getting scolded. Would a removal of this warning
>> be accepted, or would it be shot down? It could go into that debug log
>> instead if it was really desirable to someone somewhere.
>>
>>
> My personal opinion is that SCons lives, sleeps, and breathes
> correctness.  If a warning implies that your build may give unexpected
> results, then you should get an error.  If the warning doesn't imply
> anything, then it shouldn't exist.
>
> Let's see what the others say.
>
> V/R,
> William
>
>
>> Thanks!
>>
>>
>> On Thu, Sep 17, 2015 at 7:39 AM, Brian Cody <brian.j.cody at gmail.com>
>> wrote:
>>
>>> Bill,
>>>
>>> It reports "9.0".
>>>
>>> On Wed, Sep 16, 2015 at 10:39 AM, Bill Deegan <bill at baddogconsulting.com
>>> > wrote:
>>>
>>>> Brian,
>>>>
>>>> Looks like SCons is only finding MSVC 11 and 11.0Exp installed on your
>>>> system.
>>>> Do you have MSVC 9.0 installed?
>>>>
>>>> What's the value of env['MSVC_VERSION'] after you initialize your
>>>> environment?
>>>>
>>>> -Bill
>>>>
>>>> On Wed, Sep 16, 2015 at 8:02 AM, Brian Cody <brian.j.cody at gmail.com>
>>>> wrote:
>>>>
>>>>> Bill,
>>>>>
>>>>> Here's the file you requested. I never realized the option for it
>>>>> existed! Thanks for that.
>>>>>
>>>>> http://pastebin.com/0pqdMYzv
>>>>>
>>>>> -Brian
>>>>>
>>>>>
>>>>> On Tue, Sep 15, 2015 at 9:31 AM, Bill Deegan <
>>>>> bill at baddogconsulting.com> wrote:
>>>>>
>>>>>> Can you run with:
>>>>>>
>>>>>> set SCONS_MSCOMMON_DEBUG=c:\somefile.log
>>>>>> scons <whatever>
>>>>>> and pastbin the log file?
>>>>>>
>>>>>> -Bill
>>>>>>
>>>>>> On Tue, Sep 15, 2015 at 9:01 AM, Brian Cody <brian.j.cody at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hey guys, a while ago I asked about how exists() is used for tools
>>>>>>> and I was told it pretty much isn't. We have an scons.workarounds we use to
>>>>>>> get.. around things like this. Today it looks like this:
>>>>>>>
>>>>>>> _already_warned_about_tool = set()
>>>>>>>
>>>>>>> def does_tool_exist(env, tool):
>>>>>>>     return SCons.Tool.Tool(tool, [str(SCons.Script.Dir(path)) for
>>>>>>> path in env['toolpath']]).exists(env)
>>>>>>>
>>>>>>> def verify_tool_exists(env, tool):
>>>>>>>     exists = does_tool_exist(env, tool)
>>>>>>>     if not exists:
>>>>>>>         if tool not in _already_warned_about_tool:
>>>>>>>             _already_warned_about_tool.add(tool)
>>>>>>>             sys.stderr.write('*** Tool "' + tool + '" does not
>>>>>>> exist; targets skipped.\n')
>>>>>>>             if env['fail_if_tools_are_unavailable']:
>>>>>>>                 raise
>>>>>>> SCons.Errors.BuildError(errstr='fail_if_tools_are_unavailable is enabled.')
>>>>>>>     return exists
>>>>>>>
>>>>>>> This is used because we have some developers who don't have all
>>>>>>> tools who still want to be able to "build all that I can". Now the issue
>>>>>>> we're seeing is that we create an environment specifically for visual
>>>>>>> studio 9.0. i.e.
>>>>>>> Environment(tools = ['msvc', 'mslink', 'masm' , 'mslib'],
>>>>>>> MSVC_VERSION='9.0', ......)
>>>>>>>
>>>>>>> With this environment, the above function will successfully tell you
>>>>>>> if visual studio is installed or not, however it will return True even if
>>>>>>> the version is 12.0. At the moment I'm not sure that we can go to 12 with
>>>>>>> our version of the compact framework. Our easier solution would be that
>>>>>>> this function should just return false. Deep in the bowels of the visual
>>>>>>> studio support I see that the "msvc_exists" takes a version number, but the
>>>>>>> exists() in the tool does not attempt to use it. In "msvs_exists" it does
>>>>>>> not allow the same version check.
>>>>>>>
>>>>>>>
>>>>>>> So my leading question: How am I supposed to offer this
>>>>>>> functionality? If this is a half-implemented in SCons, any suggestion on
>>>>>>> how to solve this generically from our standpoint without injecting changes
>>>>>>> into the SCons package?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Scons-users mailing list
>>>>>>> Scons-users at scons.org
>>>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Scons-users mailing list
>>>>>> Scons-users at scons.org
>>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Scons-users mailing list
>>>>> Scons-users at scons.org
>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20151030/ad72a6cb/attachment.html>


More information about the Scons-users mailing list