[Scons-dev] This morning's WTF moment

anatoly techtonik techtonik at gmail.com
Sat Sep 6 07:34:45 EDT 2014


On Sat, Sep 6, 2014 at 1:10 PM, Gary Oberbrunner <garyo at oberbrunner.com> wrote:
> On Sat, Sep 6, 2014 at 5:42 AM, Russel Winder <russel at winder.org.uk> wrote:
>>
>> scons: warning: No version of Visual Studio compiler found – C/C++
>> compilers most likely not set correctly
>> File … engine\SCons\Script\Main.py", line 602, in
>> _scons_internal_warning
>
>
> Yes, known problem.  The right solution is the toolchain revamp.  A less
> invasive solution is surprisingly hard to find, though Anatoly has a
> possible idea.
> If you initialize your Environment with only the tools of interest, you
> won't see that warning.

The problem repeats on all Windows systems with SCons 2.3.x and
below.

Well, "revamp" is the name, but not the action. It is actually a trap,
because it is not actionable. My attempt to fix the issue uncovered
more complex stuff. The actual thread is here:
https://bitbucket.org/scons/scons/pull-request/169/once-more-suppress-warning-about-missing/diff

I wish I could summarize the problem, but it is very elusive, but over
the last week the idea had ripen into a concept of making tool lookup
logic cross-platform. Right now it is plarform-dependent and rules are
not clear.

complexity#001 - FAQ
http://www.scons.org/wiki/FrequentlyAskedQuestions#Why_doesn.27t_SCons_find_my_compiler.2BAC8-linker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line.
Q: "Why doesn't SCons find my compiler/linker/etc.? ..."
A: env = Environment(ENV = {'PATH' : os.environ['PATH']})

But dammit, the most simple SConstruct Program('hello.c') works on
Linux with GCC, and I believe it should work on Windows with MSVC
too. So, default tools are obviously an exception from this rule.

complexity#002 - How default tools work?
SCons is somehow able to find default GCC or default MSVC without
env/PATH patch. But when MSVC is unavailable on Windows, SCons
doesn't fallback to GCC even if GCC is in PATH. Why?

This should be described before moving further and before I can
support any talks about revamp. Without understanding we will just
waste time, repeat the same mistakes and increase the competence
gap.

The entrypoint is engine/SCons/Tools/__init__.py:tool_list

[ ]

Once this is made, it is possible to draw a table with TL;DR
comparison of old SCons behaviour on different platforms with new
scheme of cross-platform lookup. It may happen that we will
rethink the whole user interaction around that "clean environment"
rule to make more people happy without defaults, but without
sacrificing build "repeatability" (or how do you call this awesome
property that SCons has now?).

But first, a missing [ ] needs to be filled.


More information about the Scons-dev mailing list