[Scons-users] ClassicCPP scanner fails with UTF-8 BOM on non-UTF8 file

Damjan Jovanovic damjan.jov at gmail.com
Thu Jul 2 01:34:22 EDT 2020


Python 3.7.7
SCons v3.1.1.72ae09dc35ac2626f8ff711d8c4b30b6138e08e3
FreeBSD 12.1

I am happy with my solution that used different filename extensions for
intermediate files to avoid scanning them.

It was:
.rsc is built by "transex3" to .rsc(2)
.rsc(2) is built by "rsc" to .rsc(3)
Each .rsc(3) arriving from the previous steps is concatenated to a single
.srs
.srs is built by a different "rsc" invocation to .res and .ilst
There is a different .res/.ilst pair for each language

On Mon, Jun 29, 2020 at 4:33 PM Bill Deegan <bill at baddogconsulting.com>
wrote:

> Which version of SCons, Python, and what OS are you using?
>
> You could write a scanner which is more than just a REGEX and reject
> certain files.
> I can't really understand your map of the source flows. can you write it
> out with words?
>
> On Mon, Jun 29, 2020 at 3:14 AM Damjan Jovanovic <damjan.jov at gmail.com>
> wrote:
>
>>
>>
>> On Mon, Jun 29, 2020 at 11:00 AM Dirk Bächle <tshortik at gmx.de> wrote:
>>
>>> Hi Damjan,
>>>
>>> On 29.06.20 06:29, Damjan Jovanovic wrote:
>>> > Hi
>>> >
>>> > I am trying to port Apache OpenOffice to build with SCons, and while
>>> it's still early, so far it's been a fantastic replacement for
>>> > its current "gbuild" system based on GNU make with unmaintainable
>>> custom eval()-based logic. It has all the advanced build features
>>> > we need usable in such a clear and simple way.
>>> >
>>> > [...]
>>> >
>>> >
>>> > I could hack File.get_text_contents() in engine/SCons/Node/FS.py to
>>> catch exceptions when parsing in utf-8 with the BOM removed and
>>> > retry in latin-1. But an even better solution would be to limit the
>>> ClassicCPP scanner to only scan the .src files under the source/
>>> > directory and ignore the generated files in other directories. Is
>>> there some way to do that?
>>> >
>>>
>>> If you don't want to scan files in the "generated" folders, wouldn't it
>>> be enough to remove those directories from the CPPPATH
>>> variable? I mean, you could make a copy of CPPPATH, let's name it
>>> L10PATH, and remove the offending folders from it. Then pass that
>>> one to the Scanner instead.
>>>
>>> Best regards,
>>>
>>> Dirk
>>>
>>>
>> Not really, because the generated files are the source files to the next
>> step, so that's when they get scanned.
>>
>> I got it working by changing the filename extensions in the 2nd and 3rd
>> steps.
>>
>> Thank you
>> Damjan
>>
>>
>>
>> _______________________________________________
>> 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/20200702/89dd42b0/attachment.html>


More information about the Scons-users mailing list