From b515b645bbae93e2d87d60a4e24cfef5f933b186 Mon Sep 17 00:00:00 2001 From: Adam Singer Date: Sat, 24 Aug 2024 00:42:35 -0700 Subject: [PATCH] Fix recent bugs with shim/third-party Summary: Observed builds at [TraceMachina/buck2](https://github.com/TraceMachina/buck2/actions/workflows/build-and-test.yml) recently broke due to inconsistencies with shim/third-party directory. `reindeer buckify` will not delete existing `Cargo.lock` and `BUCK` if they already exist. `reindeer update` might assume that `reindeer buckify` was done first. A simple and consistent way is to ensure those files are deleted before calling `reindeer` instead of assuming how `reindeer` will behave. [serde-rs](https://github.com/serde-rs/json/blob/5ebf65cc480f90714c94f82099ca9161d80cbb10/build.rs#L11) recently introduced a rustc configuration flag that has to be set.`fast_arithmetic` chooses the architecture based on `target_arch`, repeat the same in the fixup scripts. `zstd` is missing header files, most likely not caught due to stale `Cargo.lock` and `BUCK` files. X-link: https://github.com/facebook/buck2/pull/751 Reviewed By: JakobDegen Differential Revision: D61753931 Pulled By: dtolnay fbshipit-source-id: 2432083b700149a24cdd9b3954d250a147403954 --- shim/third-party/rust/fixups/serde_json/fixups.toml | 3 ++- shim/third-party/rust/fixups/zstd-sys/fixups.toml | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/shim/third-party/rust/fixups/serde_json/fixups.toml b/shim/third-party/rust/fixups/serde_json/fixups.toml index db40d72cb2..5e026f75e0 100644 --- a/shim/third-party/rust/fixups/serde_json/fixups.toml +++ b/shim/third-party/rust/fixups/serde_json/fixups.toml @@ -1 +1,2 @@ -buildscript = [] +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/zstd-sys/fixups.toml b/shim/third-party/rust/fixups/zstd-sys/fixups.toml index 164b6a7237..2e2d704263 100644 --- a/shim/third-party/rust/fixups/zstd-sys/fixups.toml +++ b/shim/third-party/rust/fixups/zstd-sys/fixups.toml @@ -21,6 +21,8 @@ srcs = [ headers = [ "zdict.h", "zstd.h", + "zstd/lib/common/allocations.h", + "zstd/lib/common/bits.h", "zstd/lib/common/bitstream.h", "zstd/lib/common/compiler.h", "zstd/lib/common/cpu.h", @@ -32,7 +34,7 @@ headers = [ "zstd/lib/common/pool.h", "zstd/lib/common/portability_macros.h", "zstd/lib/common/threading.h", - #"zstd/lib/common/xxhash.h", + "zstd/lib/common/xxhash.h", "zstd/lib/common/zstd_deps.h", "zstd/lib/common/zstd_internal.h", "zstd/lib/common/zstd_trace.h", @@ -78,6 +80,8 @@ srcs = [ headers = [ "zdict.h", "zstd.h", + "zstd/lib/common/allocations.h", + "zstd/lib/common/bits.h", "zstd/lib/common/bitstream.h", "zstd/lib/common/compiler.h", "zstd/lib/common/cpu.h", @@ -89,7 +93,7 @@ headers = [ "zstd/lib/common/pool.h", "zstd/lib/common/portability_macros.h", "zstd/lib/common/threading.h", - #"zstd/lib/common/xxhash.h", + "zstd/lib/common/xxhash.h", "zstd/lib/common/zstd_deps.h", "zstd/lib/common/zstd_internal.h", "zstd/lib/common/zstd_trace.h",