0.15 (2023-02-12)¶
Introduce extension support for event listeners¶
Support has been added for extensions to listen on various events generated by releng-tool. Extensions can react to certain events to either manipulate build content at certain stages or even manipulate the script environment. Consider the following example which injects a custom function into the script environment:
def releng_setup(app):
app.connect('post-build-started', on_postbuild)
def on_postbuild(env):
env['my_function'] = my_function
def my_function():
return 42
With this extension loaded in for a project, the function my_function
can
now be used in a project’s post-build script (e.g. releng-post-build
).
The following outlines the list of all newly added event types:
config-loaded
– Triggered after a configuration is processedpost-build-started
– Triggered before a post-build event startspost-build-finished
– Triggered after a post-build event ends
For more information on implementing support to listen for events or creating extensions in general, see the API implementation found in this tool’s repository (releng_tool/api/init.py).
Support setting software build of materials format in project configuration¶
Developers can now specify a target software build of materials (SBOM) format in a project’s configuration file. For example, to produce a JSON formatted SBOM file over a default text file, the following can be used:
sbom_format = 'json'
This should allow developers to provide specific SBOM formatted documents for
their builds without needing to supply --sbom-format
in their terminal or
an external build script.
Directory configuration for package patching¶
When a package includes patches to apply after extraction, the target directory
where patches were applied could vary if a project utilized the
LIBFOO_BUILD_SUBDIR
option. This made the use of patches difficult for users
who had patches designed for the extracted-root of a package, and not
necessarily the root of build scripts for a package.
This release ensures that users can apply patches directly at the root of
packages by no longer considering the configuration LIBFOO_BUILD_SUBDIR
.
Users who need to utilize patching in a subdirectory of a package can now
use the LIBFOO_PATCH_SUBDIR
option.
Make projects provided prefix in installation stage¶
Project supporting an installation stage will typically handle a destination
directory option (e.g. DESTDIR
) and a prefix option (PREFIX
; if
applicable). While various project types are configured/provided these
appropriate options, make
-based projects were never implicitly provided a
hint to the configured prefix. Packages which wanted to share the configured
prefix for a build needed to explicitly forward the prefix option via a
project’s package definition.
This release changes this by always provided the PREFIX
option when a
Make-based project’s installation stage occurs.
Fixed issue where reconfiguration/rebuild flags may not be set¶
Projects may define various build conditionals whether the system is a fresh
build or a rebuild. releng-tool provides a series of flags to help projects
understand the running state: RELENG_REBUILD
, RELENG_RECONFIGURE
and
RELENG_REINSTALL
. Unfortunately, previous releases were somewhat inconsistent
to when these flags were enabled. While, for example, a package rebuild
would result in the RELENG_REBUILD
flag to be set, the RELENG_REINSTALL
option may not be set in this case. Developers may have expected the
reinstallation flag be set in this example since the re-build without the
-only
postfix would automatically process trailing stages.
Changes have been made in this most recent version to ensure appropriate flags
are set. Specifically, a <pkg>-reconfigure
request will now ensure
RELENG_REBUILD
and RELENG_REINSTALL
are set. Also, a <pkg>-rebuild
request will now ensure RELENG_REINSTALL
is set.