rez.build_system
- class rez.build_system.BuildSystem(working_dir, opts=None, package=None, write_build_scripts=False, verbose=False, build_args=[], child_build_args=[])[source]
Bases:
objectA build system, such as cmake, make, Scons etc.
- classmethod add_pre_build_commands(executor, variant, build_type, install, build_path, install_path=None)[source]
Execute pre_build_commands function if present.
- classmethod add_standard_build_actions(executor, context, variant, build_type, install, build_path, install_path=None)[source]
Perform build actions common to every build system.
- classmethod bind_cli(parser, group)[source]
Expose parameters to an argparse.ArgumentParser that are specific to this build system.
- Parameters
parser (ArgumentParser) – Arg parser.
group (ArgumentGroup) – Arg parser group - you should add args to this, NOT to parser.
- build(context, variant, build_path, install_path, install=False, build_type=<BuildType.local: 0>)[source]
Implement this method to perform the actual build.
- Parameters
context – A ResolvedContext object that the build process must be executed within.
variant (Variant) – The variant being built.
build_path – Where to write temporary build files. May be absolute or relative to working_dir.
install_path (str) – The package repository path to install the package to, if installing. If None, defaults to config.local_packages_path.
install – If True, install the build.
build_type – A BuildType (i.e local or central).
- Returns
success: Bool indicating if the build was successful.
- extra_files: List of created files of interest, not including
build targets. A good example is the interpreted context file, usually named ‘build.rxt.sh’ or similar. These files should be located under build_path. Rez may install them for debugging purposes.
- build_env_script: If this instance was created with write_build_scripts
as True, then the build should generate a script which, when run by the user, places them in the build environment.
- Return type
A dict containing the following information
- classmethod child_build_system()[source]
Returns the child build system.
Some build systems, such as cmake, don’t build the source directly. Instead, they build an interim set of build scripts that are then consumed by a second build system (such as make). You should implement this method if that’s the case.
- Returns
Name of build system (corresponding to the plugin name) if this system has a child system, or None otherwise.
- rez.build_system.create_build_system(working_dir, buildsys_type=None, package=None, opts=None, write_build_scripts=False, verbose=False, build_args=[], child_build_args=[])[source]
Return a new build system that can build the source in working_dir.
- rez.build_system.get_buildsys_types()[source]
Returns the available build system implementations - cmake, make etc.
- rez.build_system.get_valid_build_systems(working_dir, package=None)[source]
Returns the build system classes that could build the source in given dir.
- Parameters
working_dir (str) – Dir containing the package definition and potentially build files.
package (Package) – Package to be built. This may or may not be needed to determine the build system. For eg, cmake just has to look for a CMakeLists.txt file, whereas the ‘build_command’ package field must be present for the ‘custom’ build system type.
- Returns
Valid build system class types.
- Return type
List of class