Skip to content

Commit

Permalink
[antlir1] delete antlir1 feature definitions
Browse files Browse the repository at this point in the history
Summary:
Just return the antlir2 result directly, antlir1 is dead and there is nothing
that can read these.

Test Plan:
```
❯ buck targets fbcode//antlir/...
```

waitforsandcastle

Reviewed By: justintrudell

Differential Revision: D53449530

fbshipit-source-id: 158b43877f6807c721cb1bb400e007b130c943bc
  • Loading branch information
vmagro authored and facebook-github-bot committed Feb 6, 2024
1 parent 6cc7575 commit 2812bc6
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 1,173 deletions.
254 changes: 0 additions & 254 deletions antlir/bzl/compile_image_features.bzl

This file was deleted.

59 changes: 9 additions & 50 deletions antlir/bzl/image/feature/clone.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
# LICENSE file in the root directory of this source tree.

load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2 = "feature")
load("//antlir/bzl:build_defs.bzl", "is_buck2")
load("//antlir/bzl:image_source.bzl", "image_source")
load(
"//antlir/bzl:target_tagger.bzl",
"image_source_as_target_tagged_t",
"new_target_tagger",
"tag_target",
"target_tagger_to_feature",
)
load("//antlir/bzl:target_tagger_helper.bzl", "target_tagger_helper")
load(":clone.shape.bzl", "clone_t")

def feature_clone(src_layer, src_path, dest_path):
"""
Expand Down Expand Up @@ -58,43 +47,13 @@ If you're trying to copy the output of a regular Buck target, instead use
metadata to a deterministic state, while the state of the on-disk metadata in
`buck-out` is undefined.
"""
omit_outer_dir = src_path.endswith("/")
pre_existing_dest = dest_path.endswith("/")
if omit_outer_dir and not pre_existing_dest:
fail(
"Your `src_path` {} ends in /, which means only the contents of " +
"the directory will be cloned. Therefore, you must also add a " +
"trailing / to `dest_path` to signal that clone will write " +
"inside that pre-existing directory",
"dest_path",
)

target_tagger = new_target_tagger()

clone = clone_t(
dest = dest_path,
omit_outer_dir = omit_outer_dir,
pre_existing_dest = pre_existing_dest,
source = image_source_as_target_tagged_t(
target_tagger,
image_source(layer = src_layer, path = src_path),
),
source_layer = tag_target(target_tagger, src_layer, is_layer = True),
)

target = target_tagger_helper.extract_tagged_target(clone.source.layer)

return target_tagger_to_feature(
target_tagger,
items = struct(clone = [clone]),
antlir2_feature = antlir2.clone(
src_layer = src_layer,
src_path = src_path,
dst_path = dest_path,
# antlir1's clone always makes files owned by root:root
# antlir2 defaults to using the same user:group as the source, but
# that's not always possible
user = "root",
group = "root",
) if is_buck2() else None,
return antlir2.clone(
src_layer = src_layer,
src_path = src_path,
dst_path = dest_path,
# antlir1's clone always makes files owned by root:root
# antlir2 defaults to using the same user:group as the source, but
# that's not always possible
user = "root",
group = "root",
)
23 changes: 4 additions & 19 deletions antlir/bzl/image/feature/ensure_dirs_exist.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
# LICENSE file in the root directory of this source tree.

load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2 = "feature")
load("//antlir/bzl:build_defs.bzl", "is_buck2")
load("//antlir/bzl:shape.bzl", "shape")
load("//antlir/bzl:stat.bzl", "stat")
load("//antlir/bzl:target_tagger.bzl", "new_target_tagger", "target_tagger_to_feature")
load(":ensure_subdirs_exist.shape.bzl", "ensure_subdirs_exist_t")

def feature_ensure_dirs_exist(
path,
Expand Down Expand Up @@ -50,21 +46,10 @@ def feature_ensure_subdirs_exist(
symbolic strings. In the latter case, the passwd/group database from the host
(not from the image) is used.
"""
ensure_subdirs_exist = ensure_subdirs_exist_t(
return antlir2.ensure_subdirs_exist(
into_dir = into_dir,
subdirs_to_create = subdirs_to_create,
mode = stat.mode(mode) if mode != shape.DEFAULT_VALUE else shape.DEFAULT_VALUE,
user = user,
group = group,
)
return target_tagger_to_feature(
new_target_tagger(),
items = struct(ensure_subdirs_exist = [ensure_subdirs_exist]),
antlir2_feature = antlir2.ensure_subdirs_exist(
into_dir = into_dir,
subdirs_to_create = subdirs_to_create,
mode = mode if mode != shape.DEFAULT_VALUE else 0o755,
user = user if user != shape.DEFAULT_VALUE else "root",
group = group if group != shape.DEFAULT_VALUE else "root",
) if is_buck2() else None,
mode = mode if mode != shape.DEFAULT_VALUE else 0o755,
user = user if user != shape.DEFAULT_VALUE else "root",
group = group if group != shape.DEFAULT_VALUE else "root",
)
Loading

0 comments on commit 2812bc6

Please sign in to comment.