Skip to content

Commit 76ff88d

Browse files
authored
Merge pull request #4672 from mwichmann/issue/alias-action
Manpage: note pre/post actions effect on an alias
2 parents 038dc4b + 9d9188e commit 76ff88d

File tree

3 files changed

+38
-19
lines changed

3 files changed

+38
-19
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
2626
are now more clearly distinguished (-live.py suffix and docstring).
2727
- runtest.py once again finds "external" tests, such as the tests for
2828
tools in scons-contrib. An earlier rework had broken this. Fixes #4699.
29+
- Clarify how pre/post actions on an alias work.
2930

3031

3132
RELEASE 4.9.1 - Thu, 27 Mar 2025 11:40:20 -0700
@@ -41,6 +42,7 @@ RELEASE 4.9.1 - Thu, 27 Mar 2025 11:40:20 -0700
4142
From Mats Wichmann:
4243
- Fix typos in CCFLAGS test. Didn't affect the test itself, but
4344
didn't correctly apply the DefaultEnvironment speedup.
45+
4446
- New CacheDir initialization code failed on Python 3.7 for unknown
4547
reason (worked on 3.8+). Adjusted the approach a bit. Fixes #4694.
4648
- Try to fix Windows fails on Docbook tests in case xsltproc is found.

RELEASE.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ DOCUMENTATION
5656
typo fixes, even if they're mentioned in src/CHANGES.txt to give
5757
the contributor credit)
5858

59+
- Clarify how pre/post actions on an alias work.
60+
5961
DEVELOPMENT
6062
-----------
6163

@@ -66,4 +68,5 @@ Thanks to the following contributors listed below for their contributions to thi
6668
==========================================================================================
6769
.. code-block:: text
6870

71+
6972
git shortlog --no-merges -ns 4.9.1..HEAD

SCons/Environment.xml

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ env.other_method_name('another arg')
348348
</arguments>
349349
<summary>
350350
<para>
351-
Arranges for the specified
351+
Arrange for the specified
352352
<parameter>action</parameter>
353353
to be performed
354354
after the specified
@@ -374,6 +374,12 @@ foo = Program('foo.c')
374374
AddPostAction(foo, Chmod('$TARGET', "a-x"))
375375
</example_commands>
376376

377+
<para>
378+
If a <parameter>target</parameter> is an &f-Alias;,
379+
<parameter>action</parameter> is associated with the
380+
action of the alias, if specified.
381+
</para>
382+
377383
</summary>
378384
</scons_function>
379385

@@ -383,7 +389,7 @@ AddPostAction(foo, Chmod('$TARGET', "a-x"))
383389
</arguments>
384390
<summary>
385391
<para>
386-
Arranges for the specified
392+
Arrange for the specified
387393
<parameter>action</parameter>
388394
to be performed
389395
before the specified
@@ -406,31 +412,39 @@ one or more targets in the list.
406412
<para>
407413
Note that if any of the targets are built in multiple steps,
408414
the action will be invoked just
409-
before the "final" action that specifically
415+
before the action step that specifically
410416
generates the specified target(s).
411-
For example, when building an executable program
412-
from a specified source
413-
<filename>.c</filename>
414-
file via an intermediate object file:
417+
It may not always be obvious
418+
if the process is multi-step - for example,
419+
if you use the &Program; builder to
420+
construct an executable program from a
421+
<filename>.c</filename> source file,
422+
&scons; builds an intermediate object file first;
423+
the pre-action is invoked after this step
424+
and just before the link command to
425+
generate the executable program binary.
426+
Example:
415427
</para>
416428

417429
<example_commands>
418430
foo = Program('foo.c')
419-
AddPreAction(foo, 'pre_action')
431+
AddPreAction(foo, 'echo "Running pre-action"')
420432
</example_commands>
421433

434+
<screen>
435+
$ scons -Q
436+
gcc -o foo.o -c foo.c
437+
echo "Running pre-action"
438+
Running pre-action
439+
gcc -o foo foo.o
440+
</screen>
441+
422442
<para>
423-
The specified
424-
<literal>pre_action</literal>
425-
would be executed before
426-
&scons;
427-
calls the link command that actually
428-
generates the executable program binary
429-
<filename>foo</filename>,
430-
not before compiling the
431-
<filename>foo.c</filename>
432-
file into an object file.
443+
If a <parameter>target</parameter> is an &f-Alias;,
444+
<parameter>action</parameter> is associated with the
445+
action of the alias, if specified.
433446
</para>
447+
434448
</summary>
435449
</scons_function>
436450

@@ -440,7 +454,7 @@ file into an object file.
440454
</arguments>
441455
<summary>
442456
<para>
443-
Creates an <firstterm>alias</firstterm> target that
457+
Create an <firstterm>Alias</firstterm> node that
444458
can be used as a reference to zero or more other targets,
445459
specified by the optional <parameter>source</parameter> parameter.
446460
Aliases provide a way to give a shorter or more descriptive

0 commit comments

Comments
 (0)