Skip to content

Commit 5e3473f

Browse files
committed
Build all cpp binaries of test_wheels ci job in the wheel-test-min environment
Similar to rerun-io#6911 May fix Windows issues or at least make it easier to diagnose
1 parent e6e8c9a commit 5e3473f

2 files changed

Lines changed: 19 additions & 29 deletions

File tree

.github/workflows/reusable_test_wheels.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,26 @@ jobs:
183183
# Only check that we have the archetype roundtrip tests, but don't spend time actually running them
184184
run: pixi run -e wheel-test-min RUST_LOG=debug python tests/roundtrips.py --no-run
185185

186+
- name: Build C++ roundtrips
187+
if: ${{ !inputs.FAST }}
188+
# Separated out of roundtrips.py run so we control the pixi environment.
189+
# This used to cause issues on Windows during the setup of the pixi environment when running from inside `roundtrips.py`.
190+
run: pixi run -e wheel-test-min cpp-build-roundtrips
191+
186192
- name: Run tests/roundtrips.py
187193
if: ${{ !inputs.FAST }}
188-
# --release so we can inherit from some of the artifacts that maturin has just built before
189194
# explicit target because otherwise cargo loses the target cache… even though this is the target anyhow…
190195
# --no-py-build because rerun-sdk is already built and installed
191-
run: pixi run -e wheel-test-min RUST_LOG=debug python tests/roundtrips.py --release --target ${{ needs.set-config.outputs.TARGET }} --no-py-build
196+
run: pixi run -e wheel-test-min RUST_LOG=debug python tests/roundtrips.py --target ${{ needs.set-config.outputs.TARGET }} --no-py-build --no-cpp-build
192197

193-
- name: Build C++ examples
198+
- name: Build C++ snippets
194199
if: ${{ !inputs.FAST }}
195200
# Separated out of compare_snippet_output.py run so we control the pixi environment.
196201
# This used to cause issues on Windows during the setup of the pixi environment when running from inside `compare_snippet_output.py`.
197202
run: pixi run -e wheel-test-min cpp-build-snippets
198203

199204
- name: Run docs/snippets/compare_snippet_output.py
200205
if: ${{ !inputs.FAST }}
201-
# --release so we can inherit from some of the artifacts that maturin has just built before
202206
# explicit target because otherwise cargo loses the target cache… even though this is the target anyhow…
203207
# --no-py-build because rerun-sdk is already built and installed
204-
run: pixi run -e wheel-test-min RUST_LOG=debug python docs/snippets/compare_snippet_output.py --release --target ${{ needs.set-config.outputs.TARGET }} --no-py-build --no-cpp-build
208+
run: pixi run -e wheel-test-min RUST_LOG=debug python docs/snippets/compare_snippet_output.py --target ${{ needs.set-config.outputs.TARGET }} --no-py-build --no-cpp-build

tests/roundtrips.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -90,56 +90,44 @@ def main() -> None:
9090
print("----------------------------------------------------------")
9191
print("Building rerun-sdk for Python…")
9292
start_time = time.time()
93-
run(["pixi", "run", "py-build", "--quiet"], env=build_env)
93+
run(["pixi", "run", "-e", "py", "py-build", "--quiet"], env=build_env)
9494
elapsed = time.time() - start_time
9595
print(f"rerun-sdk for Python built in {elapsed:.1f} seconds")
9696
print("")
9797

9898
if args.no_cpp_build:
99-
print("Skipping cmake configure & build for rerun_c & rerun_cpp - assuming it is already built and up-to-date!")
99+
print("Skipping cmake configure & build - assuming all tests are already built and up-to-date!")
100100
else:
101101
print("----------------------------------------------------------")
102-
print("Build rerun_c & rerun_cpp…")
102+
print("Build roundtrips for C++…")
103103
start_time = time.time()
104104
cmake_configure(args.release, build_env)
105-
cmake_build("rerun_sdk", args.release)
105+
cmake_build("roundtrips", args.release)
106106
elapsed = time.time() - start_time
107-
print(f"rerun-sdk for C++ built in {elapsed:.1f} seconds")
107+
print(f"C++ roundtrips built in {elapsed:.1f} seconds")
108108
print("")
109109

110110
print("----------------------------------------------------------")
111111
print(f"Building {len(archetypes)} archetypes…")
112112

113-
# Running CMake in parallel causes failures during rerun_sdk & arrow build.
114-
# TODO(andreas): Tell cmake in a single command to build everything at once.
115-
if not args.no_cpp_build:
116-
start_time = time.time()
117-
for arch in archetypes:
118-
arch_opt_out = opt_out.get(arch, [])
119-
if "cpp" in arch_opt_out:
120-
continue
121-
build(arch, "cpp", args)
122-
elapsed = time.time() - start_time
123-
print(f"C++ examples compiled and ran in {elapsed:.1f} seconds")
124-
125113
with multiprocessing.Pool() as pool:
126114
start_time = time.time()
127115
jobs = []
128116
for arch in archetypes:
129117
arch_opt_out = opt_out.get(arch, [])
130-
for language in ["python", "rust"]:
118+
for language in ["python", "rust", "cpp"]:
131119
if language in arch_opt_out:
132120
continue
133-
job = pool.apply_async(build, (arch, language, args))
121+
job = pool.apply_async(run_roundtrips, (arch, language, args))
134122
jobs.append(job)
135123
print(f"Waiting for {len(jobs)} build jobs to finish…")
136124
for job in jobs:
137125
job.get()
138126
elapsed = time.time() - start_time
139-
print(f"Python and Rust examples ran in {elapsed:.1f} seconds")
127+
print(f"C++, Python and Rust examples ran in {elapsed:.1f} seconds")
140128

141129
print("----------------------------------------------------------")
142-
print(f"Comparing recordings for{len(archetypes)} archetypes…")
130+
print(f"Comparing recordings for {len(archetypes)} archetypes…")
143131
start_time = time.time()
144132

145133
for arch in archetypes:
@@ -168,7 +156,7 @@ def main() -> None:
168156
print("All tests passed!")
169157

170158

171-
def build(arch: str, language: str, args: argparse.Namespace) -> None:
159+
def run_roundtrips(arch: str, language: str, args: argparse.Namespace) -> None:
172160
if language == "cpp":
173161
run_roundtrip_cpp(arch, args.release)
174162
elif language == "python":
@@ -221,8 +209,6 @@ def run_roundtrip_cpp(arch: str, release: bool) -> str:
221209
target_name = f"roundtrip_{arch}"
222210
output_path = f"tests/cpp/roundtrips/{arch}/out.rrd"
223211

224-
cmake_build(target_name, release)
225-
226212
config_dir = "Release" if release else "Debug"
227213

228214
target_path = f"{config_dir}/{target_name}.exe" if os.name == "nt" else target_name

0 commit comments

Comments
 (0)