Skip to content

Commit 7ff17a5

Browse files
committed
Update manpage intro [skip appveyor]
Just assorted wording tweaks, only to DESCRIPTION section. Signed-off-by: Mats Wichmann <[email protected]>
1 parent c70c47f commit 7ff17a5

File tree

3 files changed

+103
-77
lines changed

3 files changed

+103
-77
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
175175
is reached.
176176
- Regularized header (copyright, licens) at top of documentation files
177177
using SPDX.
178+
- Updated introductory section of manual page.
178179

179180

180181
RELEASE 4.7.0 - Sun, 17 Mar 2024 17:22:20 -0700

RELEASE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ DOCUMENTATION
154154
- Updated manpage description of Command "builder" and function.
155155
- Updated the notes about reproducible builds with SCons and the example.
156156
- Regularized header (copyright, licens) at top of documentation files using SPDX.
157+
- Updated introductory section of manual page.
157158

158159

159160

doc/man/scons.xml

Lines changed: 101 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ This file is processed by the bin/SConsDoc.py module.
7474
<refsect1 id='description'>
7575
<title>DESCRIPTION</title>
7676
<para>
77-
&scons;
77+
&SCons; is an extensible open source build system that
7878
orchestrates the construction of software
7979
(and other tangible products such as documentation files)
8080
by determining which
@@ -105,23 +105,26 @@ The CPython project retired 3.6 in Sept 2021:
105105
<ulink url="https://peps.python.org/pep-0494"/>.
106106
</para>
107107

