Skip to content

Commit

Permalink
GH-44465: [GLib][C++] Meson searches libraries with specific versions. (
Browse files Browse the repository at this point in the history
#44475)

### Rationale for this change

This PR fixes #44465. Meson selects incorrect Arrow C++ libraries in some situations. 

### What changes are included in this PR?

Meson searches arrow libraries with particular versions.
For example, if the c_glib version number is 18.0.0-SNAPSHOT, Meson searches the Arrow C++ library greater than 18.0.0-SNAPSHOT.

### Are these changes tested?

Yes.

If the required version libraries exist, install it properly.

```
Run-time dependency arrow found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-compute found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-csv found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-filesystem found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-json found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-orc found: YES 18.0.0-SNAPSHOT
Found CMake: /opt/homebrew/bin/cmake (3.30.5)
WARNING: CMake Toolchain: Failed to determine CMake compilers state
Run-time dependency arrow-cuda found: NO (tried pkgconfig, framework and cmake)
Run-time dependency arrow-acero found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-dataset found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-flight found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-flight-sql found: YES 18.0.0-SNAPSHOT
Run-time dependency gandiva found: YES 18.0.0-SNAPSHOT
Run-time dependency parquet found: YES 18.0.0-SNAPSHOT
```

If an environment doesn't install Arrow C++ 18.0.0-SNAPSHOT (Installed older version 17.0.0)

```
Run-time dependency arrow found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-compute found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-csv found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-filesystem found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-json found: YES 18.0.0-SNAPSHOT
Run-time dependency arrow-orc found: YES 18.0.0-SNAPSHOT
Found CMake: /opt/homebrew/bin/cmake (3.30.5)
WARNING: CMake Toolchain: Failed to determine CMake compilers state
Run-time dependency arrow-cuda found: NO (tried pkgconfig, framework and cmake)
Run-time dependency arrow-acero found: YES 18.0.0-SNAPSHOT
Dependency arrow-dataset found: NO. Found 17.0.0 but need: '>=18.0.0-SNAPSHOT'
Run-time dependency arrow-dataset found: NO (tried pkgconfig, framework and cmake)
Dependency arrow-flight found: NO. Found 17.0.0 but need: '>=18.0.0-SNAPSHOT'
Run-time dependency arrow-flight found: NO (tried pkgconfig, framework and cmake)
Dependency arrow-flight-sql found: NO. Found 17.0.0 but need: '>=18.0.0-SNAPSHOT'
Run-time dependency arrow-flight-sql found: NO (tried pkgconfig, framework and cmake)
Dependency gandiva found: NO. Found 17.0.0 but need: '>=18.0.0-SNAPSHOT'
...
Dependency parquet found: NO. Found 17.0.0 but need: '>=18.0.0-SNAPSHOT'
Run-time dependency parquet found: NO (tried pkgconfig and framework)
```

### Are there any user-facing changes?

Yes.

* GitHub Issue: #44465

Authored-by: Hiroyuki Sato <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
hiroyuki-sato authored Oct 19, 2024
1 parent a5850e1 commit 54697ea
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions c_glib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,23 @@ else
endif

if arrow_cpp_build_lib_dir == ''
arrow = dependency('arrow')
arrow = dependency('arrow', version: ['>=' + version])
# They are just for checking required modules are enabled. They are built into
# libarrow.so. So we don't need additional build flags for them.
dependency('arrow-compute')
dependency('arrow-csv')
dependency('arrow-filesystem')
dependency('arrow-json')
dependency('arrow-compute', version: ['>=' + version])
dependency('arrow-csv', version: ['>=' + version])
dependency('arrow-filesystem', version: ['>=' + version])
dependency('arrow-json', version: ['>=' + version])

have_arrow_orc = dependency('arrow-orc', required: false).found()
arrow_cuda = dependency('arrow-cuda', required: false)
have_arrow_orc = dependency('arrow-orc', required: false, version: ['>=' + version]).found()
arrow_cuda = dependency('arrow-cuda', required: false, version: ['>=' + version])
# we do not support compiling glib without acero engine
arrow_acero = dependency('arrow-acero', required: true)
arrow_dataset = dependency('arrow-dataset', required: false)
arrow_flight = dependency('arrow-flight', required: false)
arrow_flight_sql = dependency('arrow-flight-sql', required: false)
gandiva = dependency('gandiva', required: false)
parquet = dependency('parquet', required: false)
arrow_acero = dependency('arrow-acero', required: true, version: ['>=' + version])
arrow_dataset = dependency('arrow-dataset', required: false, version: ['>=' + version])
arrow_flight = dependency('arrow-flight', required: false, version: ['>=' + version])
arrow_flight_sql = dependency('arrow-flight-sql', required: false, version: ['>=' + version])
gandiva = dependency('gandiva', required: false, version: ['>=' + version])
parquet = dependency('parquet', required: false, version: ['>=' + version])
else
base_include_directories += [
include_directories(join_paths(arrow_cpp_build_dir, 'src')),
Expand Down

0 comments on commit 54697ea

Please sign in to comment.