Skip to content

Commit

Permalink
Update Pre/PostAction Alias note [skip appveyor]
Browse files Browse the repository at this point in the history
The initial version of PR #4872 proposed to document that pre- and
post-actions on an alias have no effect if the alias has no action
itself. Subsequently, PR #4874 was merged to change this behavior so
that statement is backed out, but the other proposed doc improvements
in this area are retained.

Signed-off-by: Mats Wichmann <[email protected]>
  • Loading branch information
mwichmann committed Jan 21, 2025
1 parent e5f0cf4 commit b5a2151
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
3 changes: 1 addition & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
attribute and to explain what's being done in the example.
- Test framework reformatted using settings from pyproject.toml.
Includes code embedded in docstrings.
- Clarify that pre/post actions on an alias apply to the alias'
action, not to any targets the alias may refer to (doc).
- Clarify how pre/post actions on an alias work.

From Adam Scott:
- Changed Ninja's TEMPLATE rule pool to use `install_pool` instead of
Expand Down
3 changes: 1 addition & 2 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ DOCUMENTATION
being created from '${SOURCE.base}.out' to use a valid special
attribute and to explain what's being done in the example.

- Clarify that pre/post actions on an alias apply to the alias'
action, not to any targets the alias may refer to.
- Clarify how pre/post actions on an alias work.

DEVELOPMENT
-----------
Expand Down
32 changes: 9 additions & 23 deletions SCons/Environment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,7 @@ AddPostAction(foo, Chmod('$TARGET', "a-x"))
<para>
If a <parameter>target</parameter> is an Alias target,
<parameter>action</parameter> is associated with the
action of the alias,
not of any targets that alias may refer to.
Thus, &AddPostAction; will have no effect
if called on an alias which has no action.
action of the alias, if specified.
</para>

</summary>
Expand Down Expand Up @@ -425,10 +422,13 @@ before the action step that specifically
generates the specified target(s).
It may not always be obvious
if the process is multi-step - for example,
when building an executable program from a specified source
<filename>.c</filename>
file, &scons; will build an intermediate object file first,
and the pre-action will follow this.
if you use the &Program; builder to
construct an executable program from a
<filename>.c</filename> source file,
&scons; builds an intermediate object file first;
the pre-action is invoked after this step
and just before the link command to
generate the executable program binary.
Example:
</para>

Expand All @@ -437,17 +437,6 @@ foo = Program('foo.c')
AddPreAction(foo, 'echo "Running pre-action"')
</example_commands>

<para>
The specified pre-action is executed before
&scons;
calls the link command that actually
generates the executable program binary
<filename>foo</filename>,
but after compiling the
<filename>foo.c</filename>
file into an object file:
</para>

<screen>
$ scons -Q
gcc -o foo.o -c foo.c
Expand All @@ -459,10 +448,7 @@ gcc -o foo foo.o
<para>
If a <parameter>target</parameter> is an Alias target,
<parameter>action</parameter> is associated with the
action of the alias,
not with any targets that alias may refer to.
Thus, &AddPreAction; will have no effect
if called on an alias which has no action.
action of the alias, if specified.
</para>

</summary>
Expand Down

0 comments on commit b5a2151

Please sign in to comment.