108-
<para>You set up an &SCons;
109-
build system by writing a script
108+
<para>
109+
You set up an &SCons; build by writing a script
110110
that describes things to build (<firstterm>targets</firstterm>), and,
111111
if necessary, the rules to build those files (<firstterm>actions</firstterm>).
112112
&SCons; comes with a collection of <firstterm>Builder</firstterm> methods
113-
which apply premade actions for building many common software components
113+
which supply premade Actions for building many common software components
114114
such as executable programs, object files and libraries,
115115
so that for many software projects,
116116
only the targets and input files (<firstterm>sources</firstterm>)
117117
need be specified in a call to a builder.
118-
&SCons; thus can operate at a level of abstraction above that of pure filenames.
119-
For example if you specify a library target named "foo",
118+
</para>
119+
120+
<para>
121+
&SCons; operates at a level of abstraction above that of pure filenames.
122+
For example if you specify a shared library target named "foo",
120123
&SCons; keeps track of the actual operating system dependent filename
121-
(such as <filename>libfoo.so</filename> on a GNU/Linux system),
122-
and how to refer to that library in later construction steps
123-
that want to use it, so you don't have to specify that precise
124-
information yourself.
124+
(such as <filename>libfoo.so</filename> on a GNU/Linux system
125+
and <filename>foo.dll</filename> on Windows)),
126+
and gives you a handle to refer to that target in other steps,
127+
so you don't have to use system-specific strings yourself.
125128
&SCons; can also scan automatically for dependency information,
126129
such as header files included by source code files
127130
(for example, <literal>#include</literal>
@@ -136,23 +139,29 @@ to support additional input file types.
136139
including a cryptographic hash of the contents of source files,
137140
is cached for later reuse.
138141
By default this hash (the <firstterm>&contentsig;</firstterm>)
139-
is used to determine if a file has changed since the last build,
140-
although this can be controlled by selecting an appropriate
142+
is used to decide if a file has changed since the last build,
143+
although other algorithms can be used by selecting an appropriate
141144
<firstterm>&f-link-Decider;</firstterm> function.
142145
Implicit dependency files are also part of out-of-date computation.
143146
The scanned implicit dependency information can optionally be
144147
cached and used to speed up future builds.
145148
A hash of each executed build action (the <firstterm>&buildsig;</firstterm>)
146-
is cached, so that changes to build instructions (changing flags, etc.)
147-
or to the build tools themselves (new version)
149+
is also cached, so that changes to build instructions (changing flags, etc.)
150+
or to the build tools themselves (e.g. a compiler upgrade)
148151
can also trigger a rebuild.
149152
</para>
150153

151154
<para>
152-
&SCons; supports the concept of separated source and build
153-
directories through the definition of
155+
&SCons; supports separated source and build
156+
directories (also called "out-of-tree builds")
157+
through the definition of
154158
<firstterm>variant directories</firstterm>
155-
(see the &f-link-VariantDir; function).
159+
Using a separated build directory helps keep
160+
the source directory clean of artifacts when doing searches,
161+
allows setting up differing builds ("variants") without conflicts,
162+
and allows resetting the build by just removing the build directory
163+
(note that SCons does have a "clean" mode as well).
164+
See the &f-link-VariantDir; description for more details.
156165
</para>
157166

158167
<para>
@@ -177,9 +186,10 @@ specified with the
177186
<link linkend="opt-f"><option>-f</option></link> option,
178187
which leaves the current directory as the project top directory.
179188
</para>
189+
180190
<para>
181191
The build configuration may be split into multiple files:
182-
the &SConstruct; file may specify additional
192+
the &SConstruct; file can specify additional
183193
configuration files by calling the
184194
&f-link-SConscript; function,
185195
and any file thus invoked may
@@ -196,23 +206,24 @@ configuration files for a project
196206
(including the &SConstruct; file),
197207
regardless of the actual file names or number of such files.
198208
A hierarchical build is not recursive - all of
199-
the SConscript files are processed in a single pass,
200-
although each is processed in a separate context so
201-
as not to interfere with one another. &SCons; provides
202-
mechanisms for information to be shared between
203-
SConscript files when needed.
209+
the SConscript files are processed in a single pass
210+
so that &scons; has a picture of the complete
211+
dependency tree at all times.
212+
Each SConscript file is processed in a separate context
213+
so settings made in one script do not leak into another;
214+
information can however be shared explicitly between scripts.
204215
</para>
205216

206217
<para>Before reading the &SConscript; files,
207218
&scons;
208-
looks for a directory named
209-
<filename>site_scons</filename>
210-
in various system directories and in the
211-
project top directory, or, if specified,
212-
the directory from the
219+
looks for a <firstterm>site directory</firstterm> -
220+
a directory named <filename>site_scons</filename>
221+
is searched for in various system directories and in the
222+
project top directory, or if the
213223
<link linkend="opt-site-dir"><option>--site-dir</option></link>
214-
option instead, and prepends the ones it
215-
finds to the &Python; module search path (<varname>sys.path</varname>),
224+
option is given, checks only for that directory.
225+
Found site directories are prepended
226+
to the &Python; module search path (<varname>sys.path</varname>),
216227
thus allowing modules in such directories to be imported in
217228
the normal &Python; way in &SConscript; files.
218229
For each found site directory,
@@ -231,28 +242,31 @@ controlling the site directories.
231242

232243
<para>
233244
&SConscript; files are written in the
234-
<firstterm>&Python;</firstterm> programming language,
235-
although it is normally not necessary to be a &Python;
236-
programmer to use &scons; effectively.
237-
&SConscript; files are invoked in a context that makes
238-
the facilities described in this manual page available
239-
in their local namespace without any special steps.
245+
<firstterm>&Python;</firstterm> programming language.
246+
For many tasks, the simple syntax can be understood from examples,
247+
so it is normally not necessary to be a &Python;
248+
programmer to use &SCons; effectively.
249+
&SConscript; files are executed in a context that makes
250+
the facilities described in this manual page directly
251+
available (that is, no need to <literal>import</literal>).
240252
Standard &Python; scripting capabilities
241-
such as flow control, data manipulation, and imported &Python; libraries
242-
are available to use to handle complicated build situations.
253+
such as flow control, data manipulation, and imported &Python; modules
254+
are available to use in more complicated build configurations.
243255
Other &Python; files can be made a part of the build system,
244256
but they do not automatically have the &SCons; context and
245257
need to import it if they need access (described later).
246258
</para>
247259

248260
<para>
249-
&scons;
250-
reads and executes all of the included &SConscript; files
261+
&SCons; reads and executes all of the included &SConscript; files
251262
<emphasis>before</emphasis>
252263
it begins building any targets.
253-
To make this clear,
254-
&scons;
255-
prints the following messages about what it is doing:</para>
264+
Progress messages show this behavior
265+
(the state change lines - those
266+
beginning with the <literal>scons:</literal> tag -
267+
may be suppressed using the
268+
<link linkend="opt-Q"><option>-Q</option></link> option):
269+
</para>
256270

257271
<screen>
258272
$ <userinput>scons foo.out</userinput>
@@ -264,43 +278,48 @@ scons: done building targets.
264278
$
265279
</screen>
266280

267-
<para>The status messages
268-
(lines beginning with the <literal>scons:</literal> tag)
269-
may be suppressed using the
270-
<link linkend="opt-Q"><option>-Q</option></link>
271-
option.</para>
272-
273281
<para>
274282
To assure reproducible builds,
275283
&SCons;
276284
uses a restricted <firstterm>execution environment</firstterm>
277285
for running external commands used to build targets,
278286
rather then propagating the full environment
279287
in effect at the time &scons; was called.
280-
This helps avoid problems like picking up accidental settings,
288+
This helps avoid problems like picking up accidental
289+
or malicious settings,
281290
temporary debug values that are no longer needed,
282291
or one developer having different settings than another
283-
(or than the CI/CD pipeline).
284-
Environment variables that are needed for proper
285-
operation of such commands need to be set explicitly,
286-
which can be done either by assigning the desired values,
287-
or by picking values individually out of environment variables
288-
using the &Python; <systemitem>os.environ</systemitem> dictionary.
289-
The execution environment for a given &consenv; is
290-
contained in its &cv-link-ENV; &consvar;.
291-
A few environment variables are picked up automatically -
292-
see <xref linkend="environment"/>).
293-
</para>
294-
295-
<para>
296-
In particular, if the compiler or other commands
297-
that you want to use to build your target files
298-
are not in standard system locations,
299-
&scons;
300-
will not find them unless
301-
you explicitly include the locations into the
302-
<varname>PATH</varname> element of the
303-
execution environment.
292+
(or than the CI pipeline).
293+
Environment variables needed for the proper
294+
operation of such commands must be set in the
295+
execution environment explicitly,
296+
either by assigning the desired values,
297+
or by picking those values individually or collectively
298+
out of environment variables exposed by the &Python;
299+
<systemitem>os.environ</systemitem> dictionary
300+
(as external program inputs they should be validate
301+
before use).
302+
The execution environment for a given &consenv;
303+
is its &cv-link-ENV; value.
304+
A small number of environment variables are picked up automatically
305+
by &scons; itself (see <xref linkend="environment"/>).
306+
</para>
307+
308+
<para>
309+
In particular, if a compiler or other external command
310+
needed to build a target file
311+
is not in &scons;' idea of a standard system location,
312+
it will not be found at runtime unless
313+
you explicitly add the location into the
314+
execution environment's <varname>PATH</varname> element.
315+
This is a particular consideration on Windows platforms,
316+
where it is common for a command to install into an app-specific
317+
location and depend on setting
318+
<varname>PATH</varname> in order for them to be found,
319+
which does not automatically work for &SCons;.
320+
</para>
321+
322+
<para>
304323
One example approach is to
305324
extract the entire <envar>PATH</envar>
306325
environment variable and set that into the
@@ -323,13 +342,13 @@ import os
323342
env = Environment(
324343
ENV={
325344
'PATH': os.environ['PATH'],
326-
'ANDROID_HOME': os.environ['ANDROID_HOME'],
327-
'ANDROID_NDK_HOME': os.environ['ANDROID_NDK_HOME'],
345+
'MODULEPATH': os.environ['MODULEPATH'],
346+
'PKG_CONFIG_PATH': os.environ['PKG_CONFIG_PATH'],
328347
}
329348
)
330349
</programlisting>
331350

