summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Script
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Script')
-rw-r--r--src/engine/SCons/Script/Interactive.py4
-rw-r--r--src/engine/SCons/Script/Main.py59
-rw-r--r--src/engine/SCons/Script/Main.xml2
-rw-r--r--src/engine/SCons/Script/MainTests.py13
-rw-r--r--src/engine/SCons/Script/SConsOptions.py69
-rw-r--r--src/engine/SCons/Script/SConscript.py83
-rw-r--r--src/engine/SCons/Script/SConscript.xml25
-rw-r--r--src/engine/SCons/Script/SConscriptTests.py4
-rw-r--r--src/engine/SCons/Script/__init__.py27
9 files changed, 177 insertions, 109 deletions
diff --git a/src/engine/SCons/Script/Interactive.py b/src/engine/SCons/Script/Interactive.py
index dee770c..3d70728 100644
--- a/src/engine/SCons/Script/Interactive.py
+++ b/src/engine/SCons/Script/Interactive.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from __future__ import print_function
-__revision__ = "src/engine/SCons/Script/Interactive.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Interactive.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
__doc__ = """
SCons interactive mode
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 076c30b..878f824 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -17,7 +17,7 @@ unsupported_python_version = (2, 6, 0)
deprecated_python_version = (2, 7, 0)
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -38,7 +38,7 @@ deprecated_python_version = (2, 7, 0)
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Script/Main.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Main.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import SCons.compat
@@ -48,6 +48,7 @@ import sys
import time
import traceback
import sysconfig
+import platform
import SCons.CacheDir
import SCons.Debug
@@ -58,6 +59,7 @@ import SCons.Job
import SCons.Node
import SCons.Node.FS
import SCons.Platform
+import SCons.Platform.virtualenv
import SCons.SConf
import SCons.Script
import SCons.Taskmaster
@@ -66,6 +68,20 @@ import SCons.Warnings
import SCons.Script.Interactive
+# Global variables
+first_command_start = None
+last_command_end = None
+print_objects = 0
+print_memoizer = 0
+print_stacktrace = 0
+print_time = 0
+sconscript_time = 0
+cumulative_command_time = 0
+exit_status = 0 # final exit status, assume success by default
+this_build_status = 0 # "exit status" of an individual build
+num_jobs = None
+delayed_warnings = []
+
def fetch_win32_parallel_msg():
# A subsidiary function that exists solely to isolate this import
@@ -85,15 +101,14 @@ def revert_io():
sys.stderr = sys.__stderr__
sys.stdout = sys.__stdout__
+
class SConsPrintHelpException(Exception):
pass
+
display = SCons.Util.display
progress_display = SCons.Util.DisplayEngine()
-first_command_start = None
-last_command_end = None
-
class Progressor(object):
prev = ''
@@ -441,19 +456,6 @@ def python_version_deprecated(version=sys.version_info):
return version < deprecated_python_version
-# Global variables
-
-print_objects = 0
-print_memoizer = 0
-print_stacktrace = 0
-print_time = 0
-sconscript_time = 0
-cumulative_command_time = 0
-exit_status = 0 # final exit status, assume success by default
-this_build_status = 0 # "exit status" of an individual build
-num_jobs = None
-delayed_warnings = []
-
class FakeOptionParser(object):
"""
A do-nothing option parser, used for the initial OptionsParser variable.
@@ -622,7 +624,7 @@ def _SConstruct_exists(dirname='', repositories=[], filelist=None):
current directory.
"""
if not filelist:
- filelist = ['SConstruct', 'Sconstruct', 'sconstruct']
+ filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'Sconstruct.py', 'sconstruct.py']
for file in filelist:
sfile = os.path.join(dirname, file)
if os.path.isfile(sfile):
@@ -862,6 +864,13 @@ def _main(parser):
for warning_type, message in delayed_warnings:
SCons.Warnings.warn(warning_type, message)
+ if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:
+ if options.enable_virtualenv:
+ SCons.Platform.virtualenv.enable_virtualenv = True
+
+ if options.ignore_virtualenv:
+ SCons.Platform.virtualenv.ignore_virtualenv = True
+
if options.diskcheck:
SCons.Node.FS.set_diskcheck(options.diskcheck)
@@ -1161,7 +1170,7 @@ def _build_targets(fs, options, targets, target_top):
# -U, local SConscript Default() targets
target_top = fs.Dir(target_top)
def check_dir(x, target_top=target_top):
- if hasattr(x, 'cwd') and not x.cwd is None:
+ if hasattr(x, 'cwd') and x.cwd is not None:
cwd = x.cwd.srcnode()
return cwd == target_top
else:
@@ -1253,7 +1262,11 @@ def _build_targets(fs, options, targets, target_top):
BuildTask.options = options
- python_has_threads = sysconfig.get_config_var('WITH_THREAD')
+ is_pypy = platform.python_implementation() == 'PyPy'
+ # As of 3.7, python removed support for threadless platforms.
+ # See https://www.python.org/dev/peps/pep-0011/
+ is_37_or_later = sys.version_info >= (3, 7)
+ python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later
# to check if python configured with threads.
global num_jobs
num_jobs = options.num_jobs
@@ -1347,7 +1360,7 @@ def main():
pass
parts.append(version_string("engine", SCons))
parts.append(path_string("engine", SCons))
- parts.append("Copyright (c) 2001 - 2017 The SCons Foundation")
+ parts.append("Copyright (c) 2001 - 2019 The SCons Foundation")
version = ''.join(parts)
from . import SConsOptions
@@ -1363,7 +1376,7 @@ def main():
revert_io()
except SystemExit as s:
if s:
- exit_status = s
+ exit_status = s.code
except KeyboardInterrupt:
print("scons: Build interrupted.")
sys.exit(2)
diff --git a/src/engine/SCons/Script/Main.xml b/src/engine/SCons/Script/Main.xml
index 73db83e..c1c4bde 100644
--- a/src/engine/SCons/Script/Main.xml
+++ b/src/engine/SCons/Script/Main.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2017 The SCons Foundation
+Copyright (c) 2001 - 2019 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Script/MainTests.py b/src/engine/SCons/Script/MainTests.py
index f5660b0..752ea0a 100644
--- a/src/engine/SCons/Script/MainTests.py
+++ b/src/engine/SCons/Script/MainTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,12 +21,10 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/MainTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/MainTests.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import unittest
-import TestUnit
-
import SCons.Errors
import SCons.Script.Main
@@ -41,12 +39,7 @@ import SCons.Script.Main
# of private functionality.
if __name__ == "__main__":
- suite = unittest.TestSuite()
- tclasses = []
- for tclass in tclasses:
- names = unittest.getTestCaseNames(tclass, 'test_')
- suite.addTests(list(map(tclass, names)))
- TestUnit.run(suite)
+ unittest.main()
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index 5515c7d..5651c96 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/SConsOptions.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConsOptions.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import optparse
import re
@@ -38,6 +38,7 @@ except ImportError:
_ = gettext
import SCons.Node.FS
+import SCons.Platform.virtualenv
import SCons.Warnings
OptionValueError = optparse.OptionValueError
@@ -146,7 +147,7 @@ class SConsValues(optparse.Values):
"""
Sets an option from an SConscript file.
"""
- if not name in self.settable:
+ if name not in self.settable:
raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name)
if name == 'num_jobs':
@@ -166,7 +167,7 @@ class SConsValues(optparse.Values):
value = str(value)
except ValueError:
raise SCons.Errors.UserError("A string is required: %s"%repr(value))
- if not value in SCons.Node.FS.Valid_Duplicates:
+ if value not in SCons.Node.FS.Valid_Duplicates:
raise SCons.Errors.UserError("Not a valid duplication style: %s" % value)
# Set the duplicate style right away so it can affect linking
# of SConscript files.
@@ -225,39 +226,8 @@ class SConsOption(optparse.Option):
fmt = "option %s: nargs='?' is incompatible with short options"
raise SCons.Errors.UserError(fmt % self._short_opts[0])
- try:
- _orig_CONST_ACTIONS = optparse.Option.CONST_ACTIONS
-
- _orig_CHECK_METHODS = optparse.Option.CHECK_METHODS
-
- except AttributeError:
- # optparse.Option had no CONST_ACTIONS before Python 2.5.
-
- _orig_CONST_ACTIONS = ("store_const",)
-
- def _check_const(self):
- if self.action not in self.CONST_ACTIONS and self.const is not None:
- raise OptionError(
- "'const' must not be supplied for action %r" % self.action,
- self)
-
- # optparse.Option collects its list of unbound check functions
- # up front. This sucks because it means we can't just override
- # the _check_const() function like a normal method, we have to
- # actually replace it in the list. This seems to be the most
- # straightforward way to do that.
-
- _orig_CHECK_METHODS = [optparse.Option._check_action,
- optparse.Option._check_type,
- optparse.Option._check_choice,
- optparse.Option._check_dest,
- _check_const,
- optparse.Option._check_nargs,
- optparse.Option._check_callback]
-
- CHECK_METHODS = _orig_CHECK_METHODS + [_check_nargs_optional]
-
- CONST_ACTIONS = _orig_CONST_ACTIONS + optparse.Option.TYPED_ACTIONS
+ CHECK_METHODS = optparse.Option.CHECK_METHODS + [_check_nargs_optional]
+ CONST_ACTIONS = optparse.Option.CONST_ACTIONS + optparse.Option.TYPED_ACTIONS
class SConsOptionGroup(optparse.OptionGroup):
"""
@@ -363,7 +333,7 @@ class SConsOptionParser(optparse.OptionParser):
in self.largs, so that any value overridden on the
command line is immediately available if the user turns
around and does a GetOption() right away.
-
+
We mimic the processing of the single args
in the original OptionParser._process_args(), but here we
allow exact matches for long-opts only (no partial
@@ -374,7 +344,7 @@ class SConsOptionParser(optparse.OptionParser):
command-line arguments that
1. haven't been processed so far (self.largs), but
2. are possibly not added to the list of options yet.
-
+
So, when we only have a value for "--myargument" yet,
a command-line argument of "--myarg=test" would set it.
Responsible for this behaviour is the method
@@ -383,7 +353,7 @@ class SConsOptionParser(optparse.OptionParser):
be unique.
This would lead to further confusion, because we might want
to add another option "--myarg" later on (see issue #2929).
-
+
"""
rargs = []
largs_restore = []
@@ -400,7 +370,7 @@ class SConsOptionParser(optparse.OptionParser):
if "=" in l:
# Split into option and value
lopt = l.split("=", 1)
-
+
if lopt[0] in self._long_opt:
# Argument is already known
rargs.append('='.join(lopt))
@@ -415,7 +385,7 @@ class SConsOptionParser(optparse.OptionParser):
skip = True
else:
rargs.append(l)
-
+
# Parse the filtered list
self.parse_args(rargs, self.values)
# Restore the list of remaining arguments for the
@@ -689,7 +659,7 @@ def Parser(version):
metavar="TYPE")
def opt_duplicate(option, opt, value, parser):
- if not value in SCons.Node.FS.Valid_Duplicates:
+ if value not in SCons.Node.FS.Valid_Duplicates:
raise OptionValueError(opt_invalid('duplication', value,
SCons.Node.FS.Valid_Duplicates))
setattr(parser.values, option.dest, value)
@@ -706,6 +676,12 @@ def Parser(version):
action="callback", callback=opt_duplicate,
help=opt_duplicate_help)
+ if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:
+ op.add_option('--enable-virtualenv',
+ dest="enable_virtualenv",
+ action="store_true",
+ help="Import certain virtualenv variables to SCons")
+
op.add_option('-f', '--file', '--makefile', '--sconstruct',
nargs=1, type="string",
dest="file", default=[],
@@ -733,6 +709,11 @@ def Parser(version):
help="Search DIR for imported Python modules.",
metavar="DIR")
+ op.add_option('--ignore-virtualenv',
+ dest="ignore_virtualenv",
+ action="store_true",
+ help="Do not import virtualenv variables to SCons")
+
op.add_option('--implicit-cache',
dest='implicit_cache', default=False,
action="store_true",
@@ -906,6 +887,7 @@ def Parser(version):
action="append",
help="Search REPOSITORY for source and target files.")
+
# Options from Make and Cons classic that we do not yet support,
# but which we may support someday and whose (potential) meanings
# we don't want to change. These all get a "the -X option is not
@@ -978,7 +960,6 @@ def Parser(version):
action="callback", callback=opt_not_yet,
# help="Warn when an undefined variable is referenced."
help=SUPPRESS_HELP)
-
return op
# Local Variables:
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index 350772e..9687c29 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -5,10 +5,8 @@ files.
"""
-from __future__ import print_function
-
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,7 +27,7 @@ from __future__ import print_function
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Script/SConscript.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConscript.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import SCons
import SCons.Action
@@ -46,12 +44,15 @@ import SCons.Script.Main
import SCons.Tool
import SCons.Util
+from . import Main
+
import collections
import os
import os.path
import re
import sys
import traceback
+import time
class SConscriptReturn(Exception):
pass
@@ -152,6 +153,35 @@ def Return(*vars, **kw):
stack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :)
+def handle_missing_SConscript(f, must_exist=None):
+ """Take appropriate action on missing file in SConscript() call.
+
+ Print a warning or raise an exception on missing file.
+ On first warning, print a deprecation message.
+
+ Args:
+ f (str): path of missing configuration file
+ must_exist (bool): raise exception if file does not exist
+
+ Raises:
+ UserError if 'must_exist' is True or if global
+ SCons.Script._no_missing_sconscript is True.
+ """
+
+ if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not False):
+ msg = "Fatal: missing SConscript '%s'" % f.get_internal_path()
+ raise SCons.Errors.UserError(msg)
+
+ if SCons.Script._warn_missing_sconscript_deprecated:
+ msg = "Calling missing SConscript without error is deprecated.\n" + \
+ "Transition by adding must_exist=0 to SConscript calls.\n" + \
+ "Missing SConscript '%s'" % f.get_internal_path()
+ SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
+ SCons.Script._warn_missing_sconscript_deprecated = False
+ else:
+ msg = "Ignoring missing SConscript '%s'" % f.get_internal_path()
+ SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
+
def _SConscript(fs, *files, **kw):
top = fs.Top
sd = fs.SConstruct_dir.rdir()
@@ -248,17 +278,23 @@ def _SConscript(fs, *files, **kw):
pass
try:
try:
-# _file_ = SCons.Util.to_str(_file_)
- exec(compile(_file_.read(), _file_.name, 'exec'),
- call_stack[-1].globals)
+ if Main.print_time:
+ time1 = time.time()
+ scriptdata = _file_.read()
+ scriptname = _file_.name
+ _file_.close()
+ exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
except SConscriptReturn:
pass
finally:
+ if Main.print_time:
+ time2 = time.time()
+ print('SConscript:%s took %0.3f ms' % (f.get_abspath(), (time2 - time1) * 1000.0))
+
if old_file is not None:
call_stack[-1].globals.update({__file__:old_file})
else:
- SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning,
- "Ignoring missing SConscript '%s'" % f.get_internal_path())
+ handle_missing_SConscript(f, kw.get('must_exist', None))
finally:
SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1
@@ -362,9 +398,9 @@ class SConsEnvironment(SCons.Environment.Base):
something like 3.2b1."""
version = version_string.split(' ')[0].split('.')
v_major = int(version[0])
- v_minor = int(re.match('\d+', version[1]).group())
+ v_minor = int(re.match(r'\d+', version[1]).group())
if len(version) >= 3:
- v_revision = int(re.match('\d+', version[2]).group())
+ v_revision = int(re.match(r'\d+', version[2]).group())
else:
v_revision = 0
return v_major, v_minor, v_revision
@@ -516,6 +552,31 @@ class SConsEnvironment(SCons.Environment.Base):
raise SCons.Errors.UserError("Import of non-existent variable '%s'"%x)
def SConscript(self, *ls, **kw):
+ """Execute SCons configuration files.
+
+ Parameters:
+ *ls (str or list): configuration file(s) to execute.
+
+ Keyword arguments:
+ dirs (list): execute SConscript in each listed directory.
+ name (str): execute script 'name' (used only with 'dirs').
+ exports (list or dict): locally export variables the
+ called script(s) can import.
+ variant_dir (str): mirror sources needed for the build in
+ a variant directory to allow building in it.
+ duplicate (bool): physically duplicate sources instead of just
+ adjusting paths of derived files (used only with 'variant_dir')
+ (default is True).
+ must_exist (bool): fail if a requested script is missing
+ (default is False, default is deprecated).
+
+ Returns:
+ list of variables returned by the called script
+
+ Raises:
+ UserError: a script is not found and such exceptions are enabled.
+ """
+
if 'build_dir' in kw:
msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead."""
SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)
diff --git a/src/engine/SCons/Script/SConscript.xml b/src/engine/SCons/Script/SConscript.xml
index e6be6d2..2d77aa3 100644
--- a/src/engine/SCons/Script/SConscript.xml
+++ b/src/engine/SCons/Script/SConscript.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2017 The SCons Foundation
+Copyright (c) 2001 - 2019 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -38,6 +38,10 @@ Multiple calls to
&f-Default;
are legal,
and add to the list of default targets.
+As noted above, both forms of this call affect the
+same global list of default targets; the
+construction environment method applies
+construction variable expansion to the targets.
</para>
<para>
@@ -357,12 +361,12 @@ Return('val1 val2')
<scons_function name="SConscript">
<arguments>
-(scripts, [exports, variant_dir, duplicate])
-<!-- (scripts, [exports, variant_dir, src_dir, duplicate]) -->
+(scripts, [exports, variant_dir, duplicate, must_exist])
+<!-- (scripts, [exports, variant_dir, src_dir, duplicate, must_exist]) -->
</arguments>
<arguments>
-(dirs=subdirs, [name=script, exports, variant_dir, duplicate])
-<!-- (dirs=subdirs, [name=script, exports, variant_dir, src_dir, duplicate]) -->
+(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist])
+<!-- (dirs=subdirs, [name=script, exports, variant_dir, src_dir, duplicate, must_exist]) -->
</arguments>
<summary>
<para>
@@ -564,6 +568,17 @@ TODO??? SConscript('build/SConscript', src_dir='src')
</para>
<para>
+The optional
+<varname>must_exist</varname>
+argument, if true, causes an exception to be raised if a requested
+&SConscript; file is not found. The current default is false,
+causing only a warning to be omitted, but this behavior is deprecated.
+For scripts which truly intend to be optional, transition to
+explicty supplying
+<literal>must_exist=False</literal> to the call.
+</para>
+
+<para>
Here are some composite examples:
</para>
diff --git a/src/engine/SCons/Script/SConscriptTests.py b/src/engine/SCons/Script/SConscriptTests.py
index 2b10446..c1232e8 100644
--- a/src/engine/SCons/Script/SConscriptTests.py
+++ b/src/engine/SCons/Script/SConscriptTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/SConscriptTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConscriptTests.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import SCons.Script.SConscript
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index ffafadf..cf2e472 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -12,7 +12,7 @@ it goes here.
"""
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ it goes here.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Script/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import time
start_time = time.time()
@@ -81,8 +81,8 @@ import SCons.Action
import SCons.Builder
import SCons.Environment
import SCons.Node.FS
-import SCons.Options
import SCons.Platform
+import SCons.Platform.virtualenv
import SCons.Scanner
import SCons.SConf
import SCons.Subst
@@ -150,6 +150,7 @@ Environment = SCons.Environment.Environment
#OptParser = SCons.SConsOptions.OptParser
FindPathDirs = SCons.Scanner.FindPathDirs
Platform = SCons.Platform.Platform
+Virtualenv = SCons.Platform.virtualenv.Virtualenv
Return = _SConscript.Return
Scanner = SCons.Scanner.Base
Tool = SCons.Tool.Tool
@@ -162,12 +163,6 @@ ListVariable = SCons.Variables.ListVariable
PackageVariable = SCons.Variables.PackageVariable
PathVariable = SCons.Variables.PathVariable
-# Deprecated names that will go away some day.
-BoolOption = SCons.Options.BoolOption
-EnumOption = SCons.Options.EnumOption
-ListOption = SCons.Options.ListOption
-PackageOption = SCons.Options.PackageOption
-PathOption = SCons.Options.PathOption
# Action factories.
Chmod = SCons.Defaults.Chmod
@@ -283,12 +278,20 @@ def HelpFunction(text, append=False):
# Will be non-zero if we are reading an SConscript file.
sconscript_reading = 0
+_no_missing_sconscript = False
+_warn_missing_sconscript_deprecated = True
+
+def set_missing_sconscript_error(flag=1):
+ """Set behavior on missing file in SConscript() call. Returns previous value"""
+ global _no_missing_sconscript
+ old = _no_missing_sconscript
+ _no_missing_sconscript = flag
+ return old
+
#
def Variables(files=[], args=ARGUMENTS):
return SCons.Variables.Variables(files, args)
-def Options(files=[], args=ARGUMENTS):
- return SCons.Options.Options(files, args)
# The list of global functions to add to the SConscript name space
# that end up calling corresponding methods or Builders in the
@@ -374,7 +377,9 @@ GlobalDefaultBuilders = [
'SharedObject',
'StaticLibrary',
'StaticObject',
+ 'Substfile',
'Tar',
+ 'Textfile',
'TypeLibrary',
'Zip',
'Package',