[Scons-users] How to turn off source scanner

Bill Deegan bill at baddogconsulting.com
Wed Feb 6 22:40:12 EST 2019


>From manpage:
SCANNERS

A list of the available implicit dependency scanners. New file scanners may
be added by appending to this list, although the more flexible approach is
to associate scanners with a specific Builder. See the sections "Builder
Objects" and "Scanner Objects," below, for more information.
Create a new environment and empty this variable? Use that environment for
your command?

Does that work?

On Wed, Feb 6, 2019 at 9:31 PM Jason Kenny <dragon512 at live.com> wrote:

>
>
> Looking how to turn off a scanner for a build command.
>
>
>
> Simple reproducer..
>
>
>
> Run:
>
> Git clone https://github.com/libunwind/libunwind.git
>
>
>
> In the libunwind folder add a Sconstruct with this content
>
>
>
> env = Environment()
>
> env.Command(
>
>     ["Makefile"],
>
>     [
>
>         "include/compiler.h",
>
>         "include/dwarf-eh.h",
>
>         "include/dwarf.h",
>
>         "include/dwarf_i.h",
>
>         "include/libunwind-aarch64.h",
>
>         "include/libunwind-arm.h",
>
>         "include/libunwind-common.h.in",
>
>         "include/libunwind-coredump.h",
>
>         "include/libunwind-dynamic.h",
>
>         "include/libunwind.h.in",
>
>         "include/libunwind-hppa.h",
>
>         "include/libunwind-ia64.h",
>
>         "include/libunwind_i.h",
>
>         "include/libunwind-mips.h",
>
>         "include/libunwind-ppc32.h",
>
>         "include/libunwind-ppc64.h",
>
>         "include/libunwind-ptrace.h",
>
>         "include/libunwind-sh.h",
>
>         "include/libunwind-tilegx.h",
>
>         "include/libunwind-x86_64.h",
>
>         "include/libunwind-x86.h",
>
>         "include/mempool.h",
>
>         "include/remote.h",
>
>         "include/unwind.h",
>
>     ],
>
>     "autoreconf -if && ./configure\
>
>      CC=${CC} CXX=${CXX}\
>
>      "
>
> )
>
>
>
> Then run
>
> Scons
>
>
>
> Then run
>
> Scons –debug=explain -n
>
>
>
> You should see something as:
>
>>
> scons: Building targets ...
>
> scons: rebuilding `Makefile' because:
>
>            `include/config.h' is a new dependency
>
>            `include/libunwind.h' is a new dependency
>
>            `include/libunwind-common.h' is a new dependency
>
>            `include/tdep/libunwind_i.h' is a new dependency
>
> autoreconf -if && ./configure CC=gcc CXX=g++
>
> scons: done building targets.
>
>
>
> The reason for this is that the Commands source is a list of header files.
> These header files have a scanner running on them. When the configure logic
> is finished the config.h and other headers are generated. This cause a
> false rebuild to happen.
>
>
>
> I would like to prevent the false rebuild.
>
> The more complex case based on a function I am trying to define to make it
> easy to call autoconf project from scons to build a larger mega project.
> The issue I am having is that in case as this libunwind would be a “leaf
> component” that is needed by many other components. This rebuild of the
> Makefile causes a chain of build action that make for annoying and long
> builds on the second pass that are not needed. Technically the Makefile
> does not need to be rebuilt because config.h was added. However I have not
> found a way to get this fixed.
>
>
>
> I tired adding
>
>
>
> env.Ignore(['Makefile'],
>
>     [
>
>         'include/config.h',
>
>            'include/libunwind.h',
>
>            'include/libunwind-common.h',
>
>            'include/tdep/libunwind_i.h',
>
>     ]
>
> )
>
>
>
> But this results in a message of:
>
> scons: rebuilding `Makefile' because the dependency order changed:…
>
>
>
> Do you have thoughts on how to fix this? My main thought is to turn off
> the c\c++ scanner for this builder. However I am unaware of a method to do
> this.
>
>
>
> Jason
> _______________________________________________
> 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/20190206/c732afeb/attachment.html>


More information about the Scons-users mailing list