Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce notion of "experimental" build types. #702

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion bloom/generators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ Bloom now supports different build types by inspecting the `build_type` tag in p
Templates for a build type are stored in subdirectories of the platform's templates directory named for the build type.
As an example the templates for the `ament_cmake` build type for debian packages is stored in [bloom/generators/debian/templates/ament_cmake](debian/templates/ament_cmake).

To add support for a new build type create a new templates subdirectory for it in your target platform's `templates` directory, and add any necessary supporting code to the generator for build type specific substitutions.For examples search for "Build-type specific substitutions" in [bloom/generators/debian/generator.py](debian/generator.py).
### Experimental build types

Certain new build types may be designated as experimental and are subject to changes in behavior.
When relying on an experimental build type review changelogs closely when updating bloom.

## Adding support for new build types

To add support for a new build type create a new templates subdirectory for it in your target platform's `templates` directory, and add any necessary supporting code to the generator for build type specific substitutions.
For examples search for "Build-type specific substitutions" in [bloom/generators/debian/generator.py](debian/generator.py).

New build types should be introduced first as "experimental" by adding them to the `EXPERIMENTAL_BUILD_TYPES` list constant in each supported generator.
8 changes: 8 additions & 0 deletions bloom/generators/debian/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
enable_drop_first_log_prefix(True)

TEMPLATE_EXTENSION = '.em'
EXPERIMENTAL_BUILD_TYPES = []


def __place_template_folder(group, src, dst, gbp=False):
Expand Down Expand Up @@ -161,6 +162,13 @@ def __place_template_folder(group, src, dst, gbp=False):


def place_template_files(path, build_type, gbp=False):
if build_type in EXPERIMENTAL_BUILD_TYPES:
warning("Build type {0} is marked as EXPERIMENTAL.".format(build_type))
warning("Review bloom changelogs carefully as these build types may " +
"contain be unstable or make breaking changes.")
if 'BLOOM_ALLOW_EXPERIMENTAL_BUILD_TYPES' not in os.environ:
if not maybe_continue('y', 'Continue anyways?'):
sys.exit("Aborting due to experimental build type.")
info(fmt("@!@{bf}==>@| Placing templates files in the 'debian' folder."))
debian_path = os.path.join(path, 'debian')
# Create/Clean the debian folder
Expand Down
8 changes: 8 additions & 0 deletions bloom/generators/rpm/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
enable_drop_first_log_prefix(True)

TEMPLATE_EXTENSION = '.em'
EXPERIMENTAL_BUILD_TYPES = []


def __place_template_folder(group, src, dst, gbp=False):
Expand Down Expand Up @@ -136,6 +137,13 @@ def __place_template_folder(group, src, dst, gbp=False):


def place_template_files(path, build_type, gbp=False):
if build_type in EXPERIMENTAL_BUILD_TYPES:
warning("Build type {0} is marked as EXPERIMENTAL.".format(build_type))
warning("Review bloom changelogs carefully as these build types may " +
"contain be unstable or make breaking changes.")
if 'BLOOM_ALLOW_EXPERIMENTAL_BUILD_TYPES' not in os.environ:
if not maybe_continue('y', 'Continue anyways?'):
sys.exit("Aborting due to experimental build type.")
info(fmt("@!@{bf}==>@| Placing templates files in the 'rpm' folder."))
rpm_path = os.path.join(path, 'rpm')
# Create/Clean the rpm folder
Expand Down