fab.steps#
Predefined build steps with sensible defaults.
Functions
|
Check an iterable of results for any exceptions and handle them gracefully. |
|
Called from Step.run() to process multiple items in parallel. |
|
Like run_mp, but uses imap instead of map so that we can process each result as it happens. |
|
Function decorator for steps. |
- fab.steps.step(func)#
Function decorator for steps.
- fab.steps.run_mp(config, items, func, no_multiprocessing=False)#
Called from Step.run() to process multiple items in parallel.
For example, a compile step would, in its run() method, find a list of source files in the artefact store. It could then pass those paths to this method, along with a function to compile a single file. The whole set of results are returned in a list-like, with undefined order.
- Parameters:
items – An iterable of items to process in parallel.
func – A function to process a single item. Must accept a single argument.
no_multiprocessing (
bool
) – Overrides the config’s multiprocessing flag, disabling multiprocessing for this call. (default:False
)
- fab.steps.run_mp_imap(config, items, func, result_handler)#
Like run_mp, but uses imap instead of map so that we can process each result as it happens.
This is useful for a slow operation where we want to save our progress as we go instead of waiting for everything to finish, allowing us to pick up where we left off if the program is halted.
- Parameters:
items – An iterable of items to process in parallel.
func – A function to process a single item. Must accept a single argument.
result_handler – A function to handle a single result. Must accept a single argument.
- fab.steps.check_for_errors(results, caller_label=None)#
Check an iterable of results for any exceptions and handle them gracefully.
This is a helper function for steps which use multiprocessing, getting multiple results back from
run_mp()
all in one go.- Parameters:
results – An iterable of results.
caller_label – Optional human-friendly name of the caller for logging. (default:
None
)
Modules
Fab parses each C and Fortran file into an |
|
Object archive creation from a list of object files for use in static linking. |
|
Add custom pragmas to C code which identify user and system include regions. |
|
Pruning of old files from the incremental/prebuild folder. |
|
C file compilation. |
|
Fortran file compilation. |
|
Gather files from a source folder. |
|
Build steps for pulling source code from remote repos and local folders. |
|
Link an executable. |
|
Fortran and C Preprocessing. |
|
A preprocessor and code generation step for PSyclone. |
|
A helper step to copy .inc files to the root of the build source folder, for easy include by the preprocessor. |