Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: To prevent endlessly growing lists of "remove this rpm if it happens to be installed" lists, create a `feature.rpms_remove` variant that fails if the rpm to be removed is not actually installed. Test Plan: ``` ❯ hg diff diff --git a/fbcode/antlir/antlir2/test_images/rpms/TARGETS b/fbcode/antlir/antlir2/test_images/rpms/TARGETS --- a/fbcode/antlir/antlir2/test_images/rpms/TARGETS +++ b/fbcode/antlir/antlir2/test_images/rpms/TARGETS @@ -385,3 +385,13 @@ ], flavor = "//antlir/antlir2/test_images:test-image-flavor", ) + +test_rpms( + name = "remove-will-fail", + expected = expected_t(), + features = [ + feature.rpms_remove(rpms = [ + "foo", + ]), + ], +) [email protected] in fbsource ❯ buck test fbcode//antlir/antlir2/test_images/rpms:remove-will-fail ❯ buck2 test fbcode//antlir/antlir2/test_images/rpms:remove-will-fail File changed: fbcode//antlir/antlir2/bzl/feature/defs.bzl Buck UI: https://www.internalfb.com/buck2/72d72d6b-b94d-4d2d-ae15-c45bf7da2807 Test UI: https://www.internalfb.com/intern/testinfra/testrun/4222124857434732 Network: Up: 0B Down: 0B (reSessionID-d6083da1-7614-41a5-b1f7-fe3b325809fa) ... 2023-11-01T20:08:45.422851Z TRACE plan:rpms[plan]: rpm: dnf-driver: PackageNotInstalled("foo") 2023-11-01T20:08:45.422964Z TRACE plan:rpms[plan]: rpm: dnf-driver: TransactionResolved { install: {}, remove: {} } 2023-11-01T20:08:45.450023Z ERROR plan:rpms[plan]: rpm: error=there were one or more transaction errors: ["Package to be removed 'foo' was not installed"] 2023-11-01T20:08:46.815411Z ERROR map: antlir2::cmd::map: error="isolated command failed: exit status: 255" stderr: Uncategorized( "isolated command failed: exit status: 255", ) "isolated command failed: exit status: 255" Buck UI: https://www.internalfb.com/buck2/5614de3f-3d06-4569-ba81-09fae9ec91c0 Test UI: https://www.internalfb.com/intern/testinfra/testrun/12103424007408552 Network: Up: 24MiB Down: 793KiB (reSessionID-4286c14b-d4cf-4d6d-acf8-ce0127e98feb) Jobs completed: 80796. Time elapsed: 48.5s. Cache hits: 78%. Commands: 379 (cached: 294, remote: 0, local: 85). Fallback: 6/85 for action key `(target: `fbcode//antlir/antlir2/test_images/rpms:remove-will-fail--layer (ovr_config//platform/linux:x86_64-fbcode-platform010-clang15-CUDA-projects-cuda-12-cuda-12#e4818cc9359b9595)`, id: `6`)` Caused by: Failed to build 'fbcode//antlir/antlir2/test_images/rpms:remove-will-fail--layer (ovr_config//platform/linux:x86_64-fbcode-platform010-clang15-CUDA-projects-cuda-12-cuda-12#e4818cc9359b9595)' 1 BUILDS FAILED Tests finished: Pass 0. Fail 0. Fatal 0. Skip 0. Build failure 1 NO TESTS RAN ``` Reviewed By: sergeyfd Differential Revision: D50898640 fbshipit-source-id: 739b644757d9152ba274fb8ff47c295b242df464
- Loading branch information