@@ -3281,64 +3281,6 @@ bar_obj_list = env.StaticObject('bar.c', CPPDEFINES='-DBAR')
32813281print("The path to bar_obj is:", str(bar_obj_list[0]))
32823282</programlisting >
32833283
3284- <para >Note that because the Builder call returns a
3285- <classname >NodeList</classname >,
3286- you have to access the first element in the list
3287- (<literal >bar_obj_list[0]</literal > in the example)
3288- to get at the Node that actually represents
3289- the object file.</para >
3290-
3291- <para >
3292- When trying to handle errors that may occur in a builder method,
3293- consider that the corresponding Action is executed at a different
3294- time than the &SConscript; file statement calling the builder.
3295- It is not useful to wrap a builder call in a
3296- <systemitem >try</systemitem > block,
3297- since success in the builder call is not the same as
3298- the builder itself succeeding.
3299- If necessary, a Builder's Action should be coded to exit with
3300- a useful exception message indicating the problem in the &SConscript; files -
3301- programmatically recovering from build errors is rarely useful.
3302- </para >
3303-
3304- <para >
3305- The following builder methods are predefined in the
3306- &SCons; core software distribution.
3307- Depending on the setup of a particular
3308- &consenv; and on the type and software
3309- installation status of the underlying system,
3310- not all builders may be available in that
3311- &consenv; .
3312- Since the function calling signature is the same for all builders:
3313- </para >
3314- <programlisting language =" python" >
3315- <function >Buildername</function >(<parameter >target, source, [key=val, ...]</parameter >)
3316- </programlisting >
3317- <para >
3318- it is omitted in this listing for brevity.
3319- </para >
3320-
3321- <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3322- <!-- '\" BEGIN GENERATED BUILDER DESCRIPTIONS -->
3323-
3324- <!-- '\" The descriptions below of the various SCons Builders are generated -->
3325- <!-- '\" from the .xml files located together with the various Python -->
3326- <!-- '\" builder modules in the build engine directory -->
3327-
3328- <!-- '\" BEGIN GENERATED BUILDER DESCRIPTIONS -->
3329- <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3330- <xsi : include xmlns : xsi =" http://www.w3.org/2001/XInclude" href =" ../generated/builders.gen" />
3331- <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3332- <!-- '\" END GENERATED BUILDER DESCRIPTIONS -->
3333-
3334- <!-- '\" The descriptions abocve of the various SCons Builders are generated -->
3335- <!-- '\" from the .xml files located together with the various Python -->
3336- <!-- '\" builder modules in the build engine directory -->
3337-
3338- <!-- '\" END GENERATED BUILDER DESCRIPTIONS -->
3339- <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3340-
3341-
33423284<para >All
33433285targets of builder methods automatically depend on their sources.
33443286An explicit dependency can
@@ -3387,13 +3329,58 @@ and using the
33873329<classname >SourceFileScanner</classname >
33883330object.</para >
33893331
3332+
3333+ <para >Note that because the Builder call returns a
3334+ <classname >NodeList</classname >,
3335+ you have to access the first element in the list
3336+ (<literal >bar_obj_list[0]</literal > in the example)
3337+ to get at the Node that actually represents
3338+ the object file.</para >
3339+
3340+ <para >
3341+ The following builder methods are predefined in the
3342+ &SCons; core software distribution.
3343+ Depending on the setup of a particular
3344+ &consenv; and on the type and software
3345+ installation status of the underlying system,
3346+ not all builders may be available in that
3347+ &consenv; .
3348+ Since the function calling signature is the same for all builders:
3349+ </para >
3350+ <programlisting language =" python" >
3351+ <function >Buildername</function >(<parameter >target, source, [key=val, ...]</parameter >)
3352+ </programlisting >
3353+ <para >
3354+ it is omitted in this listing for brevity.
3355+ </para >
3356+
3357+ <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3358+ <!-- '\" BEGIN GENERATED BUILDER DESCRIPTIONS -->
3359+
3360+ <!-- '\" The descriptions below of the various SCons Builders are generated -->
3361+ <!-- '\" from the .xml files located together with the various Python -->
3362+ <!-- '\" builder modules in the build engine directory -->
3363+
3364+ <!-- '\" BEGIN GENERATED BUILDER DESCRIPTIONS -->
3365+ <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3366+ <xsi : include xmlns : xsi =" http://www.w3.org/2001/XInclude" href =" ../generated/builders.gen" />
3367+ <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3368+ <!-- '\" END GENERATED BUILDER DESCRIPTIONS -->
3369+
3370+ <!-- '\" The descriptions abocve of the various SCons Builders are generated -->
3371+ <!-- '\" from the .xml files located together with the various Python -->
3372+ <!-- '\" builder modules in the build engine directory -->
3373+
3374+ <!-- '\" END GENERATED BUILDER DESCRIPTIONS -->
3375+ <!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
3376+
33903377</refsect2 >
33913378
33923379<refsect2 id =' env_methods' >
33933380<title >&SCons; Functions and Environment Methods</title >
33943381
33953382<para >
3396- &SCons; provides a variety of &consenv; methods
3383+ &SCons; provides a variety of &consenv; methods
33973384and global functions to manipulate the build configuration.
33983385Often, a &consenv; method and a global function with
33993386the same name exist for convenience.
@@ -6484,6 +6471,21 @@ and
64846471<link linkend =' emitter_function' >emitter functions</link >.
64856472</para >
64866473
6474+ <para >
6475+ When debugging errors in a custom builder method,
6476+ remember that the builder's Action is executed asynchronously -
6477+ the builder call in the &SConscript; only instructs
6478+ &SCons; what you want built, while the actual building is
6479+ scheduled later (if necessary) by the taskmaster.
6480+ As a result, wrapping a builder call in a
6481+ <systemitem >try</systemitem > block is not useful,
6482+ as success in the builder call is not the same as
6483+ the build itself succeeding.
6484+ If necessary, code a builder's Action to exit with
6485+ a useful error message indicating the problem in the &SConscript; file.
6486+ Attempting programmatic recovery from build errors is rarely useful.
6487+ </para >
6488+
64876489</refsect2 >
64886490
64896491<refsect2 id =' action_objects' >
0 commit comments