-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Meson build with Werror #448
Changes from all commits
f3a0ea5
8d82f7c
6c7da11
63c2231
80c5923
d204fb1
05089a9
6a29031
43248be
4562863
0d91852
620d6a6
bc6291e
9f52be1
b22e567
d0fab89
bf6b20f
f149708
fd5fb7d
85dbccf
55b98f1
61675a8
aa0c74b
2ea48b4
0dfa1e0
3472ae2
40b4cd5
23b3c9c
e1d3306
6ae24e9
dddd193
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,17 @@ project( | |
# add_project_arguments(['-fvisibility=hidden'], language: 'cpp') | ||
# endif | ||
|
||
cc = meson.get_compiler('c') | ||
add_project_arguments( | ||
cc.get_supported_arguments(['-Wno-misleading-indentation']), | ||
language : 'c' | ||
) | ||
cpp = meson.get_compiler('cpp') | ||
add_project_arguments( | ||
cpp.get_supported_arguments(['-Wno-misleading-indentation']), | ||
language : 'cpp' | ||
) | ||
|
||
nanoarrow_dep_args = [] | ||
if host_machine.system() == 'windows' and get_option('default_library') == 'shared' | ||
add_project_arguments(['-DNANOARROW_BUILD_DLL', '-DNANOARROW_EXPORT_DLL'], language: 'c') | ||
|
@@ -161,7 +172,8 @@ if get_option('tests') | |
# Similarly code coverage has a built in option users should use instead | ||
# https://mesonbuild.com/Unit-tests.html#coverage | ||
|
||
arrow_dep = dependency('arrow') | ||
# The system include suppresses compilation warnings from Arrow | ||
arrow_dep = dependency('arrow', include_type: 'system') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than chasing down the Arrow failures, I figured we can just ignore them |
||
gtest_dep = dependency('gtest_main') | ||
gmock_dep = dependency('gmock') | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,9 +98,11 @@ TEST(ArrayTest, ArrayTestAllocateChildren) { | |
ArrowArrayRelease(&array); | ||
|
||
ASSERT_EQ(ArrowArrayInitFromType(&array, NANOARROW_TYPE_STRUCT), NANOARROW_OK); | ||
#if !defined(__SANITIZE_ADDRESS__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did also explicitly add in this code that takes out blocks which are known to be flagged by the sanitizers. This is a bit of "extra credit" but I think generally safer than ignoring a broad class of potential errors. If we didn't want to use these macros I'm happy to revert. Otherwise, we could look at a suppression file instead of changes to the code: https://clang.llvm.org/docs/AddressSanitizer.html#issue-suppression There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is OK. We should really have a better system for testing out-of-memory anyway (but that is a not-today battle!) |
||
EXPECT_EQ(ArrowArrayAllocateChildren( | ||
&array, std::numeric_limits<int64_t>::max() / sizeof(void*)), | ||
ENOMEM); | ||
#endif | ||
ArrowArrayRelease(&array); | ||
|
||
ASSERT_EQ(ArrowArrayInitFromType(&array, NANOARROW_TYPE_STRUCT), NANOARROW_OK); | ||
|
@@ -2303,9 +2305,11 @@ TEST(ArrayTest, ArrayViewTestStruct) { | |
EXPECT_EQ(array_view.layout.element_size_bits[0], 1); | ||
|
||
// Expect error for out-of-memory | ||
#if !defined(__SANITIZE_ADDRESS__) | ||
EXPECT_EQ(ArrowArrayViewAllocateChildren( | ||
&array_view, std::numeric_limits<int64_t>::max() / sizeof(void*)), | ||
ENOMEM); | ||
#endif | ||
|
||
EXPECT_EQ(ArrowArrayViewAllocateChildren(&array_view, 2), NANOARROW_OK); | ||
EXPECT_EQ(array_view.n_children, 2); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning was generated by the flatcc_generated header. There are a ton of these.
Perhaps there is a way to have it fixed on generation, but for now figure fine to ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This had been fixed (#420) but we revendored flatcc and regenerated the header. I think ignoring for now is fine (although I'd like to redo the fix at some point since these errors show up when compiling Python and obscure other actual warnings!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know which version of flatcc was generated? Meson still uses flatcc as a subproject which is 0.6.1. However, the generated flatcc_generated.h file in the source tree uses some symbols that don't appear in that release.
Should set the meson subproject up to use the same version as was vendored for CMake I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so! We use a git hash right now because @bkietz found a bug/suboptimal behaviour of every flatbuffer implementation except flatcc that forced a change in flatcc. I think using the vendored version is safer but you could probably also use the git hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up changing the subproject to use the same git hash. Can relook at the design in a separate PR, but the Meson subproject approach does generally make things much simpler from a build configuration standpoint