[Scons-users] Using multiple scanners together

William Blevins wblevins001 at gmail.com
Fri Mar 20 19:00:48 EDT 2015


Brian,

You are correct.  Scanner types will not change once the initial scanner
selection has been made.

Example:

Scanners exist: c_scan and b_scan

Files: A.c include B.b
Files: A.b include B.c

Scanning A.c invokes the c_scan on both A.c and all dependencies
Scanning A.b invokes the b_scan on both A.b and all dependencies

I'm not sure if cross-language scanning is "broken" or it was never
supported.  I assume the later.  There are bugs reports that capture this
behavior already (though perhaps not generically).

I have worked on a patch that could resolve this issue. After working
through the system, I determined that the solution wasn't optimal.  A
better solution would be to acquire a new scanner from the base selector
mechanism rather than trying to nest scanners.
https://bitbucket.org/scons/scons/pull-request/176/issue-2264-reworking-scannerbase-to-unify/diff

V/R,
William



On Thu, Mar 19, 2015 at 4:13 PM, Brian Cody <brian.j.cody at gmail.com> wrote:

> I have rediscovered an issue that I hacked around previously. I have a
> project file I want to scan. This scan will produce a list of files with a
> different extension. I then want to scan these files as well. The problem
> is that I can't make SCons respect skeys when recursing. For example:
>
> env['SCANNERS'].append(SCons.Scanner.Scanner(scanners.scan_vhdl_file,
> path_function=SCons.Script.FindPathDirs('VHD_PATH'), recursive=True,
> skeys=['.vhd']))
> env['SCANNERS'].append(SCons.Scanner.Scanner(scanners.scan_prj_file,
> path_function=SCons.Script.FindPathDirs('VHD_PATH'), recursive=True,
> skeys=['.prj']))
>
> This is the code I would expect to have to write. In this case, the
> project file is scanned and the vhd files within are detected. It then
> opens the vhd files using the project file scanner rather than the vhd file
> scanner. Fine--I suppose recursive could be interpreted that way--but
> disabling recursive doesn't help either. What ends up happening is that
> SCons doesn't scan the vhd files at all, which I take as a different
> interpretation of what recursive means. If the vhd files are given as the
> original source, everything works fine.
>
> My hack is a hybrid scanner function that detects whether the file being
> scanned in a project file or a vhd file, and it redirects to the proper
> scanning function.
>
> Is there a more correct way to accomplish this?
>
> Thanks!
> -Brian
>
> _______________________________________________
> 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/20150320/caf7ed39/attachment.html>


More information about the Scons-users mailing list