Re: [Scons-dev] Bug in MSVC_BATCH handling

2019-12-15 Thread Mats Wichmann

On 12/15/19 2:24 PM, Eric Fahlgren wrote:

I'm not a git user, is there a tutorial on how to create a PR?


there are non-SCons-specific ones that you can find easily.

for scons specifically,

https://scons.org/guidelines.html

which contains a pointer to:

https://github.com/SCons/scons/wiki/GitWorkflows



___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


Re: [Scons-dev] Bug in MSVC_BATCH handling

2019-12-15 Thread Eric Fahlgren
I'm not a git user, is there a tutorial on how to create a PR?

On Sun, Dec 15, 2019 at 12:49 PM Bill Deegan 
wrote:

> Generally issues like this should go to the users mailing list.
> (Mainly so searching users mailing list will find issues run into by
> users).
>
> Good catch.
> Any chance you can put together a PR with a test?
> -Bill
>
> On Sun, Dec 15, 2019 at 12:13 PM Eric Fahlgren 
> wrote:
>
>> Py 3.7 64, Win 10 64
>> SCons 3.1.1 (but same as master in this case)
>>
>> While cleaning up some old scripts, I uncovered a bug that I've been
>> working around for who knows how long and finally isolated it.
>>
>> Problem: When MSVC_BATCH is enabled globally, files with different target
>> name are built individually, but ignoring the specified $TARGET name.
>> Here's a little example, note the first argument to the "cl" output.
>>
>> Input:
>> env = Environment(MSVC_BATCH=True)
>> bug32 = env.Object(target='file32', source='file.cpp')
>>
>> Output:
>> cl  /FoWIN32\src\\  /c  WIN32\src\file.cpp
>>
>> If you explicitly suppress batching in the Object, then it works fine.
>> Input:
>> obj32 = env.Object(target='file32', source='file.cpp', MSVC_BATCH=False)
>> Output:
>> cl  /FoWIN32\src\file32.obj  /c  WIN32\src\file.cpp
>>
>> I chased this to the logic in Tool.msvc, the function msvc_output_flag
>> where it's checking the state of the MSVC_BATCH variable, and ignores the
>> difference in base name that the function just above (msvc_batch_key)
>> performs, see lines 168-173.  My hack, which seems to work, is to change
>> line 191 in msvc.py from:
>>
>> 191: if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0',
>> 'False', '', None):
>>
>> to use the already-working logic in the batch key function like this:
>>
>> 191:if msvc_batch_key(None, env, target, source) is None:
>>
>> I tried it on single file and multi-file compilations, and from my
>> cursory playing around, this keeps the batched files together and separates
>> out those with different target base names, but then I didn't try all cases
>> or check any other downstream code in the pipeline to see if this would
>> break anything there...
>>
>> ___
>> Scons-dev mailing list
>> Scons-dev@scons.org
>> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>>
> ___
> Scons-dev mailing list
> Scons-dev@scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


Re: [Scons-dev] Bug in MSVC_BATCH handling

2019-12-15 Thread Bill Deegan
Generally issues like this should go to the users mailing list.
(Mainly so searching users mailing list will find issues run into by users).

Good catch.
Any chance you can put together a PR with a test?
-Bill

On Sun, Dec 15, 2019 at 12:13 PM Eric Fahlgren 
wrote:

> Py 3.7 64, Win 10 64
> SCons 3.1.1 (but same as master in this case)
>
> While cleaning up some old scripts, I uncovered a bug that I've been
> working around for who knows how long and finally isolated it.
>
> Problem: When MSVC_BATCH is enabled globally, files with different target
> name are built individually, but ignoring the specified $TARGET name.
> Here's a little example, note the first argument to the "cl" output.
>
> Input:
> env = Environment(MSVC_BATCH=True)
> bug32 = env.Object(target='file32', source='file.cpp')
>
> Output:
> cl  /FoWIN32\src\\  /c  WIN32\src\file.cpp
>
> If you explicitly suppress batching in the Object, then it works fine.
> Input:
> obj32 = env.Object(target='file32', source='file.cpp', MSVC_BATCH=False)
> Output:
> cl  /FoWIN32\src\file32.obj  /c  WIN32\src\file.cpp
>
> I chased this to the logic in Tool.msvc, the function msvc_output_flag
> where it's checking the state of the MSVC_BATCH variable, and ignores the
> difference in base name that the function just above (msvc_batch_key)
> performs, see lines 168-173.  My hack, which seems to work, is to change
> line 191 in msvc.py from:
>
> 191: if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', '
> False', '', None):
>
> to use the already-working logic in the batch key function like this:
>
> 191:if msvc_batch_key(None, env, target, source) is None:
>
> I tried it on single file and multi-file compilations, and from my cursory
> playing around, this keeps the batched files together and separates out
> those with different target base names, but then I didn't try all cases or
> check any other downstream code in the pipeline to see if this would break
> anything there...
>
> ___
> Scons-dev mailing list
> Scons-dev@scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


[Scons-dev] Bug in MSVC_BATCH handling

2019-12-15 Thread Eric Fahlgren
Py 3.7 64, Win 10 64
SCons 3.1.1 (but same as master in this case)

While cleaning up some old scripts, I uncovered a bug that I've been
working around for who knows how long and finally isolated it.

Problem: When MSVC_BATCH is enabled globally, files with different target
name are built individually, but ignoring the specified $TARGET name.
Here's a little example, note the first argument to the "cl" output.

Input:
env = Environment(MSVC_BATCH=True)
bug32 = env.Object(target='file32', source='file.cpp')

Output:
cl  /FoWIN32\src\\  /c  WIN32\src\file.cpp

If you explicitly suppress batching in the Object, then it works fine.
Input:
obj32 = env.Object(target='file32', source='file.cpp', MSVC_BATCH=False)
Output:
cl  /FoWIN32\src\file32.obj  /c  WIN32\src\file.cpp

I chased this to the logic in Tool.msvc, the function msvc_output_flag
where it's checking the state of the MSVC_BATCH variable, and ignores the
difference in base name that the function just above (msvc_batch_key)
performs, see lines 168-173.  My hack, which seems to work, is to change
line 191 in msvc.py from:

191: if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', '
False', '', None):

to use the already-working logic in the batch key function like this:

191:if msvc_batch_key(None, env, target, source) is None:

I tried it on single file and multi-file compilations, and from my cursory
playing around, this keeps the batched files together and separates out
those with different target base names, but then I didn't try all cases or
check any other downstream code in the pipeline to see if this would break
anything there...
___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev