You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2024/06/25 23:22:18 UTC

(arrow-adbc) branch main updated: feat: Meson Support for ADBC (#1904)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 453a9c305 feat: Meson Support for ADBC (#1904)
453a9c305 is described below

commit 453a9c305a4d7c4927792a1c587e740d09d721f9
Author: William Ayd <wi...@icloud.com>
AuthorDate: Tue Jun 25 19:22:14 2024 -0400

    feat: Meson Support for ADBC (#1904)
    
    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.
---
 .github/workflows/native-unix.yml                  | 29 ++++++++
 .gitignore                                         |  4 ++
 CONTRIBUTING.md                                    | 37 +++++++++++
 c/driver/common/meson.build                        | 36 ++++++++++
 c/driver/flightsql/meson.build                     | 65 ++++++++++++++++++
 c/driver/framework/meson.build                     | 29 ++++++++
 .../postgresql/copy/postgres_copy_writer_test.cc   |  5 +-
 c/driver/postgresql/meson.build                    | 68 +++++++++++++++++++
 c/driver/postgresql/postgresql_test.cc             |  5 +-
 c/driver/snowflake/meson.build                     | 64 ++++++++++++++++++
 c/driver/sqlite/meson.build                        | 51 ++++++++++++++
 c/driver_manager/meson.build                       | 24 +++++++
 c/meson.build                                      | 77 ++++++++++++++++++++++
 c/meson.options                                    | 49 ++++++++++++++
 c/subprojects/fmt.wrap                             | 13 ++++
 c/subprojects/gtest.wrap                           | 16 +++++
 c/subprojects/nanoarrow.wrap                       | 10 +++
 c/subprojects/sqlite3.wrap                         | 13 ++++
 c/validation/meson.build                           | 39 +++++++++++
 dev/release/rat_exclude_files.txt                  |  4 ++
 dev/release/utils-prepare.sh                       |  4 ++
 21 files changed, 636 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/native-unix.yml b/.github/workflows/native-unix.yml
index 144ea9cfc..824f247b9 100644
--- a/.github/workflows/native-unix.yml
+++ b/.github/workflows/native-unix.yml
@@ -206,6 +206,35 @@ jobs:
         run: |
           ./ci/scripts/cpp_test.sh "$(pwd)/build"
 
+  drivers-test-meson:
+    name: "Meson - C/C++ (Conda/${{ matrix.os }})"
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: ["ubuntu-latest"]
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          persist-credentials: false
+      - name: Install Dependencies
+        run: |
+          sudo apt update
+          sudo apt install -y libpq-dev ninja-build
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.x'
+      - name: Install Meson via Python
+        run: pip install meson
+      - name: Build
+        run: |
+          meson setup -Dpostgresql=true -Dsqlite=true -Ddriver_manager=true c c/build
+          meson compile -C c/build
+      - name: Test
+        run: |
+          meson test -C c/build
+
   clang-tidy-conda:
     name: "clang-tidy"
     runs-on: ubuntu-latest
diff --git a/.gitignore b/.gitignore
index 0c70d830d..235d9a0a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -121,3 +121,7 @@ target/
 /ci/linux-packages/yum/merged/
 /ci/linux-packages/yum/repositories/
 /ci/linux-packages/yum/tmp/
+
+# Meson subproject support
+/c/subprojects/*
+!/c/subprojects/*.wrap
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7acb111a9..b3749985f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -148,6 +148,43 @@ for details.
 [cmake-prefix-path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
 [gtest]: https://github.com/google/googletest/
 
+### C/C++ with Meson
+
+While CMake is the officially supported build generator, there is limited,
+experimental support for the Meson build system. Meson offers arguably better
+dependency management than CMake, with a syntax that Python developers may
+find more readable.
+
+To use Meson, start at the c directory and run:
+
+```shell
+$ meson setup build
+```
+
+For a full list of options, ``meson configure`` will bring up a pager
+with sections that you can navigate. The "Project Options" section in particular
+will show you what ADBC has to offer, and each option can be provided using
+the form ``-D_option_:_value_``. For example, to build the a debug version of
+the SQLite3 driver along with tests, you would run:
+
+```shell
+$ meson configure -Dbuildtype=debug -Dsqlite=true -Dtests=true build
+```
+
+With the options set, you can then compile the project. For most dependencies,
+Meson will try to find them on your system and fall back to downloading a copy
+from its WrapDB for you:
+
+```shell
+$ meson compile -C build
+```
+
+To run the test suite, simply run:
+
+```shell
+$ meson test -C build
+```
+
 ### C#/.NET
 
 Make sure [.NET Core is installed](https://dotnet.microsoft.com/en-us/download).
diff --git a/c/driver/common/meson.build b/c/driver/common/meson.build
new file mode 100644
index 000000000..8f3eb238c
--- /dev/null
+++ b/c/driver/common/meson.build
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+adbc_common_lib = library(
+    'adbc_driver_common',
+    sources: ['utils.c'],
+    include_directories: [root_dir],
+    dependencies: [nanoarrow_dep],
+    install: true,
+)
+
+if get_option('tests')
+    exc = executable(
+        'adbc-driver-common-test',
+        'utils_test.cc',
+        'driver_test.cc',
+        include_directories: [root_dir],
+        link_with: [adbc_common_lib],
+        dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep],
+    )
+    test('adbc-driver-common', exc)
+endif
diff --git a/c/driver/flightsql/meson.build b/c/driver/flightsql/meson.build
new file mode 100644
index 000000000..9bc3555c5
--- /dev/null
+++ b/c/driver/flightsql/meson.build
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+golang = find_program('go')
+
+if build_machine.system() == 'windows'
+  prefix = ''
+  suffix = '.lib'
+elif build_machine.system() == 'darwin'
+  prefix = 'lib'
+  suffix = '.dylib'
+else
+  prefix = 'lib'
+  suffix = '.so'
+endif
+
+adbc_driver_flightsql_name = prefix + 'adbc_driver_flightsql' + suffix
+adbc_driver_flightsql_lib = custom_target(
+    'adbc_driver_flightsql',
+    output: adbc_driver_flightsql_name,
+    command : [
+        golang,
+        'build',
+        '-C',
+        meson.project_source_root() + '/../go/adbc/pkg/flightsql',
+        '-tags=driverlib',
+        '-buildmode=c-shared',
+        '-o',
+        meson.current_build_dir() + '/' + adbc_driver_flightsql_name,
+    ],
+    install : true,
+    install_dir : '.',
+)
+
+if get_option('tests')
+    exc = executable(
+        'adbc-driver-flightsql-test',
+        'dremio_flightsql_test.cc',
+        'sqlite_flightsql_test.cc',
+        include_directories: [root_dir, driver_dir],
+        link_with: [
+            adbc_common_lib,
+            adbc_validation_lib,
+            adbc_validation_util_lib,
+            adbc_driver_flightsql_lib
+        ],
+        dependencies: [nanoarrow_dep, gmock_dep, gtest_main_dep],
+    )
+    test('adbc-driver-flightsql', exc)
+endif
diff --git a/c/driver/framework/meson.build b/c/driver/framework/meson.build
new file mode 100644
index 000000000..73d04dcd5
--- /dev/null
+++ b/c/driver/framework/meson.build
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+adbc_framework_lib = library(
+    'adbc_driver_framework',
+    sources: [
+        'base_driver.cc',
+        'catalog.cc',
+        'objects.cc',
+    ],
+    include_directories: [root_dir],
+    link_with: [adbc_common_lib],
+    dependencies: [nanoarrow_dep, fmt_dep],
+    install: true,
+)
diff --git a/c/driver/postgresql/copy/postgres_copy_writer_test.cc b/c/driver/postgresql/copy/postgres_copy_writer_test.cc
index 688e4ea79..8777f1c81 100644
--- a/c/driver/postgresql/copy/postgres_copy_writer_test.cc
+++ b/c/driver/postgresql/copy/postgres_copy_writer_test.cc
@@ -306,9 +306,8 @@ TEST(PostgresCopyUtilsTest, PostgresCopyWriteNumeric) {
 
   ArrowSchemaInit(&schema.value);
   ASSERT_EQ(ArrowSchemaSetTypeStruct(&schema.value, 1), 0);
-  ASSERT_EQ(
-      PrivateArrowSchemaSetTypeDecimal(schema.value.children[0], type, precision, scale),
-      0);
+  ASSERT_EQ(ArrowSchemaSetTypeDecimal(schema.value.children[0], type, precision, scale),
+            0);
   ASSERT_EQ(ArrowSchemaSetName(schema.value.children[0], "col"), 0);
   ASSERT_EQ(adbc_validation::MakeBatch<ArrowDecimal*>(&schema.value, &array.value,
                                                       &na_error, values),
diff --git a/c/driver/postgresql/meson.build b/c/driver/postgresql/meson.build
new file mode 100644
index 000000000..4574d3179
--- /dev/null
+++ b/c/driver/postgresql/meson.build
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+libpq_dep = dependency('libpq')
+
+adbc_postgres_driver_lib = library(
+    'adbc_driver_postgresql',
+    sources: [
+        'connection.cc',
+        'error.cc',
+        'database.cc',
+        'postgresql.cc',
+        'result_helper.cc',
+        'statement.cc',
+    ],
+    include_directories: [root_dir],
+    link_with: [adbc_common_lib, adbc_framework_lib],
+    dependencies: [nanoarrow_dep, fmt_dep, libpq_dep],
+)
+
+if get_option('tests')
+    postgres_tests = {
+        'driver-postgresql': {
+            'src_name': 'driver_postgresql',
+            'sources': [
+                'postgres_type_test.cc',
+                'postgresql_test.cc',
+            ]
+        },
+        'driver-postgresql-copy': {
+            'src_name': 'driver_postgresql_copy',
+            'sources': [
+                'copy/postgres_copy_reader_test.cc',
+                'copy/postgres_copy_writer_test.cc',
+            ]
+        },
+    }
+
+    foreach name, conf : postgres_tests
+        exc = executable(
+            'adbc-' + name + '-test',
+            sources: conf['sources'],
+            include_directories: [root_dir, driver_dir],
+            link_with: [
+                adbc_common_lib,
+                adbc_postgres_driver_lib,
+                adbc_validation_lib,
+                adbc_validation_util_lib,
+            ],
+            dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep, libpq_dep],
+        )
+        test('adbc-' + name, exc)
+    endforeach
+endif
diff --git a/c/driver/postgresql/postgresql_test.cc b/c/driver/postgresql/postgresql_test.cc
index 3c924d391..48a15d693 100644
--- a/c/driver/postgresql/postgresql_test.cc
+++ b/c/driver/postgresql/postgresql_test.cc
@@ -1906,9 +1906,8 @@ TEST_P(PostgresDecimalTest, SelectValue) {
 
   ArrowSchemaInit(&schema.value);
   ASSERT_EQ(ArrowSchemaSetTypeStruct(&schema.value, 1), 0);
-  ASSERT_EQ(
-      PrivateArrowSchemaSetTypeDecimal(schema.value.children[0], type, precision, scale),
-      0);
+  ASSERT_EQ(ArrowSchemaSetTypeDecimal(schema.value.children[0], type, precision, scale),
+            0);
   ASSERT_EQ(ArrowSchemaSetName(schema.value.children[0], "col"), 0);
 
   ASSERT_THAT(adbc_validation::MakeBatch<ArrowDecimal*>(&schema.value, &array.value,
diff --git a/c/driver/snowflake/meson.build b/c/driver/snowflake/meson.build
new file mode 100644
index 000000000..b465bb499
--- /dev/null
+++ b/c/driver/snowflake/meson.build
@@ -0,0 +1,64 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+golang = find_program('go')
+
+if build_machine.system() == 'windows'
+  prefix = ''
+  suffix = '.lib'
+elif build_machine.system() == 'darwin'
+  prefix = 'lib'
+  suffix = '.dylib'
+else
+  prefix = 'lib'
+  suffix = '.so'
+endif
+
+adbc_driver_snowflake_name = prefix + 'adbc_driver_snowflake' + suffix
+adbc_driver_snowflake_lib = custom_target(
+    'adbc_driver_snowflake',
+    output: adbc_driver_snowflake_name,
+    command : [
+        golang,
+        'build',
+        '-C',
+        meson.project_source_root() + '/../go/adbc/pkg/snowflake',
+        '-tags=driverlib',
+        '-buildmode=c-shared',
+        '-o',
+        meson.current_build_dir() + '/' + adbc_driver_snowflake_name,
+    ],
+    install : true,
+    install_dir : '.',
+)
+
+if get_option('tests')
+    exc = executable(
+        'adbc-driver-snowflake-test',
+        'snowflake_test.cc',
+        include_directories: [root_dir, driver_dir],
+        link_with: [
+            adbc_common_lib,
+            adbc_validation_lib,
+            adbc_validation_util_lib,
+            adbc_driver_snowflake_lib
+        ],
+        dependencies: [nanoarrow_dep, gmock_dep, gtest_main_dep],
+    )
+    test('adbc-driver-snowflake', exc)
+endif
diff --git a/c/driver/sqlite/meson.build b/c/driver/sqlite/meson.build
new file mode 100644
index 000000000..3c99062d0
--- /dev/null
+++ b/c/driver/sqlite/meson.build
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+sqlite3_dep = dependency('sqlite3')
+
+time_t_size = meson.get_compiler('c').sizeof(
+    'time_t',
+    prefix : '#include <sys/types.h>',
+)
+
+adbc_sqlite3_driver_lib = library(
+    'adbc_driver_sqlite',
+    sources: [
+        'sqlite.cc',
+        'statement_reader.c',
+    ],
+    include_directories: [root_dir],
+    link_with: [adbc_common_lib, adbc_framework_lib],
+    dependencies: [nanoarrow_dep, fmt_dep, sqlite3_dep],
+    c_args: ['-DSIZEOF_TIME_T=' + time_t_size.to_string()],
+)
+
+if get_option('tests')
+    exc = executable(
+        'adbc-driver-sqlite-test',
+        sources: ['sqlite_test.cc'],
+        include_directories: [root_dir, driver_dir],
+        link_with: [
+            adbc_common_lib,
+            adbc_sqlite3_driver_lib,
+            adbc_validation_lib,
+            adbc_validation_util_lib
+        ],
+        dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep, sqlite3_dep],
+        )
+    test('adbc-driver-sqlite', exc)
+endif
diff --git a/c/driver_manager/meson.build b/c/driver_manager/meson.build
new file mode 100644
index 000000000..43a708c80
--- /dev/null
+++ b/c/driver_manager/meson.build
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+adbc_driver_manager_lib = library(
+    'adbc_driver_manager',
+    'adbc_driver_manager.cc',
+    include_directories: [root_dir],
+    install: true,
+)
diff --git a/c/meson.build b/c/meson.build
new file mode 100644
index 000000000..df77e5f34
--- /dev/null
+++ b/c/meson.build
@@ -0,0 +1,77 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+project(
+    'arrow-adbc',
+    'c', 'cpp',
+    version: '1.1.0-SNAPSHOT',
+    license: 'Apache-2.0',
+    meson_version: '>=1.3.0',
+    default_options: [
+        'buildtype=release',
+        'c_std=gnu99',  # TODO: gmtime_r is gnu99 - likely unintentional std
+        'warning_level=2',
+        'cpp_std=c++17',
+    ]
+)
+
+root_dir = include_directories('..')
+driver_dir = include_directories('driver')
+nanoarrow_dep = dependency('nanoarrow')
+fmt_dep = dependency('fmt')
+
+if get_option('tests')
+    gtest_main_dep = dependency('gtest_main')
+    # Seems to be some kind of bug with meson test
+    # gtest-port.h:1770 pthread_key_delete(key_)failed with error 22
+    # https://github.com/google/googletest/pull/4536 ???
+    gtest_dep = dependency('gtest')
+    gmock_dep = dependency('gmock')
+else
+    gtest_dep = disabler()
+    gmock_dep = disabler()
+endif
+
+needs_driver_manager = get_option('driver_manager') \
+    or get_option('tests')
+
+if needs_driver_manager
+    subdir('driver_manager')
+endif
+
+subdir('driver/common')
+subdir('driver/framework')
+
+if get_option('tests')
+  subdir('validation')
+endif
+
+if get_option('flightsql')
+  subdir('driver/flightsql')
+endif
+
+if get_option('postgresql')
+  subdir('driver/postgresql')
+endif
+
+if get_option('sqlite')
+  subdir('driver/sqlite')
+endif
+
+if get_option('snowflake')
+  subdir('driver/snowflake')
+endif
diff --git a/c/meson.options b/c/meson.options
new file mode 100644
index 000000000..70fcde666
--- /dev/null
+++ b/c/meson.options
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+option('tests', type: 'boolean', description: 'Build tests', value: false)
+option('benchmarks', type: 'boolean', description: 'Build benchmarks', value: false)
+option(
+  'flightsql',
+  type: 'boolean',
+  description: 'Build ADBC FlightSQL driver',
+  value: false
+)
+option(
+  'driver_manager',
+  type: 'boolean',
+  description: 'Build ADBC Driver Manager',
+  value: false
+)
+option(
+  'postgresql',
+  type: 'boolean',
+  description: 'Build ADBC PostgreSQL Driver',
+  value: false
+)
+option(
+  'sqlite',
+  type: 'boolean',
+  description: 'Build ADBC SQLite Driver',
+  value: false
+)
+option(
+  'snowflake',
+  type: 'boolean',
+  description: 'Build ADBC Snowflake Driver',
+  value: false
+)
diff --git a/c/subprojects/fmt.wrap b/c/subprojects/fmt.wrap
new file mode 100644
index 000000000..4e9646010
--- /dev/null
+++ b/c/subprojects/fmt.wrap
@@ -0,0 +1,13 @@
+[wrap-file]
+directory = fmt-10.2.0
+source_url = https://github.com/fmtlib/fmt/archive/10.2.0.tar.gz
+source_filename = fmt-10.2.0.tar.gz
+source_hash = 3ca91733a7313a8ad41c0885929415f8ec0a2a31d4dc7e27e9331412f4ca26ac
+patch_filename = fmt_10.2.0-2_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/fmt_10.2.0-2/get_patch
+patch_hash = 2428c3a386a8390c76378f81ef804a297f4edc3b789499dd56629b7902b8ddb7
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_10.2.0-2/fmt-10.2.0.tar.gz
+wrapdb_version = 10.2.0-2
+
+[provide]
+fmt = fmt_dep
diff --git a/c/subprojects/gtest.wrap b/c/subprojects/gtest.wrap
new file mode 100644
index 000000000..adb8a9a6d
--- /dev/null
+++ b/c/subprojects/gtest.wrap
@@ -0,0 +1,16 @@
+[wrap-file]
+directory = googletest-1.14.0
+source_url = https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz
+source_filename = gtest-1.14.0.tar.gz
+source_hash = 8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7
+patch_filename = gtest_1.14.0-2_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.14.0-2/get_patch
+patch_hash = 4ec7f767364386a99f7b2d61678287a73ad6ba0f9998be43b51794c464a63732
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/gtest_1.14.0-2/gtest-1.14.0.tar.gz
+wrapdb_version = 1.14.0-2
+
+[provide]
+gtest = gtest_dep
+gtest_main = gtest_main_dep
+gmock = gmock_dep
+gmock_main = gmock_main_dep
diff --git a/c/subprojects/nanoarrow.wrap b/c/subprojects/nanoarrow.wrap
new file mode 100644
index 000000000..1a7e85693
--- /dev/null
+++ b/c/subprojects/nanoarrow.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = arrow-nanoarrow-apache-arrow-nanoarrow-0.5.0
+source_url = https://github.com/apache/arrow-nanoarrow/archive/refs/tags/apache-arrow-nanoarrow-0.5.0.tar.gz
+source_filename = apache-arrow-nanoarrow-0.5.0.tar.gz
+source_hash = 0ceeaa1fb005dbc89c8c7d1b39f2dba07344e40aa9d885ee25fb55b4d57e331a
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/nanoarrow_0.5.0-1/apache-arrow-nanoarrow-0.5.0.tar.gz
+wrapdb_version = 0.5.0-1
+
+[provide]
+nanoarrow = nanoarrow_dep
diff --git a/c/subprojects/sqlite3.wrap b/c/subprojects/sqlite3.wrap
new file mode 100644
index 000000000..5d2eb5c51
--- /dev/null
+++ b/c/subprojects/sqlite3.wrap
@@ -0,0 +1,13 @@
+[wrap-file]
+directory = sqlite-amalgamation-3460000
+source_url = https://www.sqlite.org/2024/sqlite-amalgamation-3460000.zip
+source_filename = sqlite-amalgamation-3460000.zip
+source_hash = 712a7d09d2a22652fb06a49af516e051979a3984adb067da86760e60ed51a7f5
+patch_filename = sqlite3_3.46.0-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/sqlite3_3.46.0-1/get_patch
+patch_hash = c6dda193e59e4bd11dbc6f399cae1904d231e0cb119224480bec6c94c5d0e04e
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sqlite3_3.46.0-1/sqlite-amalgamation-3460000.zip
+wrapdb_version = 3.46.0-1
+
+[provide]
+sqlite3 = sqlite3_dep
diff --git a/c/validation/meson.build b/c/validation/meson.build
new file mode 100644
index 000000000..fe430f823
--- /dev/null
+++ b/c/validation/meson.build
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+adbc_validation_util_lib = library(
+    'adbc_validation_util',
+    'adbc_validation_util.cc',
+    include_directories: [root_dir, driver_dir],
+    link_with: [adbc_common_lib, adbc_framework_lib, adbc_driver_manager_lib],
+    dependencies: [nanoarrow_dep, gtest_dep, gmock_dep],
+    install: true,
+)
+
+adbc_validation_lib = library(
+    'adbc_validation',
+    sources: [
+        'adbc_validation.cc',
+        'adbc_validation_connection.cc',
+        'adbc_validation_database.cc',
+        'adbc_validation_statement.cc',
+    ],
+    include_directories: [root_dir, driver_dir],
+    link_with: [adbc_common_lib, adbc_validation_util_lib, adbc_driver_manager_lib],
+    dependencies: [nanoarrow_dep, gtest_dep, gmock_dep],
+)
diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt
index 459a272b7..253798643 100644
--- a/dev/release/rat_exclude_files.txt
+++ b/dev/release/rat_exclude_files.txt
@@ -1,6 +1,10 @@
 *.json
 *.Rproj
 *.Rd
+c/subprojects/fmt.wrap
+c/subprojects/gtest.wrap
+c/subprojects/nanoarrow.wrap
+c/subprojects/sqlite3.wrap
 c/vendor/backward/*
 c/vendor/fmt/*
 c/vendor/sqlite3/sqlite3.c
diff --git a/dev/release/utils-prepare.sh b/dev/release/utils-prepare.sh
index 52639cb04..a9d3676e0 100644
--- a/dev/release/utils-prepare.sh
+++ b/dev/release/utils-prepare.sh
@@ -64,6 +64,10 @@ update_versions() {
   sed -i.bak -E "s/set\(ADBC_VERSION \".+\"\)/set(ADBC_VERSION \"${c_version}\")/g" cmake_modules/AdbcVersion.cmake
   rm cmake_modules/AdbcVersion.cmake.bak
   git add cmake_modules/AdbcVersion.cmake
+
+  sed -i.bak -E "s/version: '.+',/version: '${c_version}',/g" meson.build
+  rm meson.build.bak
+  git add meson.build
   popd
 
   pushd "${ADBC_DIR}/ci/conda/"