Skip to content

Commit

Permalink
[antlir2][package] add explicit rule for caf packages
Browse files Browse the repository at this point in the history
Summary:
This does nothing but return the layer's `subvol_symlink`, but allows us to rip
some CAF packaging hacks out of the `fbpkg.builder` implementation.

This eliminates bugs in `image_fbpkg_builder` where `default_os` configuration
was not being applied for CAF packages.

I will leave it to justintrudell to remove any hacks from the builder rule.

Test Plan:
Hope that
`fbcode//registry/builder/fbpkg/tests:test-caf-image-builder-e2e` runs on
Sandcastle because I cannot run it on my devserver

Reviewed By: epilatow

Differential Revision: D59007520

fbshipit-source-id: b65f4d4a72402a0b762c431ff9cfaf0de9a13d33
  • Loading branch information
justintrudell authored and facebook-github-bot committed Jul 2, 2024
1 parent d551a8c commit 64405ac
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions antlir/antlir2/bzl/package/caf.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

load("//antlir/antlir2/bzl:types.bzl", "LayerInfo")
load(":cfg.bzl", "layer_attrs", "package_cfg")
load(":macro.bzl", "package_macro")

CafLayerPackageInfo = provider(fields = {"subvol_symlink": Artifact})

def _impl(ctx: AnalysisContext) -> list[Provider]:
li = ctx.attrs.layer[LayerInfo]
return [
ctx.attrs.layer[DefaultInfo],
CafLayerPackageInfo(subvol_symlink = li.subvol_symlink),
]

_caf = rule(
impl = _impl,
attrs = layer_attrs,
cfg = package_cfg,
)

caf = package_macro(_caf)

0 comments on commit 64405ac

Please sign in to comment.