Skip to content

Commit 5a84514

Browse files
yoneyfacebook-github-bot
authored andcommitted
Update fixtures to fix the compiler tests on macos
Summary: Reorder the struct fields so that `cpp.MinimizePadding` doesn't end up with a different layout due to `alignof(std::max_align_t)` varying across different platforms, such as mac-arm64 and linux-amd64. Reviewed By: praihan Differential Revision: D68926839 fbshipit-source-id: 5aa23d2da81597d53b6ecd9887fd5aa7bc6b5607
1 parent 82849ab commit 5a84514

30 files changed

+347
-347
lines changed

thrift/compiler/test/fixtures/types/out/cpp2/gen-cpp2/module_constants.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ namespace apache::thrift::fixtures::types {
1515
namespace module_constants {
1616

1717

18-
::std::string_view _fbthrift_schema_cbf7f73e50f28c81() {
18+
::std::string_view _fbthrift_schema_4543be4a92b4107e() {
1919
return "";
2020
}
21-
::folly::Range<const ::std::string_view*> _fbthrift_schema_cbf7f73e50f28c81_includes() {
21+
::folly::Range<const ::std::string_view*> _fbthrift_schema_4543be4a92b4107e_includes() {
2222
return {};
2323
}
2424

thrift/compiler/test/fixtures/types/out/cpp2/gen-cpp2/module_constants.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ namespace apache::thrift::fixtures::types {
1414
/** Glean {"file": "thrift/compiler/test/fixtures/types/src/module.thrift"} */
1515
namespace module_constants {
1616

17-
FOLLY_EXPORT ::std::string_view _fbthrift_schema_cbf7f73e50f28c81();
18-
FOLLY_EXPORT ::folly::Range<const ::std::string_view*> _fbthrift_schema_cbf7f73e50f28c81_includes();
17+
FOLLY_EXPORT ::std::string_view _fbthrift_schema_4543be4a92b4107e();
18+
FOLLY_EXPORT ::folly::Range<const ::std::string_view*> _fbthrift_schema_4543be4a92b4107e_includes();
1919

2020
} // namespace module_constants
2121
} // namespace apache::thrift::fixtures::types

thrift/compiler/test/fixtures/types/out/cpp2/gen-cpp2/module_data.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ THRIFT_DATA_MEMBER const std::array<int, 5> TStructDataStorage<::apache::thrift:
298298
THRIFT_DATA_MEMBER const std::string_view TStructDataStorage<::apache::thrift::fixtures::types::MinPaddingWithCustomType>::name = "MinPaddingWithCustomType";
299299
THRIFT_DATA_MEMBER const std::array<std::string_view, 5> TStructDataStorage<::apache::thrift::fixtures::types::MinPaddingWithCustomType>::fields_names = { {
300300
"small"sv,
301-
"big"sv,
302-
"medium"sv,
303301
"biggish"sv,
302+
"medium"sv,
303+
"big"sv,
304304
"tiny"sv,
305305
}};
306306
THRIFT_DATA_MEMBER const std::array<int16_t, 5> TStructDataStorage<::apache::thrift::fixtures::types::MinPaddingWithCustomType>::fields_ids = { {
@@ -312,16 +312,16 @@ THRIFT_DATA_MEMBER const std::array<int16_t, 5> TStructDataStorage<::apache::thr
312312
}};
313313
THRIFT_DATA_MEMBER const std::array<protocol::TType, 5> TStructDataStorage<::apache::thrift::fixtures::types::MinPaddingWithCustomType>::fields_types = { {
314314
TType::T_BYTE,
315-
TType::T_I64,
316-
TType::T_I16,
317315
TType::T_I32,
316+
TType::T_I16,
317+
TType::T_I64,
318318
TType::T_BYTE,
319319
}};
320320
THRIFT_DATA_MEMBER const std::array<std::string_view, 5> TStructDataStorage<::apache::thrift::fixtures::types::MinPaddingWithCustomType>::storage_names = { {
321321
"__fbthrift_field_small"sv,
322-
"__fbthrift_field_big"sv,
323-
"__fbthrift_field_medium"sv,
324322
"__fbthrift_field_biggish"sv,
323+
"__fbthrift_field_medium"sv,
324+
"__fbthrift_field_big"sv,
325325
"__fbthrift_field_tiny"sv,
326326
}};
327327
THRIFT_DATA_MEMBER const std::array<int, 5> TStructDataStorage<::apache::thrift::fixtures::types::MinPaddingWithCustomType>::isset_indexes = { {

thrift/compiler/test/fixtures/types/out/cpp2/gen-cpp2/module_fatal_struct.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,9 @@ class MinPaddingWithCustomType_struct_traits {
730730
class __fbthrift_members {
731731
public:
732732
using small = __fbthrift_refl_impl::reflected_no_annotations;
733-
using big = __fbthrift_refl_impl::reflected_no_annotations;
734-
using medium = __fbthrift_refl_impl::reflected_no_annotations;
735733
using biggish = __fbthrift_refl_impl::reflected_no_annotations;
734+
using medium = __fbthrift_refl_impl::reflected_no_annotations;
735+
using big = __fbthrift_refl_impl::reflected_no_annotations;
736736
using tiny = __fbthrift_refl_impl::reflected_no_annotations;
737737
};
738738

@@ -752,17 +752,17 @@ class MinPaddingWithCustomType_struct_traits {
752752
using type_class = ::apache::thrift::type_class::integral;
753753
using annotations = ::apache::thrift::reflected_annotations<__fbthrift_annotations::members::small>;
754754
};
755-
struct __fbthrift_member_big {
755+
struct __fbthrift_member_biggish {
756756
using owner = ::apache::thrift::fixtures::types::MinPaddingWithCustomType;
757-
using name = __fbthrift_strings_module::__fbthrift_hash_2a21fe6d592a19b7de898b50eb53c429608de1a66f3e9f62da19714a770553d1;
758-
using type = ::std::int64_t;
759-
using tag = ::apache::thrift::ident::big;
757+
using name = __fbthrift_strings_module::__fbthrift_hash_7af8f5c4c7c52a8a8bd7151e1a20e8003de8a0f5b4c08676355b69772b2ae1d7;
758+
using type = ::std::int32_t;
759+
using tag = ::apache::thrift::ident::biggish;
760760
static constexpr ::apache::thrift::field_id_t id = 2;
761761
static constexpr auto optional = ::apache::thrift::optionality::terse;
762-
using getter = __fbthrift_refl_impl::data_member_accessor<::apache::thrift::ident::big>;
763-
using field_ref_getter = ::apache::thrift::access_field_fn<::apache::thrift::ident::big>;
762+
using getter = __fbthrift_refl_impl::data_member_accessor<::apache::thrift::ident::biggish>;
763+
using field_ref_getter = ::apache::thrift::access_field_fn<::apache::thrift::ident::biggish>;
764764
using type_class = ::apache::thrift::type_class::integral;
765-
using annotations = ::apache::thrift::reflected_annotations<__fbthrift_annotations::members::big>;
765+
using annotations = ::apache::thrift::reflected_annotations<__fbthrift_annotations::members::biggish>;
766766
};
767767
struct __fbthrift_member_medium {
768768
using owner = ::apache::thrift::fixtures::types::MinPaddingWithCustomType;
@@ -776,17 +776,17 @@ class MinPaddingWithCustomType_struct_traits {
776776
using type_class = ::apache::thrift::type_class::integral;
777777
using annotations = ::apache::thrift::reflected_annotations<__fbthrift_annotations::members::medium>;
778778
};
779-
struct __fbthrift_member_biggish {
779+
struct __fbthrift_member_big {
780780
using owner = ::apache::thrift::fixtures::types::MinPaddingWithCustomType;
781-
using name = __fbthrift_strings_module::__fbthrift_hash_7af8f5c4c7c52a8a8bd7151e1a20e8003de8a0f5b4c08676355b69772b2ae1d7;
782-
using type = ::std::int32_t;
783-
using tag = ::apache::thrift::ident::biggish;
781+
using name = __fbthrift_strings_module::__fbthrift_hash_2a21fe6d592a19b7de898b50eb53c429608de1a66f3e9f62da19714a770553d1;
782+
using type = ::std::int64_t;
783+
using tag = ::apache::thrift::ident::big;
784784
static constexpr ::apache::thrift::field_id_t id = 4;
785785
static constexpr auto optional = ::apache::thrift::optionality::terse;
786-
using getter = __fbthrift_refl_impl::data_member_accessor<::apache::thrift::ident::biggish>;
787-
using field_ref_getter = ::apache::thrift::access_field_fn<::apache::thrift::ident::biggish>;
786+
using getter = __fbthrift_refl_impl::data_member_accessor<::apache::thrift::ident::big>;
787+
using field_ref_getter = ::apache::thrift::access_field_fn<::apache::thrift::ident::big>;
788788
using type_class = ::apache::thrift::type_class::integral;
789-
using annotations = ::apache::thrift::reflected_annotations<__fbthrift_annotations::members::biggish>;
789+
using annotations = ::apache::thrift::reflected_annotations<__fbthrift_annotations::members::big>;
790790
};
791791
struct __fbthrift_member_tiny {
792792
using owner = ::apache::thrift::fixtures::types::MinPaddingWithCustomType;
@@ -803,9 +803,9 @@ class MinPaddingWithCustomType_struct_traits {
803803

804804
struct __fbthrift_member {
805805
using small = ::apache::thrift::reflected_struct_data_member<__fbthrift_member_small>;
806-
using big = ::apache::thrift::reflected_struct_data_member<__fbthrift_member_big>;
807-
using medium = ::apache::thrift::reflected_struct_data_member<__fbthrift_member_medium>;
808806
using biggish = ::apache::thrift::reflected_struct_data_member<__fbthrift_member_biggish>;
807+
using medium = ::apache::thrift::reflected_struct_data_member<__fbthrift_member_medium>;
808+
using big = ::apache::thrift::reflected_struct_data_member<__fbthrift_member_big>;
809809
using tiny = ::apache::thrift::reflected_struct_data_member<__fbthrift_member_tiny>;
810810
};
811811
public:
@@ -814,9 +814,9 @@ class MinPaddingWithCustomType_struct_traits {
814814
using member = __fbthrift_member;
815815
using members = ::fatal::list<
816816
member::small,
817-
member::big,
818-
member::medium,
819817
member::biggish,
818+
member::medium,
819+
member::big,
820820
member::tiny
821821
>;
822822
using members_annotations = __fbthrift_annotations::members;

thrift/compiler/test/fixtures/types/out/cpp2/gen-cpp2/module_for_each_field.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ struct ForEachField<::apache::thrift::fixtures::types::MinPaddingWithCustomType>
121121
template <typename F, typename... T>
122122
void operator()([[maybe_unused]] F&& f, [[maybe_unused]] T&&... t) const {
123123
f(0, static_cast<T&&>(t).small_ref()...);
124-
f(1, static_cast<T&&>(t).big_ref()...);
124+
f(1, static_cast<T&&>(t).biggish_ref()...);
125125
f(2, static_cast<T&&>(t).medium_ref()...);
126-
f(3, static_cast<T&&>(t).biggish_ref()...);
126+
f(3, static_cast<T&&>(t).big_ref()...);
127127
f(4, static_cast<T&&>(t).tiny_ref()...);
128128
}
129129
};

thrift/compiler/test/fixtures/types/out/cpp2/gen-cpp2/module_metadata.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ StructMetadata<::apache::thrift::fixtures::types::MinPaddingWithCustomType>::gen
315315
module_MinPaddingWithCustomType.is_union() = false;
316316
static const auto* const
317317
module_MinPaddingWithCustomType_fields = new std::array<EncodedThriftField, 5>{ {
318-
{ 1, "small", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector<ThriftConstStruct>{ }}, { 2, "big", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_I64_TYPE), std::vector<ThriftConstStruct>{ }}, { 3, "medium", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_I16_TYPE), std::vector<ThriftConstStruct>{ *cvStruct("cpp.Adapter", { {"name", cvString("::my::Adapter") } }).cv_struct_ref(), }}, { 4, "biggish", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector<ThriftConstStruct>{ }}, { 5, "tiny", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector<ThriftConstStruct>{ }}, }};
318+
{ 1, "small", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector<ThriftConstStruct>{ }}, { 2, "biggish", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector<ThriftConstStruct>{ }}, { 3, "medium", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_I16_TYPE), std::vector<ThriftConstStruct>{ *cvStruct("cpp.Adapter", { {"name", cvString("::my::Adapter") } }).cv_struct_ref(), }}, { 4, "big", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_I64_TYPE), std::vector<ThriftConstStruct>{ }}, { 5, "tiny", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector<ThriftConstStruct>{ }}, }};
319319
for (const auto& f : *module_MinPaddingWithCustomType_fields) {
320320
::apache::thrift::metadata::ThriftField field;
321321
field.id() = f.id;

thrift/compiler/test/fixtures/types/out/cpp2/gen-cpp2/module_types.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ MinPaddingWithCustomType& MinPaddingWithCustomType::operator=([[maybe_unused]] M
14401440
}
14411441

14421442

1443-
MinPaddingWithCustomType::MinPaddingWithCustomType(apache::thrift::FragileConstructor, ::std::int8_t small__arg, ::std::int64_t big__arg, ::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter, 3, ::std::int16_t, MinPaddingWithCustomType> medium__arg, ::std::int32_t biggish__arg, ::std::int8_t tiny__arg) :
1443+
MinPaddingWithCustomType::MinPaddingWithCustomType(apache::thrift::FragileConstructor, ::std::int8_t small__arg, ::std::int32_t biggish__arg, ::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter, 3, ::std::int16_t, MinPaddingWithCustomType> medium__arg, ::std::int64_t big__arg, ::std::int8_t tiny__arg) :
14441444
__fbthrift_field_medium(std::move(medium__arg)),
14451445
__fbthrift_field_big(std::move(big__arg)),
14461446
__fbthrift_field_biggish(std::move(biggish__arg)),
@@ -1453,25 +1453,25 @@ MinPaddingWithCustomType::MinPaddingWithCustomType(apache::thrift::FragileConstr
14531453
void MinPaddingWithCustomType::__fbthrift_clear() {
14541454
// clear all fields
14551455
this->__fbthrift_field_small = ::std::int8_t();
1456-
this->__fbthrift_field_big = ::std::int64_t();
1457-
::apache::thrift::adapt_detail::clear<::my::Adapter, 3>(__fbthrift_field_medium, *this);
14581456
this->__fbthrift_field_biggish = ::std::int32_t();
1457+
::apache::thrift::adapt_detail::clear<::my::Adapter, 3>(__fbthrift_field_medium, *this);
1458+
this->__fbthrift_field_big = ::std::int64_t();
14591459
this->__fbthrift_field_tiny = ::std::int8_t();
14601460
}
14611461

14621462
void MinPaddingWithCustomType::__fbthrift_clear_terse_fields() {
14631463
this->__fbthrift_field_small = ::std::int8_t();
1464-
this->__fbthrift_field_big = ::std::int64_t();
1465-
::apache::thrift::adapt_detail::clear<::my::Adapter, 3>(__fbthrift_field_medium, *this);
14661464
this->__fbthrift_field_biggish = ::std::int32_t();
1465+
::apache::thrift::adapt_detail::clear<::my::Adapter, 3>(__fbthrift_field_medium, *this);
1466+
this->__fbthrift_field_big = ::std::int64_t();
14671467
this->__fbthrift_field_tiny = ::std::int8_t();
14681468
}
14691469

14701470
bool MinPaddingWithCustomType::__fbthrift_is_empty() const {
14711471
return ::apache::thrift::op::isEmpty<::apache::thrift::type::byte_t>(this->__fbthrift_field_small) &&
1472-
::apache::thrift::op::isEmpty<::apache::thrift::type::i64_t>(this->__fbthrift_field_big) &&
1473-
::apache::thrift::op::isEmpty<::apache::thrift::op::get_field_tag<MinPaddingWithCustomType, ::apache::thrift::field_id<3>>>(this->__fbthrift_field_medium) &&
14741472
::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_biggish) &&
1473+
::apache::thrift::op::isEmpty<::apache::thrift::op::get_field_tag<MinPaddingWithCustomType, ::apache::thrift::field_id<3>>>(this->__fbthrift_field_medium) &&
1474+
::apache::thrift::op::isEmpty<::apache::thrift::type::i64_t>(this->__fbthrift_field_big) &&
14751475
::apache::thrift::op::isEmpty<::apache::thrift::type::byte_t>(this->__fbthrift_field_tiny);
14761476
}
14771477

0 commit comments

Comments
 (0)