-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: Meson Support for ADBC #1904
Conversation
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.
Left some TODOs in this file on things that were tripping me up. I don't know enough about Go to make that work, though the issue I linked to might have some workarounds.
DuckDB in theory could be wrangled well as a subproject, but the CMake <> Meson bridge is a bit wonky and the generated includes create a conflict between the adbc.h file in this repository versus the adbc.h file that DuckDB creates
c/meson.build
Outdated
gmock_dep = disabler() | ||
endif | ||
|
||
if get_option('duckdb') |
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 might be tough to get working in its current state - probably will defer to fully fixing for a later PR
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.
Can we drop support for DukcDB with Meson?
I think that we don't need to maintain this because it's just for an integration test. Users don't need this and we can do it with CMake.
c/meson.build
Outdated
subdir('integration/duckdb') | ||
endif | ||
|
||
if get_option('python') |
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 put this in for consistency with our current CMake implementation, but I think in the long run it would be easier to use meson-python and have it take care of dependencies automatically via pip install, rather than trying to toggle via a build generator option
@kou I think you're much more familiar with Meson, any thoughts? |
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 that Meson support is OK but we should keep maintenance cost as small as possible. Because our main build system is CMake. In general, maintaining multiple build systems are time consuming.
So I think that we should support only simple and needed build features for Meson. Other complex build features are implemented only with CMake.
.github/workflows/native-unix.yml
Outdated
cd c | ||
meson setup -Dpostgresql=true -Dsqlite=true -Ddriver_manager=true builddir | ||
cd builddir | ||
meson compile |
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.
How about avoiding cd
?
cd c | |
meson setup -Dpostgresql=true -Dsqlite=true -Ddriver_manager=true builddir | |
cd builddir | |
meson compile | |
meson setup -Dpostgresql=true -Dsqlite=true -Ddriver_manager=true c c/build | |
meson compile -C c/build |
.github/workflows/native-unix.yml
Outdated
cd c/builddir | ||
meson test |
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.
cd c/builddir | |
meson test | |
meson test -C c/build |
.gitignore
Outdated
c/subprojects/* | ||
!c/subprojects/*.wrap |
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.
c/subprojects/* | |
!c/subprojects/*.wrap | |
/c/subprojects/* | |
!/c/subprojects/*.wrap |
CONTRIBUTING.md
Outdated
To use Meson, start at the c directory and run: | ||
|
||
```shell | ||
$ meson setup builddir && cd builddir |
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.
$ meson setup builddir && cd builddir | |
$ meson setup build |
CONTRIBUTING.md
Outdated
the SQLite3 driver along with tests, you would run: | ||
|
||
```shell | ||
$ meson configure -Dbuildtype=debug -Dsqlite=true -Dtests=true |
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.
$ meson configure -Dbuildtype=debug -Dsqlite=true -Dtests=true | |
$ meson configure -Dbuildtype=debug -Dsqlite=true -Dtests=true build |
CONTRIBUTING.md
Outdated
from its WrapDB for you: | ||
|
||
```shell | ||
$ meson compile |
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.
$ meson compile | |
$ meson compile -C build |
CONTRIBUTING.md
Outdated
To run the test suite, simply run: | ||
|
||
```shell | ||
$ meson test |
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.
$ meson test | |
$ meson test -C build |
c/meson.build
Outdated
project( | ||
'arrow-adbc', | ||
'c', 'cpp', | ||
version: '0.6.0-SNAPSHOT', # TODO: can this be dynamic? |
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.
dev/release/rat_exclude_files.txt
Outdated
c/subprojects/fmt* | ||
c/subprojects/gtest* | ||
c/subprojects/nanoarrow* | ||
c/subprojects/sqlite3* |
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.
Can we set our license header to c/subprojects/*.wrap
instead of excluding them?
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.
These headers were generated by meson wrap install ...
- happy to add that if the fact that they are automatically generated is not important
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.
OK. Let's exclude *.wrap
. Can we narrow exclude targets as much as possible such as using fmt.wrap
instead of fmt.*
?
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.
No problem. I made these wildcards to prevent anything generated by the subprojects themselves being included, but those should never be committed anyway. Changed to the more explicit form you have suggested
c/meson.build
Outdated
gmock_dep = disabler() | ||
endif | ||
|
||
if get_option('duckdb') |
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.
Can we drop support for DukcDB with Meson?
I think that we don't need to maintain this because it's just for an integration test. Users don't need this and we can do it with CMake.
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.
+1
|
||
To use Meson, start at the c directory and run: | ||
|
||
```shell |
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.
```shell | |
```console |
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.
No problem making this change but all of the other entries in the CONTRIBUTING.md guide currently use shell
- do you want me to update all of them as part of this or leave that to a separate PR?
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.
Oh. Could you use a separate PR?
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.
Sure - will open after this goes in. For now I left this file alone, but made the updates you suggested to other files
the form ``-D_option_:_value_``. For example, to build the a debug version of | ||
the SQLite3 driver along with tests, you would run: | ||
|
||
```shell |
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.
```shell | |
```console |
Meson will try to find them on your system and fall back to downloading a copy | ||
from its WrapDB for you: | ||
|
||
```shell |
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.
```shell | |
```console |
|
||
To run the test suite, simply run: | ||
|
||
```shell |
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.
```shell | |
```console |
c/driver/postgresql/meson.build
Outdated
}, | ||
} | ||
|
||
foreach nm, conf : postgres_tests |
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.
foreach nm, conf : postgres_tests | |
foreach name, conf : postgres_tests |
c/driver/postgresql/meson.build
Outdated
|
||
foreach nm, conf : postgres_tests | ||
exc = executable( | ||
'adbc-' + nm + '-test', |
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.
'adbc-' + nm + '-test', | |
'adbc-' + name + '-test', |
c/driver/postgresql/meson.build
Outdated
], | ||
dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep, libpq_dep], | ||
) | ||
test('adbc-' + nm, exc) |
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.
test('adbc-' + nm, exc) | |
test('adbc-' + name, exc) |
c/meson.build
Outdated
'arrow-adbc', | ||
'c', 'cpp', | ||
version: '1.1.0-SNAPSHOT', | ||
license: 'Apache 2.0', |
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.
license: 'Apache 2.0', | |
license: 'Apache-2.0', |
@kou any other feedback here? |
No! |
Do we need an associated issue before we merge this? |
I attached #1941 |
This worked pretty well in nanoarrow so figured worth trying in ADBC. In the long run arrow-adbc would make for a nice addition to the Meson WrapDB - it would be an easy way to install the source for a desired set of driver(s)
In the immediate term, Meson really helps simplify the current CMake hoops you have to jump through to wrangle dependencies, and I think is easier to use
Fixes #1941.