332-
<para>Or you may explicitly propagate the invoking user's
351+
<para>Or you can explicitly propagate the invoking user's
333352
complete external environment:</para>
334353

335354
<programlisting language="python">
@@ -435,6 +454,7 @@ and the PharLap ETS compiler.
435454
On Windows system which identify as <emphasis>cygwin</emphasis>
436455
(that is, if &scons; is invoked from a cygwin shell),
437456
the order changes to prefer the GCC toolchain over the MSVC tools.
457+
<!-- Seems odd to still list OS/2 (though it lives in some form as ArcaOS -->
438458
On OS/2 systems,
439459
&scons;
440460
searches in order for the
@@ -447,13 +467,17 @@ searches for the native compiler tools
447467
(MIPSpro, Visual Age, aCC, and Forte tools respectively)
448468
and the GCC tool chain.
449469
On all other platforms,
450-
including POSIX (Linux and UNIX) platforms,
470+
including POSIX (Linux and UNIX) and macOS platforms,
451471
&scons;
452472
searches in order
453473
for the GCC tool chain,
454474
and the Intel compiler tools.
455-
These default values may be overridden
456-
by appropriate setting of &consvars;.</para>
475+
The defaul tool selection can be pre-empted
476+
through the use of the <parameter>tools</parameter>
477+
argument to &consenv; creation methods,
478+
explcitly calling the &f-link-Tool; loader,
479+
the through the setting of various setting of &consvars;.
480+
</para>
457481

458482
<refsect2 id='target_selection'>
459483
<title>Target Selection</title>

0 commit comments

Comments
 (0)