Skip to content

Commit 040ff15

Browse files
committed
[test]
1 parent 7651914 commit 040ff15

File tree

2 files changed

+19
-34
lines changed

2 files changed

+19
-34
lines changed

.github/workflows/build-meson.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ jobs:
5555
uses: actions/cache/restore@v4
5656
with:
5757
path: |
58-
$HOME/.cargo/registry
59-
$HOME/.cargo/git
58+
/home/runner/.cargo/registry
59+
/home/runner/.cargo/git
6060
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}
6161
restore-keys: |
6262
${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-
@@ -73,16 +73,16 @@ jobs:
7373
- name: Build libgrovedb
7474
run: |
7575
cd src/ffi/grovedb
76-
meson setup builddir --wipe -Duse_rustdeps=true -Drustdeps_build_dir=${{ github.workspace }}/rust/builddir
76+
meson setup builddir -Duse_rustdeps=true -Drustdeps_build_dir=${{ github.workspace }}/rust/builddir
7777
meson compile -C builddir
7878
7979
- name: Save Cargo cache
8080
if: github.event_name == 'push' && github.ref_name == 'develop'
8181
uses: actions/cache/save@v4
8282
with:
8383
path: |
84-
$HOME/.cargo/registry
85-
$HOME/.cargo/git
84+
/home/runner/.cargo/registry
85+
/home/runner/.cargo/git
8686
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}
8787

8888
build-grovedb-cxx:
@@ -117,8 +117,8 @@ jobs:
117117
uses: actions/cache/restore@v4
118118
with:
119119
path: |
120-
$HOME/.cargo/registry
121-
$HOME/.cargo/git
120+
/home/runner/.cargo/registry
121+
/home/runner/.cargo/git
122122
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}
123123
restore-keys: |
124124
${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-
@@ -135,12 +135,8 @@ jobs:
135135
- name: Build libgrovedb
136136
run: |
137137
cd src/ffi/grovedb
138-
# Verify library exists
139-
ls -la ${{ github.workspace }}/rust/grovedb_cxx/builddir/libgrovedb_cxx.a
140-
meson setup builddir --wipe -Dgrovedb_cxx_build_dir=${{ github.workspace }}/rust/grovedb_cxx/builddir
138+
meson setup builddir -Dgrovedb_cxx_build_dir=${{ github.workspace }}/rust/grovedb_cxx/builddir
141139
meson compile -C builddir
142-
# Check symbols in shared library
143-
nm -D builddir/libgrovedb.so.1 | grep whoami || echo "whoami symbol not found in shared library"
144140
145141
- name: Run tests
146142
run: |
@@ -152,6 +148,6 @@ jobs:
152148
uses: actions/cache/save@v4
153149
with:
154150
path: |
155-
$HOME/.cargo/registry
156-
$HOME/.cargo/git
151+
/home/runner/.cargo/registry
152+
/home/runner/.cargo/git
157153
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('Cargo.lock') }}

src/ffi/grovedb/meson.build

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ if use_rustdeps
5757
grovedb_cxx_bridge_header = grovedb_cxx_subdir / 'gen' / 'rust' / 'grovedb_cxx' / 'lib.h'
5858

5959
# Find the Rust library (libgrovedb_cxx.a is in subprojects/grovedb_cxx/ subdirectory)
60-
grovedb_cxx_lib_path = grovedb_cxx_subdir / 'libgrovedb_cxx.a'
61-
# Only compile args here - linking handled separately via whole-archive
62-
grovedb_cxx_compile_dep = declare_dependency(
60+
grovedb_cxx_lib = declare_dependency(
6361
compile_args: ['-I' + grovedb_cxx_include],
62+
dependencies: cxx.find_library('grovedb_cxx', dirs: [grovedb_cxx_subdir]),
6463
)
6564

6665
cxx_bridge_lib = static_library('cxxbridge_grovedb',
@@ -80,10 +79,9 @@ elif grovedb_cxx_build_dir != ''
8079
error('CXX bridge source not found at: ' + grovedb_cxx_bridge_source)
8180
endif
8281

83-
grovedb_cxx_lib_path = grovedb_cxx_build_dir / 'libgrovedb_cxx.a'
84-
# Only compile args here - linking handled separately via whole-archive
85-
grovedb_cxx_compile_dep = declare_dependency(
82+
grovedb_cxx_lib = declare_dependency(
8683
compile_args: ['-I' + grovedb_cxx_include],
84+
dependencies: cxx.find_library('grovedb_cxx', dirs: [grovedb_cxx_build_dir]),
8785
)
8886

8987
cxx_bridge_lib = static_library('cxxbridge_grovedb',
@@ -119,10 +117,9 @@ else
119117
'Please build grovedb_cxx first (see above)')
120118
endif
121119

122-
grovedb_cxx_lib_path = rust_build_dir / 'grovedb_cxx' / 'libgrovedb_cxx.a'
123-
# Only compile args here - linking handled separately via whole-archive
124-
grovedb_cxx_compile_dep = declare_dependency(
120+
grovedb_cxx_lib = declare_dependency(
125121
compile_args: ['-I' + grovedb_cxx_include],
122+
dependencies: cxx.find_library('grovedb_cxx', dirs: [rust_build_dir / 'grovedb_cxx']),
126123
)
127124

128125
# Compile the CXX bridge source
@@ -151,20 +148,12 @@ libgrovedb_headers = files(
151148
# Include directories
152149
libgrovedb_inc = include_directories('include', 'src')
153150

154-
# Platform-specific whole-archive flags to include all Rust symbols
155-
if host_machine.system() == 'darwin'
156-
whole_archive_args = ['-Wl,-force_load,' + grovedb_cxx_lib_path]
157-
else
158-
whole_archive_args = ['-Wl,--whole-archive', grovedb_cxx_lib_path, '-Wl,--no-whole-archive']
159-
endif
160-
161151
# Build shared library
162152
libgrovedb_shared = shared_library('grovedb',
163153
libgrovedb_sources,
164154
include_directories: libgrovedb_inc,
165-
dependencies: [grovedb_cxx_compile_dep, thread_dep],
155+
dependencies: [grovedb_cxx_lib, thread_dep],
166156
link_with: cxx_bridge_lib,
167-
link_args: whole_archive_args,
168157
install: true,
169158
version: meson.project_version(),
170159
soversion: '1',
@@ -174,7 +163,7 @@ libgrovedb_shared = shared_library('grovedb',
174163
libgrovedb_static = static_library('grovedb',
175164
libgrovedb_sources,
176165
include_directories: libgrovedb_inc,
177-
dependencies: [grovedb_cxx_compile_dep, thread_dep],
166+
dependencies: [grovedb_cxx_lib, thread_dep],
178167
link_with: cxx_bridge_lib,
179168
install: true,
180169
)
@@ -186,7 +175,7 @@ install_headers(libgrovedb_headers, subdir: 'grovedb')
186175
libgrovedb_dep = declare_dependency(
187176
include_directories: libgrovedb_inc,
188177
link_with: libgrovedb_shared,
189-
dependencies: [grovedb_cxx_compile_dep, thread_dep],
178+
dependencies: [grovedb_cxx_lib, thread_dep],
190179
)
191180

192181
# pkg-config file

0 commit comments

Comments
 (0)