summaryrefslogtreecommitdiffstats
path: root/SCons/Script
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2021-05-24 23:06:13 (GMT)
committerGitHub <noreply@github.com>2021-05-24 23:06:13 (GMT)
commit548d1ffa13be5ed5521f4650089c5e9d7d043811 (patch)
tree9276cb26f9b9fb34efa46615ba15dfbdacefabfe /SCons/Script
parent08ea935321ab8858e15573e44c270da563e12ea0 (diff)
parent0d9a99d630169277689e95e39ae64ccf9b9215bf (diff)
downloadSCons-548d1ffa13be5ed5521f4650089c5e9d7d043811.zip
SCons-548d1ffa13be5ed5521f4650089c5e9d7d043811.tar.gz
SCons-548d1ffa13be5ed5521f4650089c5e9d7d043811.tar.bz2
Merge branch 'master' into ninja-generation
Diffstat (limited to 'SCons/Script')
-rw-r--r--SCons/Script/Main.py1
-rw-r--r--SCons/Script/Main.xml760
-rw-r--r--SCons/Script/MainTests.py3
-rw-r--r--SCons/Script/SConsOptions.py47
-rw-r--r--SCons/Script/SConscriptTests.py2
-rw-r--r--SCons/Script/__init__.py2
6 files changed, 429 insertions, 386 deletions
diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py
index 15f7ece..b674692 100644
--- a/SCons/Script/Main.py
+++ b/SCons/Script/Main.py
@@ -44,7 +44,6 @@ import re
import sys
import time
import traceback
-import sysconfig
import platform
import threading
diff --git a/SCons/Script/Main.xml b/SCons/Script/Main.xml
index 4935f88..f4f4705 100644
--- a/SCons/Script/Main.xml
+++ b/SCons/Script/Main.xml
@@ -317,261 +317,242 @@ atexit.register(print_build_failures)
<summary>
<para>
This function provides a way to query the value of
-SCons options set on scons command line
-(or set using the
-&f-link-SetOption;
-function).
-The options supported are:
+options which can be set via the command line or using the
+&f-link-SetOption; function.
</para>
-
-<para>
-<variablelist>
-<varlistentry>
-<term><literal>cache_debug</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--cache-debug</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>cache_disable</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--cache-disable</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>cache_force</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--cache-force</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>cache_show</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--cache-show</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>clean</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-c</option>, <option>--clean</option>
-and <option>--remove</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>config</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--config</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>directory</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-C</option> and <option>--directory</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>diskcheck</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--diskcheck</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>duplicate</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--duplicate</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>file</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-f</option>, <option>--file</option>, <option>--makefile</option> and <option>--sconstruct</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>help</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-h</option> and <option>--help</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>ignore_errors</literal></term>
-<listitem>
<para>
-which corresponds to <option>--ignore-errors</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>implicit_cache</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--implicit-cache</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>implicit_deps_changed</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--implicit-deps-changed</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>implicit_deps_unchanged</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--implicit-deps-unchanged</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>interactive</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--interact</option> and <option>--interactive</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>keep_going</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-k</option> and <option>--keep-going</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>max_drift</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--max-drift</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>no_exec</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-n</option>,
-<option>--no-exec</option>, <option>--just-print</option>,
-<option>--dry-run</option> and <option>--recon</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>no_site_dir</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--no-site-dir</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>num_jobs</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-j</option> and <option>--jobs</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>profile_file</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--profile</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>question</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-q</option> and <option>--question</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>random</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--random</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>repository</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-Y</option>, <option>--repository</option> and <option>--srcdir</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>silent</literal></term>
-<listitem>
-<para>
-which corresponds to <option>-s</option>, <option>--silent</option> and <option>--quiet</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>site_dir</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--site-dir</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>stack_size</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--stack-size</option>;
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>taskmastertrace_file</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--taskmastertrace</option>; and
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>warn</literal></term>
-<listitem>
-<para>
-which corresponds to <option>--warn</option> and <option>--warning</option>.
-</para>
-</listitem>
-</varlistentry>
-</variablelist>
+<parameter>name</parameter> can be an entry from the following table,
+which shows the corresponding command line arguments
+that could affect the value.
+<parameter>name</parameter> can be also be the destination
+variable name from a project-specific option added using the
+&f-link-AddOption; function, as long as the addition
+happens prior to the &f-GetOption; call in the SConscript files.
</para>
+<informaltable rowsep="1" colsep="1" frame="topbot">
+<tgroup cols="3">
+<thead>
+<row>
+ <entry align="left">Query name</entry>
+ <entry align="left">Command-line options</entry>
+ <entry align="left">Notes</entry>
+</row>
+</thead>
+
+<tbody>
+<row>
+ <entry><varname>cache_debug</varname></entry>
+ <entry><option>--cache-debug</option></entry>
+</row>
+<row>
+ <entry><varname>cache_disable</varname></entry>
+ <entry>
+ <option>--cache-disable</option>,
+ <option>--no-cache</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>cache_force</varname></entry>
+ <entry>
+ <option>--cache-force</option>,
+ <option>--cache-populate</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>cache_readonly</varname></entry>
+ <entry><option>--cache-readonly</option></entry>
+</row>
+<row>
+ <entry><varname>cache_show</varname></entry>
+ <entry><option>--cache-show</option></entry>
+</row>
+<row>
+ <entry><varname>clean</varname></entry>
+ <entry>
+ <option>-c</option>,
+ <option>--clean</option>,
+ <option>--remove</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>climb_up</varname></entry>
+ <entry>
+ <option>-D</option>
+ <option>-U</option>
+ <option>-u</option>
+ <option>--up</option>
+ <option>--search_up</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>config</varname></entry>
+ <entry><option>--config</option></entry>
+</row>
+<row>
+ <entry><varname>debug</varname></entry>
+ <entry><option>--debug</option></entry>
+</row>
+<row>
+ <entry><varname>directory</varname></entry>
+ <entry><option>-C</option>, <option>--directory</option></entry>
+</row>
+<row>
+ <entry><varname>diskcheck</varname></entry>
+ <entry><option>--diskcheck</option></entry>
+</row>
+<row>
+ <entry><varname>duplicate</varname></entry>
+ <entry><option>--duplicate</option></entry>
+</row>
+<row>
+ <entry><varname>enable_virtualenv</varname></entry>
+ <entry><option>--enable-virtualenv</option></entry>
+</row>
+<row>
+ <entry><varname>experimental</varname></entry>
+ <entry><option>--experimental</option></entry>
+ <entry><emphasis>since 4.2</emphasis></entry>
+</row>
+<row>
+ <entry><varname>file</varname></entry>
+ <entry>
+ <option>-f</option>,
+ <option>--file</option>,
+ <option>--makefile</option>,
+ <option>--sconstruct</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>hash_format</varname></entry>
+ <entry><option>--hash-format</option></entry>
+ <entry><emphasis>since 4.2</emphasis></entry>
+</row>
+<row>
+ <entry><varname>help</varname></entry>
+ <entry><option>-h</option>, <option>--help</option></entry>
+</row>
+<row>
+ <entry><varname>ignore_errors</varname></entry>
+ <entry><option>-i</option>, <option>--ignore-errors</option></entry>
+</row>
+<row>
+ <entry><varname>ignore_virtualenv</varname></entry>
+ <entry><option>--ignore-virtualenv</option></entry>
+</row>
+<row>
+ <entry><varname>implicit_cache</varname></entry>
+ <entry><option>--implicit-cache</option></entry>
+</row>
+<row>
+ <entry><varname>implicit_deps_changed</varname></entry>
+ <entry><option>--implicit-deps-changed</option></entry>
+</row>
+<row>
+ <entry><varname>implicit_deps_unchanged</varname></entry>
+ <entry><option>--implicit-deps-unchanged</option></entry>
+</row>
+<row>
+ <entry><varname>include_dir</varname></entry>
+ <entry><option>-I</option>, <option>--include-dir</option></entry>
+</row>
+<row>
+ <entry><varname>install_sandbox</varname></entry>
+ <entry><option>--install-sandbox</option></entry>
+ <entry>Available only if the &t-link-install; tool has been called</entry>
+</row>
+<row>
+ <entry><varname>keep_going</varname></entry>
+ <entry><option>-k</option>, <option>--keep-going</option></entry>
+</row>
+<row>
+ <entry><varname>max_drift</varname></entry>
+ <entry><option>--max-drift</option></entry>
+</row>
+<row>
+ <entry><varname>md5_chunksize</varname></entry>
+ <entry>
+ <option>--hash-chunksize</option>,
+ <option>--md5-chunksize</option>
+ </entry>
+ <entry><emphasis><option>--hash-chunksize</option> since 4.2</emphasis></entry>
+</row>
+<row>
+ <entry><varname>no_exec</varname></entry>
+ <entry>
+ <option>-n</option>,
+ <option>--no-exec</option>,
+ <option>--just-print</option>,
+ <option>--dry-run</option>,
+ <option>--recon</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>no_progress</varname></entry>
+ <entry><option>-Q</option></entry>
+</row>
+<row>
+ <entry><varname>num_jobs</varname></entry>
+ <entry><option>-j</option>, <option>--jobs</option></entry>
+</row>
+<row>
+ <entry><varname>package_type</varname></entry>
+ <entry><option>--package-type</option></entry>
+ <entry>Available only if the &t-link-packaging; tool has been called</entry>
+</row>
+<row>
+ <entry><varname>profile_file</varname></entry>
+ <entry><option>--profile</option></entry>
+</row>
+<row>
+ <entry><varname>question</varname></entry>
+ <entry><option>-q</option>, <option>--question</option></entry>
+</row>
+<row>
+ <entry><varname>random</varname></entry>
+ <entry><option>--random</option></entry>
+</row>
+<row>
+ <entry><varname>repository</varname></entry>
+ <entry>
+ <option>-Y</option>,
+ <option>--repository</option>,
+ <option>--srcdir</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>silent</varname></entry>
+ <entry>
+ <option>-s</option>,
+ <option>--silent</option>,
+ <option>--quiet</option>
+ </entry>
+</row>
+<row>
+ <entry><varname>site_dir</varname></entry>
+ <entry><option>--site-dir</option>, <option>--no-site-dir</option></entry>
+</row>
+<row>
+ <entry><varname>stack_size</varname></entry>
+ <entry><option>--stack-size</option></entry>
+</row>
+<row>
+ <entry><varname>taskmastertrace_file</varname></entry>
+ <entry><option>--taskmastertrace</option></entry>
+</row>
+<row>
+ <entry><varname>tree_printers</varname></entry>
+ <entry><option>--tree</option></entry>
+</row>
+<row>
+ <entry><varname>warn</varname></entry>
+ <entry><option>--warn</option>, <option>--warning</option></entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
<para>
See the documentation for the
corresponding command line option for information about each specific
@@ -768,15 +749,33 @@ Multiple targets can be passed in to a single call to
Sets &scons; option variable <parameter>name</parameter>
to <parameter>value</parameter>.
These options are all also settable via
-&scons; command-line options but the variable name
-may differ from the command-line option name (see table).
+command-line options but the variable name
+may differ from the command-line option name -
+see the table for correspondences.
A value set via command-line option will take
precedence over one set with &f-SetOption;, which
allows setting a project default in the scripts and
temporarily overriding it via command line.
+&f-SetOption; calls can also be placed in the
+<filename>site_init.py</filename> file.
+</para>
+
+<para>
+See the documentation in the manpage for the
+corresponding command line option for information about each specific option.
+The <parameter>value</parameter> parameter is mandatory,
+for option values which are boolean in nature
+(that is, the command line option does not take an argument)
+use a <parameter>value</parameter>
+which evaluates to true (e.g. <constant>True</constant>,
+<constant>1</constant>) or false (e.g. <constant>False</constant>,
+<constant>0</constant>).
+</para>
+
+<para>
Options which affect the reading and processing of SConscript files
-are not settable this way, since those files must
-be read in order to find the &f-SetOption; call.
+are not settable using &f-SetOption; since those files must
+be read in order to find the &f-SetOption; call in the first place.
</para>
<para>
@@ -787,126 +786,161 @@ The settable variables with their associated command-line options are:
<!-- This list comes directly from SConsValues.settable. Keep in sync. -->
<informaltable rowsep="1" colsep="1" frame="topbot">
-<tgroup cols="2">
+<tgroup cols="3">
<thead>
-<row><entry>Variable</entry><entry>Command-line options</entry></row>
+<row>
+ <entry align="left">Settable name</entry>
+ <entry align="left">Command-line options</entry>
+ <entry align="left">Notes</entry>
+</row>
</thead>
+
<tbody>
-<row><entry>
-<varname>clean</varname>
-</entry><entry>
-<option>-c</option>, <option>--clean</option>, <option>--remove</option>
-</entry></row>
-<row><entry>
-<varname>diskcheck</varname>
-</entry><entry>
-<option>--diskcheck</option>
-</entry></row>
-
- <row><entry>
-<varname>duplicate</varname>
-</entry><entry>
-<option>--duplicate</option>
-</entry></row>
-
-
- <row>
- <entry>
- <varname>experimental</varname>
- </entry>
- <entry>
- <option>--experimental</option>
- </entry>
- </row>
-
-
-<row><entry>
-<varname>help</varname>
-</entry><entry>
-<option>-h</option>, <option>--help</option>
-</entry></row>
-<row><entry>
-<varname>implicit_cache</varname>
-</entry><entry>
-<option>--implicit-cache</option>
-</entry></row>
-<!--TODO: add implicit-deps-changed, implicit-deps-unchanged ? -->
-<row><entry>
-<varname>max_drift</varname>
-</entry><entry>
-<option>--max-drift</option>
-</entry></row>
-<row><entry>
-<varname>md5_chunksize</varname>
-</entry><entry>
-<option>--md5-chunksize</option>
-</entry></row>
-<row><entry>
-<varname>no_exec</varname>
-</entry><entry>
-<option>-n</option>, <option>--no-exec</option>,
-<option>--just-print</option>, <option>--dry-run</option>,
-<option>--recon</option>
-</entry></row>
-<row><entry>
-<varname>no_progress</varname>
-</entry><entry>
-<option>-Q</option>
-</entry></row>
-<row><entry>
-<varname>num_jobs</varname>
-</entry><entry>
-<option>-j</option>, <option>--jobs</option>
-</entry></row>
-<row><entry>
-<varname>random</varname>
-</entry><entry>
-<option>--random</option>
-</entry></row>
-<row><entry>
-<varname>silent</varname>
-</entry><entry>
-<option>--silent</option>.
-</entry></row>
-<row><entry>
-<varname>stack_size</varname>
-</entry><entry>
-<option>--stack-size</option>
-</entry></row>
-<row><entry>
-<varname>warn</varname>
-</entry><entry>
-<option>--warn</option>.
-</entry></row>
+<row>
+ <entry><varname>clean</varname></entry>
+ <entry>
+ <option>-c</option>,
+ <option>--clean</option>,
+ <option>--remove</option>
+ </entry>
+</row>
+
+<row>
+ <entry><varname>diskcheck</varname></entry>
+ <entry><option>--diskcheck</option></entry>
+</row>
+
+<row>
+ <entry><varname>duplicate</varname></entry>
+ <entry><option>--duplicate</option></entry>
+</row>
+
+<row>
+ <entry><varname>experimental</varname></entry>
+ <entry><option>--experimental</option></entry>
+ <entry><emphasis>since 4.2</emphasis></entry>
+</row>
+
+<row>
+ <entry><varname>hash_chunksize</varname></entry>
+ <entry><option>--hash-chunksize</option></entry>
+ <entry>
+ Actually sets <varname>md5_chunksize</varname>.
+ <emphasis>since 4.2</emphasis>
+ </entry>
+</row>
+
+<row>
+ <entry><varname>hash_format</varname></entry>
+ <entry><option>--hash-format</option></entry>
+ <entry><emphasis>since 4.2</emphasis></entry>
+</row>
+
+<row>
+ <entry><varname>help</varname></entry>
+ <entry><option>-h</option>, <option>--help</option></entry>
+</row>
+
+<row>
+ <entry><varname>implicit_cache</varname></entry>
+ <entry><option>--implicit-cache</option></entry>
+</row>
+
+<row>
+ <entry><varname>implicit_deps_changed</varname></entry>
+ <entry><option>--implicit-deps-changed</option></entry>
+ <entry>
+ Also sets <varname>implicit_cache</varname>.
+ <emphasis>(settable since 4.2)</emphasis>
+ </entry>
+</row>
+
+<row>
+ <entry><varname>implicit_deps_unchanged</varname></entry>
+ <entry><option>--implicit-deps-unchanged</option></entry>
+ <entry>
+ Also sets <varname>implicit_cache</varname>.
+ <emphasis>(settable since 4.2)</emphasis>
+ </entry>
+</row>
+
+<row>
+ <entry><varname>max_drift</varname></entry>
+ <entry><option>--max-drift</option></entry>
+</row>
+
+<row>
+ <entry><varname>md5_chunksize</varname></entry>
+ <entry><option>--md5-chunksize</option></entry>
+</row>
+
+<row>
+ <entry><varname>no_exec</varname></entry>
+ <entry>
+ <option>-n</option>,
+ <option>--no-exec</option>,
+ <option>--just-print</option>,
+ <option>--dry-run</option>,
+ <option>--recon</option>
+ </entry>
+</row>
+
+<row>
+ <entry><varname>no_progress</varname></entry>
+ <entry><option>-Q</option></entry>
+ <entry>See
+ <footnote>
+ <para>If <varname>no_progress</varname> is set via &f-SetOption;
+ in an SConscript file
+ (but not if set in a <filename>site_init.py</filename> file)
+ there will still be an initial status message about
+ reading SConscript files since &SCons; has
+ to start reading them before it can see the
+ &f-SetOption;.
+ </para>
+ </footnote>
+ </entry>
+</row>
+
+<row>
+ <entry><varname>num_jobs</varname></entry>
+ <entry><option>-j</option>, <option>--jobs</option></entry>
+</row>
+
+<row>
+ <entry><varname>random</varname></entry>
+ <entry><option>--random</option></entry>
+</row>
+
+<row>
+ <entry><varname>silent</varname></entry>
+ <entry>
+ <option>-s</option>,
+ <option>--silent</option>,
+ <option>--quiet</option>
+ </entry>
+</row>
+
+<row>
+ <entry><varname>stack_size</varname></entry>
+ <entry><option>--stack-size</option></entry>
+</row>
+
+<row>
+ <entry><varname>warn</varname></entry>
+ <entry><option>--warn</option></entry>
+</row>
+
</tbody>
</tgroup>
</informaltable>
<para>
-See the documentation in the manpage for the
-corresponding command line option for information about each specific option.
-Option values which are boolean in nature (that is, they are
-either on or off) should be set to a true value (<constant>True</constant>,
-<constant>1</constant>) or a false value (<constant>False</constant>,
-<constant>0</constant>).
-</para>
-
-<note>
-<para>
-If <varname>no_progress</varname> is set via &f-SetOption;
-there will still be initial progress output as &SCons; has
-to start reading SConscript files before it can see the
-&f-SetOption; in an SConscript file:
-<computeroutput>scons: Reading SConscript files ...</computeroutput>
-</para>
-</note>
-
-<para>
Example:
</para>
<example_commands>
-SetOption('max_drift', True)
+SetOption('max_drift', 0)
</example_commands>
</summary>
</scons_function>
diff --git a/SCons/Script/MainTests.py b/SCons/Script/MainTests.py
index 232a8a2..f7e3263 100644
--- a/SCons/Script/MainTests.py
+++ b/SCons/Script/MainTests.py
@@ -23,9 +23,6 @@
import unittest
-import SCons.Errors
-import SCons.Script.Main
-
# Unit tests of various classes within SCons.Script.Main.py.
#
# Most of the tests of this functionality are actually end-to-end scripts
diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py
index c8c9cf8..def8663 100644
--- a/SCons/Script/SConsOptions.py
+++ b/SCons/Script/SConsOptions.py
@@ -129,47 +129,60 @@ class SConsValues(optparse.Values):
'clean',
'diskcheck',
'duplicate',
+ 'experimental',
+ 'hash_chunksize',
'hash_format',
'help',
'implicit_cache',
+ 'implicit_deps_changed',
+ 'implicit_deps_unchanged',
'max_drift',
'md5_chunksize',
'no_exec',
+ 'no_progress',
'num_jobs',
'random',
+ 'silent',
'stack_size',
'warn',
- 'silent',
- 'no_progress',
- 'experimental',
]
def set_option(self, name, value):
+ """Sets an option from an SConscript file.
+
+ Raises:
+ UserError: invalid or malformed option ("error in your script")
"""
- Sets an option from an SConscript file.
- """
+
if name not in self.settable:
- raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name)
+ raise SCons.Errors.UserError(
+ "This option is not settable from a SConscript file: %s" % name
+ )
+ # the following are for options that need some extra processing
if name == 'num_jobs':
try:
value = int(value)
if value < 1:
raise ValueError
except ValueError:
- raise SCons.Errors.UserError("A positive integer is required: %s"%repr(value))
+ raise SCons.Errors.UserError(
+ "A positive integer is required: %s" % repr(value)
+ )
elif name == 'max_drift':
try:
value = int(value)
except ValueError:
- raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
+ raise SCons.Errors.UserError("An integer is required: %s" % repr(value))
elif name == 'duplicate':
try:
value = str(value)
except ValueError:
- raise SCons.Errors.UserError("A string is required: %s"%repr(value))
+ raise SCons.Errors.UserError("A string is required: %s" % repr(value))
if value not in SCons.Node.FS.Valid_Duplicates:
- raise SCons.Errors.UserError("Not a valid duplication style: %s" % value)
+ 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.
SCons.Node.FS.set_duplicate(value)
@@ -177,7 +190,7 @@ class SConsValues(optparse.Values):
try:
value = diskcheck_convert(value)
except ValueError as v:
- raise SCons.Errors.UserError("Not a valid diskcheck value: %s"%v)
+ raise SCons.Errors.UserError("Not a valid diskcheck value: %s" % v)
if 'diskcheck' not in self.__dict__:
# No --diskcheck= option was specified on the command line.
# Set this right away so it can affect the rest of the
@@ -187,12 +200,13 @@ class SConsValues(optparse.Values):
try:
value = int(value)
except ValueError:
- raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
- elif name == 'md5_chunksize':
+ raise SCons.Errors.UserError("An integer is required: %s" % repr(value))
+ elif name in ('md5_chunksize', 'hash_chunksize'):
try:
value = int(value)
except ValueError:
- raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
+ raise SCons.Errors.UserError("An integer is required: %s" % repr(value))
+ name = 'md5_chunksize' # for now, the old name is used
elif name == 'warn':
if SCons.Util.is_String(value):
value = [value]
@@ -204,8 +218,9 @@ class SConsValues(optparse.Values):
if SCons.Util.is_String(value):
value = [value]
value = self.__SConscript_settings__.get(name, []) + value
-
-
+ elif name in ('implicit_deps_changed', 'implicit_deps_unchanged'):
+ if value:
+ self.__SConscript_settings__['implicit_cache'] = True
self.__SConscript_settings__[name] = value
diff --git a/SCons/Script/SConscriptTests.py b/SCons/Script/SConscriptTests.py
index bb88dfa..e6a8be5 100644
--- a/SCons/Script/SConscriptTests.py
+++ b/SCons/Script/SConscriptTests.py
@@ -21,8 +21,6 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-import SCons.Script.SConscript
-
# all of the SConscript.py tests are in test/SConscript.py
# Local Variables:
diff --git a/SCons/Script/__init__.py b/SCons/Script/__init__.py
index dff1567..5f58d99 100644
--- a/SCons/Script/__init__.py
+++ b/SCons/Script/__init__.py
@@ -255,7 +255,7 @@ def HelpFunction(text, append=False):
if help_text is None:
if append:
s = StringIO()
- PrintHelp(s)
+ PrintHelp(s)
help_text = s.getvalue()
s.close()
else: