[Scons-users] Question over variant directory, and default script name

Bill Deegan bill at baddogconsulting.com
Sun May 7 10:20:35 EDT 2017

See responses inline below

On Sun, May 7, 2017 at 8:37 AM, RW via Scons-users <scons-users at scons.org>

> Hi,
> I've recently been looking at using SCons
> since I'm quite into python and this is a very easy to read and easy to
> debug build system.
> 1. The first question is surrounding the variant directory
> I'm not sure if this is by design. But I've noticed with the variant_dir
> option for SConscript. The destination directory for the build needs to be
> underneath the location of the SConscript file
> So for example this will not work (just claims the build is up to date):
> import os.path as path
> testdir1 = path.abspath('../../Build/LibBuild/glue')
> SConscript('ExampleSource/SConscript.py', variant_dir=testdir1)
> This however will work:
> import os.path as path
> testdir1 = path.abspath('Build/LibBuild/glue')
> SConscript('ExampleSource/SConscript.py', variant_dir=testdir1)
> It's not that big of an issue since I can just place a script at the root
> of the project which calls the other script lower down.
> and place the variant directory in the root script
> Not sure if this is by design, a bug, or a feature request.

Safe to assume you are running scons from a directory which is not the
parent of the variant dir?
If so then it's expected. SCons defaults the target to . (the current
directory) which includes every directory beneath it.
You can work around this by using Default()

See: http://scons.org/doc/production/HTML/scons-man.html
For more detail.

> 2. The second question I think is more of a feature request
> Typically I use Visual Studio with python tools for writing and debugging
> python. However VS only recognizes python scripts if the file extension is
> .py
> The way I get around this is to have the following in the SConstruct file
> execfile('SConstruct.py')
> Followed by the real script in the SConstruct.py file
> to get intelisense working within Visual Studio I usually also place the
> following at the top of the script (which isn't needed but helps auto
> completion)
> import SCons.Script
> from SCons.Environment import Environment
> Would it be possible to set Scons to use SConstruct.py if SConstruct isn't
> detected in the directory?

Can't think of any reason not to. Please file an enhancement request on
scons.tigris.org (our bug tracker)

That said, I"m a little suprised (but not a lot) that there's no way to set
default language types for files named any particular way..

> For info I put up a blog post a while back on debugging SCons scripts
> within Visual Studio via python tools
> http://grbd.github.io/posts/2016/07/27/scons-builds-with-visual-studio/
> Many Thanks,
> Richard
> _______________________________________________
> 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/20170507/7a0c7303/attachment-0001.html>

More information about the Scons-users mailing list