Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlir][rpm.builder] Disable rpm stripping for debuginfo/stripped rp…
…m subtragets Summary: rpmbuild implicitly strips, so let's disable it for: - stripped RPM as it would be redundant - debuginfo RPM as we don't want to strip debuginfo files. Packman does something similar https://www.internalfb.com/code/fbsource/[c4111eae6a5a12e517bff5e6e4b827a8fd7f8dfa]/fbcode/oscore/lib/packman/build/rpmbuild.py?lines=245-248 Test Plan: ```name="Before, double strip error",counterexample [[email protected] /data/users/naveedgol/fbsource/fbcode (bd049959b)]$ buck2 run fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base -- --no-publish Error: Failed to build rpm Caused by: failed to run command env -i PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" TERM="xterm-256color" USER="root" container="antlir2" "/bin/rpmbuild" "-bb" "--target" "aarch64" "--define" "_rpmdir /__antlir2__/out" "--define" "_topdir /tmp/rpmbuild/top" "--define" "_tmppath /tmp/rpmbuild/tmp" "/tmp/rpmspec" (ExitStatus(unix_wait_status(256))): Building target platforms: aarch64 Building for target aarch64 Executing(%install): /bin/sh -e /tmp/rpmbuild/tmp/rpm-tmp.wHHysc RPM build errors: warning: Could not canonicalize hostname: antlir2 + umask 022 + cd /tmp/rpmbuild/top/BUILD + '[' /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-20240625-081814.aarch64 '!=' / ']' + rm -rf /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-20240625-081814.aarch64 ++ dirname /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-20240625-081814.aarch64 + mkdir -p /tmp/rpmbuild/top/BUILDROOT + mkdir /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-20240625-081814.aarch64 + cp -rp /__antlir2__/root/cpp_bin /__antlir2__/root/py_bin /__antlir2__/root/usr /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-20240625-081814.aarch64/ + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip /usr/bin/strip /usr/bin/strip: Unable to recognise the format of the input file `/tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-20240625-081814.aarch64/cpp_bin' error: Bad exit status from /tmp/rpmbuild/tmp/rpm-tmp.wHHysc (%install) Could not canonicalize hostname: antlir2 Bad exit status from /tmp/rpmbuild/tmp/rpm-tmp.wHHysc (%install) ``` ```name="Before, stripping debuginfo files error",counterexample [[email protected] /data/users/naveedgol/fbsource/fbcode (bd049959b)]$ buck2 run fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base -- --no-publish Error: Failed to build rpm Action failed: fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base--rpm-debuginfo (antlir2_package) Local command returned non-zero exit code 1 Reproduce locally: `env -- 'BUCK_SCRATCH_PATH=buck-out/v2/tmp/fbcode/1ccf2cb8bbccdd32/antlir2_package' buck-out/v2/gen/f ...<omitted>... /__fb-rpm-builder-test.base--rpm-debuginfo__/fb-rpm-builder-test.base--rpm-debuginfo.rpm' --rootless (run `buck2 log what-failed` to get the full command)` stdout: stderr: Error: Failed to build rpm Caused by: failed to run command env -i PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" TERM="xterm-256color" USER="root" container="antlir2" "/bin/rpmbuild" "-bb" "--target" "aarch64" "--define" "_rpmdir /__antlir2__/out" "--define" "_topdir /tmp/rpmbuild/top" "--define" "_tmppath /tmp/rpmbuild/tmp" "/tmp/rpmspec" (ExitStatus(unix_wait_status(256))): Building target platforms: aarch64 Building for target aarch64 Executing(%install): /bin/sh -e /tmp/rpmbuild/tmp/rpm-tmp.CZDbhR RPM build errors: warning: Could not canonicalize hostname: antlir2 + umask 022 + cd /tmp/rpmbuild/top/BUILD + '[' /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-debuginfo-20240625-081814.aarch64 '!=' / ']' + rm -rf /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-debuginfo-20240625-081814.aarch64 ++ dirname /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-debuginfo-20240625-081814.aarch64 + mkdir -p /tmp/rpmbuild/top/BUILDROOT + mkdir /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-debuginfo-20240625-081814.aarch64 + cp -rp /__antlir2__/root/debug /tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-debuginfo-20240625-081814.aarch64/ + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip /usr/bin/strip /usr/bin/strip: Unable to recognise the format of the input file `/tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-debuginfo-20240625-081814.aarch64/debug/.build-id/b3/1f1a0641e3d4b9273184057c9c140d977ec80f.debug.dwp' /usr/bin/strip: Unable to recognise the format of the input file `/tmp/rpmbuild/top/BUILDROOT/fb-rpm-builder-test.base-debuginfo-20240625-081814.aarch64/debug/.build-id/b3/1f1a0641e3d4b9273184057c9c140d977ec80f.debug' error: Bad exit status from /tmp/rpmbuild/tmp/rpm-tmp.CZDbhR (%install) Could not canonicalize hostname: antlir2 Bad exit status from /tmp/rpmbuild/tmp/rpm-tmp.CZDbhR (%install) ``` ``` [[email protected] /data/users/naveedgol/fbsource/fbcode (18fa6d67e)]$ buck2 run fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base -- --no-publish Buck UI: https://www.internalfb.com/buck2/9458e424-fbd9-44e9-bf8e-906f04279833 Network: Up: 0B Down: 0B Jobs completed: 377258. Time elapsed: 39.9s. BUILD SUCCEEDED 2024-06-25T08:47:15.974194675-07:00 INFO registry_build_utils::build_utils: Using repo found at cwd: /data/users/naveedgol/fbsource Buck UI: https://www.internalfb.com/buck2/8692ea93-fdde-4c9b-a527-7cf7af80800c Network: Up: 395KiB Down: 1.2KiB (reSessionID-6a29f659-3e89-4757-bffc-f966d2741b0f) Jobs completed: 221993. Time elapsed: 33.0s. Cache hits: 8%. Commands: 25 (cached: 2, remote: 0, local: 23) BUILD SUCCEEDED Buck UI: https://www.internalfb.com/buck2/69ed4b7f-9fdf-4c46-8ec9-3aac9afc2c9a Network: Up: 394KiB Down: 1.2KiB (reSessionID-24fdb06b-6b0a-4a39-adf4-fdbbe378469c) Jobs completed: 239177. Time elapsed: 31.3s. Cache hits: 8%. Commands: 25 (cached: 2, remote: 0, local: 23) BUILD SUCCEEDED { "aarch64": { "primary": "/data/users/naveedgol/fbsource/buck-out/v2/gen/fbcode/fce66e7cd0c18d42/registry/builder/rpm/tests/__fb-rpm-builder-test.base--rpm-stripped__/fb-rpm-builder-test.base--rpm-stripped.rpm", "debug": "/data/users/naveedgol/fbsource/buck-out/v2/gen/fbcode/fce66e7cd0c18d42/registry/builder/rpm/tests/__fb-rpm-builder-test.base--rpm-debuginfo__/fb-rpm-builder-test.base--rpm-debuginfo.rpm" }, "x86_64": { "primary": "/data/users/naveedgol/fbsource/buck-out/v2/gen/fbcode/4fe0497eaed377d7/registry/builder/rpm/tests/__fb-rpm-builder-test.base--rpm-stripped__/fb-rpm-builder-test.base--rpm-stripped.rpm", "debug": "/data/users/naveedgol/fbsource/buck-out/v2/gen/fbcode/4fe0497eaed377d7/registry/builder/rpm/tests/__fb-rpm-builder-test.base--rpm-debuginfo__/fb-rpm-builder-test.base--rpm-debuginfo.rpm" } } ``` Reviewed By: vmagro Differential Revision: D59009302 fbshipit-source-id: 2685685c92ceffaa9127582efd54446a73e581c0
- Loading branch information