Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlir2][package] fix cross-arch rpmbuild
Summary: Despite the fact that everything has already been compiled and we're just stuffing blobs into an rpm, `rpmbuild` still whines if it doesn't think it's able to cross-compile. Test Plan: ```name="Before",counterexample [[email protected] /data/sandcastle/boxes/fbsource (c4111eae6|remote/fbcode/warm_fbcode_od_stable...)]$ buck build -c fbcode.arch=aarch64 fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base--rpm Action failed: fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base--rpm (antlir2_package) Local command returned non-zero exit code 1 Reproduce locally: `env -- 'BUCK_SCRATCH_PATH=buck-out/v2/tmp/fbcode/8f66c3b3af22cefb/antlir2_package' buck-out/v2/gen/f ...<omitted>... ry/builder/rpm/tests/__fb-rpm-builder-test.base--rpm__/fb-rpm-builder-test.base--rpm.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" "--define" "_rpmdir /__antlir2__/out" "--define" "_topdir /tmp/rpmbuild/top" "--define" "_tmppath /tmp/rpmbuild/tmp" "/tmp/rpmspec" (ExitStatus(unix_wait_status(256))): error: No compatible architectures found for build Buck UI: https://www.internalfb.com/buck2/695cbb1c-6289-45c9-9b56-80a638de4481 Note: Using experimental modern dice Network: Up: 102KiB Down: 160MiB (reSessionID-324d094b-c7f9-4987-b3da-949edea03713) Jobs completed: 152830. Time elapsed: 56.6s. Cache hits: 95%. Commands: 1062 (cached: 1012, remote: 12, local: 38) BUILD FAILED Failed to build 'fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base--rpm (cfg:linux-arm64-fbcode-platform010-aarch64-asan-ubsan-dev#763c402bb95e0627)' ``` ``` [[email protected] /data/sandcastle/boxes/fbsource (c4111eae6|remote/fbcode/warm_fbcode_od_stable...)]$ buck build -c fbcode.arch=aarch64 fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base--rpm --show-output Buck UI: https://www.internalfb.com/buck2/8300ba3b-0e9a-4c92-9d44-820a0f173b62 Note: Using experimental modern dice Network: Up: 5.8KiB Down: 122MiB (reSessionID-5cef6928-9a6f-4d80-83d9-2f46ed2df1e3) Jobs completed: 7. Time elapsed: 5.0s. Cache hits: 0%. Commands: 2 (cached: 0, remote: 0, local: 2) BUILD SUCCEEDED fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base--rpm buck-out/v2/gen/fbcode/763c402bb95e0627/registry/builder/rpm/tests/__fb-rpm-builder-test.base--rpm__/fb-rpm-builder-test.base--rpm.rpm [[email protected] /data/sandcastle/boxes/fbsource (27de4e028)]$ rpm -qpi buck-out/v2/gen/fbcode/763c402bb95e0627/registry/builder/rpm/tests/__fb-rpm-builder-test.base--rpm__/fb-rpm-builder-test.base--rpm.rpm Name : fb-rpm-builder-test.base Epoch : 0 Version : 20240625 Release : 073408 Architecture: aarch64 Install Date: (not installed) Group : Unspecified Size : 286 License : Proprietary Signature : (none) Source RPM : fb-rpm-builder-test.base-20240625-073408.src.rpm Build Date : Tue 25 Jun 2024 07:34:08 AM PDT Build Host : antlir2 Packager : registry Summary : For testing RPM builder Description : Built using rpm.builder for fbcode//registry/builder/rpm/tests:fb-rpm-builder-test.base ``` Reviewed By: naveedgol Differential Revision: D59005434 fbshipit-source-id: fff9ceac6782bada64d83bbb8a4c1872af48f515
- Loading branch information