Skip to content
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

Fix contributor CI #7879

Merged
merged 8 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/contrib_rerun_py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ jobs:
# this stops `re_web_viewer_server/build.rs` from running
RERUN_IS_PUBLISHING: true
run: |
pixi run cargo build \
--locked \
-p rerun-cli \
--no-default-features \
--features release \
--release \
--target x86_64-unknown-linux-gnu
pixi run rerun-build-native-and-web-release

- name: Copy rerun-cli to wheel foldcer
run: |
Expand Down
7 changes: 7 additions & 0 deletions rerun_cpp/src/rerun/compiler_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@
#else
#define RR_DISABLE_DEPRECATION_WARNING
#endif

// Disable possible null reference warning
#if defined(__GNUC__) || defined(__clang__)
#define RR_DISABLE_NULL_DEREF_WARNING _Pragma("GCC diagnostic ignored \"-Wnull-dereference\"")
#else
#define RR_DISABLE_NULL_DEREF_WARNING
#endif
6 changes: 6 additions & 0 deletions rerun_cpp/src/rerun/component_column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "arrow_utils.hpp"
#include "c/rerun.h"
#include "compiler_utils.hpp"

#include <arrow/array/array_nested.h>
#include <arrow/buffer.h>
Expand All @@ -20,7 +21,12 @@ namespace rerun {
) {
// Convert lengths into offsets.
std::vector<uint32_t> offsets(lengths.size() + 1);
// Some GCC versions see ghosts here - this can't be a null dereference since we have at least 1 element.
RR_PUSH_WARNINGS
RR_DISABLE_NULL_DEREF_WARNING
offsets[0] = 0;
RR_POP_WARNINGS

for (size_t i = 0; i < lengths.size(); i++) {
offsets[i + 1] = offsets[i] + lengths[i];
}
Expand Down
11 changes: 8 additions & 3 deletions scripts/ci/build_and_upload_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __str__(self) -> str:


def build_and_upload(
bucket: Bucket, mode: BuildMode, gcs_dir: str, target: str, compatibility: str, upload_gcs: bool
bucket: Bucket | None, mode: BuildMode, gcs_dir: str, target: str, compatibility: str, upload_gcs: bool
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
) -> None:
if mode is BuildMode.PYPI:
# Only build web viewer when publishing to pypi
Expand Down Expand Up @@ -90,7 +90,7 @@ def build_and_upload(

pkg = os.listdir(dist)[0]

if upload_gcs:
if bucket is not None:
# Upload to GCS
print("Uploading to GCS…")
bucket.blob(f"{gcs_dir}/{pkg}").upload_from_filename(f"{dist}/{pkg}")
Expand All @@ -111,8 +111,13 @@ def main() -> None:
parser.add_argument("--upload-gcs", action="store_true", default=False, help="Upload the wheel to GCS")
args = parser.parse_args()

if args.upload_gcs:
bucket = Gcs("rerun-open").bucket("rerun-builds")
else:
bucket = None

build_and_upload(
Gcs("rerun-open").bucket("rerun-builds"),
bucket,
args.mode,
args.dir,
args.target or detect_target(),
Expand Down
48 changes: 0 additions & 48 deletions scripts/roundtrip_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from __future__ import annotations

import multiprocessing
import os
import subprocess

Expand Down Expand Up @@ -58,53 +57,6 @@ def roundtrip_env(*, save_path: str | None = None) -> dict[str, str]:
return env


def cmake_configure(release: bool, env: dict[str, str]) -> None:
os.makedirs(cpp_build_dir, exist_ok=True)
build_type = "Debug"
if release:
build_type = "Release"
# TODO(andreas): We should pixi for the prepare so we can ensure we have build tooling ready
configure_args = [
"pixi",
"run",
"-e",
"cpp",
"cmake",
"-B",
cpp_build_dir,
f"-DCMAKE_BUILD_TYPE={build_type}",
"-DCMAKE_COMPILE_WARNING_AS_ERROR=ON",
".",
]
run(
configure_args,
env=env,
)


def cmake_build(target: str, release: bool) -> None:
config = "Debug"
if release:
config = "Release"

build_process_args = [
"pixi",
"run",
"-e",
"cpp",
"cmake",
"--build",
cpp_build_dir,
"--config",
config,
"--target",
target,
"--parallel",
str(multiprocessing.cpu_count()),
]
run(build_process_args)


def run_comparison(rrd0_path: str, rrd1_path: str, full_dump: bool) -> None:
cmd = ["rerun", "rrd", "compare"]
if full_dump:
Expand Down
13 changes: 6 additions & 7 deletions tests/roundtrips.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from os.path import isfile, join

sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../scripts/")
from roundtrip_utils import cmake_build, cmake_configure, cpp_build_dir, roundtrip_env, run, run_comparison # noqa
from roundtrip_utils import cpp_build_dir, roundtrip_env, run, run_comparison # noqa

ARCHETYPES_PATHS = [
"crates/store/re_types/definitions/rerun/archetypes",
Expand Down Expand Up @@ -95,12 +95,11 @@ def main() -> None:
print("Skipping cmake configure & build - assuming all tests are already built and up-to-date!")
else:
print("----------------------------------------------------------")
print("Build roundtrips for C++…")
print("Build rerun_c & roundtrips for C++…")
start_time = time.time()
cmake_configure(args.release, build_env)
cmake_build("roundtrips", args.release)
run(["pixi", "run", "-e", "cpp", "cpp-build-roundtrips"])
elapsed = time.time() - start_time
print(f"C++ roundtrips built in {elapsed:.1f} seconds")
print(f"rerun-sdk for C++ built in {elapsed:.1f} seconds")
print("")

print("----------------------------------------------------------")
Expand Down Expand Up @@ -154,7 +153,7 @@ def main() -> None:

def run_roundtrips(arch: str, language: str, args: argparse.Namespace) -> None:
if language == "cpp":
run_roundtrip_cpp(arch, args.release)
run_roundtrip_cpp(arch)
elif language == "python":
run_roundtrip_python(arch)
elif language == "rust":
Expand Down Expand Up @@ -201,7 +200,7 @@ def run_roundtrip_rust(arch: str, release: bool, target: str | None, target_dir:
return output_path


def run_roundtrip_cpp(arch: str, release: bool) -> str:
def run_roundtrip_cpp(arch: str) -> str:
target_name = f"roundtrip_{arch}"
output_path = f"tests/cpp/roundtrips/{arch}/out.rrd"

Expand Down
Loading