Skip to content

Commit

Permalink
[antlir2][rpms] rpmcow can always be used now
Browse files Browse the repository at this point in the history
Summary:
Now that the earlier diffs in this stack fix gpg behavior in antlir2, we can
enable rpmcow for all rpms and all repos!

Test Plan:
```
❯ buck2 test fbcode//antlir/antlir2/test_images/rpms/facebook/rpmcow:
Buck UI: https://www.internalfb.com/buck2/258e0bca-42ea-48de-ba2f-fa9cdd6c1523
Test UI: https://www.internalfb.com/intern/testinfra/testrun/16888498608327505
Network: Up: 299KiB  Down: 816B  (reSessionID-585494fc-8cfd-4a4f-8001-7b484216bdf0)
Jobs completed: 147. Time elapsed: 1:31.8s.
Cache hits: 0%. Commands: 28 (cached: 0, remote: 0, local: 28)
Tests finished: Pass 8. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Reviewed By: sergeyfd

Differential Revision: D50125085

fbshipit-source-id: 3a6348ebea458712293bb2311ac73eb9e0e78ea2
  • Loading branch information
vmagro authored and facebook-github-bot committed Oct 10, 2023
1 parent 53e1fcb commit 313e134
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 48 deletions.
11 changes: 0 additions & 11 deletions antlir/antlir2/bzl/dnf/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# LICENSE file in the root directory of this source tree.

load("@bazel_skylib//lib:paths.bzl", "paths")
# @oss-disable
load(
"//antlir/rpm/dnf2buck:repo.bzl",
"RepoInfo", # @unused Used as type
Expand Down Expand Up @@ -37,13 +36,6 @@ def repodata_only_local_repos(ctx: AnalysisContext, dnf_available_repos: list[Re
ctx.actions.copied_dir(dir, tree)
return dir

# Some RPMs are problematic and don't work with cow
def _disable_reflink(rpm: RpmInfo, repo: RepoInfo):
if rpm.nevra.name == "foo-not-reflinked":
return True
# @oss-disable
# @oss-enable return False

def _best_rpm_artifact(
*,
rpm_info: RpmInfo,
Expand All @@ -52,9 +44,6 @@ def _best_rpm_artifact(
if not reflink_flavor:
return rpm_info.raw_rpm
else:
if _disable_reflink(rpm_info, repo):
return rpm_info.raw_rpm

# The default behavior is to fail the build if the flavor is reflinkable
# and the rpm does not have any reflinkable artifacts. This is a safety
# mechanism to ensure we don't silently regress rpm reflink support. If
Expand Down
16 changes: 0 additions & 16 deletions antlir/antlir2/test_images/rpms/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,3 @@ image_sh_test(
layer = simple,
test = "test-history.sh",
)

test_rpms(
name = "mix-reflink-and-not",
expected = expected_t(installed = [
"foo",
"foo-not-reflinked",
]),
features = [
feature.rpms_install(rpms = [
"foo",
"foo-not-reflinked",
]),
":test-deps",
],
flavor = "//antlir/antlir2/test_images:test-image-flavor",
)
15 changes: 0 additions & 15 deletions antlir/antlir2/test_images/rpms/centos8/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,3 @@ test_rpms(
],
flavor = "//antlir/antlir2/facebook/flavor/centos8:centos8",
)

test_rpms(
name = "mix-reflink-and-not",
expected = expected_t(installed = [
"foo",
"foo-not-reflinked",
]),
features = [
feature.rpms_install(rpms = [
"foo",
"foo-not-reflinked",
] + _RPM_DEPS_OF_TEST),
],
flavor = "//antlir/antlir2/facebook/flavor/centos8:centos8",
)
6 changes: 0 additions & 6 deletions antlir/rpm/dnf2buck/repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ load(":rpm.bzl", "RpmInfo", "nevra_to_string", "package_href")
RepoInfo = provider(fields = [
"all_rpms", # All RpmInfos contained in this repo
"base_url", # Optional upstream URL that was used to populate this target
"disable_rpm_reflink", # Disable rpm reflink. WARNING: this will SUBSTANTIALLY slow down installations
"dnf_conf_json", # JSON serialized dnf.conf KV for this repo
"gpg_keys", # Optional artifact against which signatures will be checked
"id", # Repo name
Expand Down Expand Up @@ -116,7 +115,6 @@ def _impl(ctx: AnalysisContext) -> list[Provider]:
urlgen = urlgen_config,
all_rpms = rpm_infos,
proxy_config = proxy_config,
disable_rpm_reflink = ctx.attrs.disable_rpm_reflink,
dnf_conf_json = dnf_conf_json,
),
]
Expand All @@ -136,10 +134,6 @@ repo_attrs = {
doc = "base key for recently-deleted packages in manifold",
default = None,
),
"disable_rpm_reflink": attrs.bool(
doc = "Disable rpm reflink. WARNING: this will SUBSTANTIALLY slow down installations",
default = False,
),
"dnf_conf": attrs.dict(attrs.string(), attrs.string(), default = {}),
"gpg_keys": attrs.list(attrs.source(doc = "GPG keys that packages are signed with"), default = []),
"makerepo": attrs.default_only(attrs.exec_dep(default = "//antlir/rpm/dnf2buck:makerepo")),
Expand Down

0 comments on commit 313e134

Please sign in to comment.