-
Notifications
You must be signed in to change notification settings - Fork 29
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
add repack-variant #214
add repack-variant #214
Conversation
|
Adjusts some things in the build system for preliminary support for an additional build target. Removes some unnecessary checks, references, and dependencies. Renames Dockerfile to build.Dockerfile and adds a common argument for future build targets to skip cleanup if desired. Signed-off-by: Patrick J.P. Culp <[email protected]>
Rebased. |
tools/buildsys/src/manifest.rs
Outdated
@@ -504,6 +504,7 @@ fn is_manifest_type(pkg_metadata: &PackageMetadata, manifest_type: BuildType) -> | |||
BuildType::Package => metadata_table.get("build-package").is_some(), | |||
BuildType::Kit => metadata_table.get("build-kit").is_some(), | |||
BuildType::Variant => metadata_table.get("build-variant").is_some(), | |||
BuildType::Repack => metadata_table.get("build-variant").is_some(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better as an error or an unreachable!
- we shouldn't be taking this graph-walk path for a repack operation, and the longer we make it work before failing, the harder it will be to diagnose the logic error that let us reach this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this function returns a bool, unreachable!
might be cleanest.
|
@@ -504,6 +504,7 @@ fn is_manifest_type(pkg_metadata: &PackageMetadata, manifest_type: BuildType) -> | |||
BuildType::Package => metadata_table.get("build-package").is_some(), | |||
BuildType::Kit => metadata_table.get("build-kit").is_some(), | |||
BuildType::Variant => metadata_table.get("build-variant").is_some(), | |||
BuildType::Repack => unreachable!("Repacking is not defined in manifests"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this. Let's just return false since that is an accurate answer to the question is_manifest_type
. A function that can panic seems out of character for us.
Edit: I have learned that this was Ben's preference so go ahead and merge it like this. I hope to make this function go away at some point with some refactoring, but we'll see...
BuildType::Repack => unreachable!("Repacking is not defined in manifests"), | |
BuildType::Repack => false, |
Add the the initial target for repackaging a Bottlerocket variant. This target will skip the traditional workflow of building packages and using `rpm2img`. Instead the build system will point to a yet to be implemented `img2img` tool. Signed-off-by: Patrick J.P. Culp <[email protected]>
Adjusted some names and ordering. |
Description of changes:
Add the the initial target for repackaging a Bottlerocket variant. This target will skip the traditional workflow of building packages and using
rpm2img
. Instead the build system will point to a yet to be implementedimg2img
tool.Includes some preliminary housekeeping. Removes some unnecessary checks, references, and dependencies. Renames
Dockerfile
tobuild.Dockerfile
and adds a common argument for future build targets to skip cleanup if desired.Testing done:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.