diff --git a/.github/workflows/contrib_rerun_py.yml b/.github/workflows/contrib_rerun_py.yml index 25cfc2978be7..95a71d140e84 100644 --- a/.github/workflows/contrib_rerun_py.yml +++ b/.github/workflows/contrib_rerun_py.yml @@ -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: | diff --git a/rerun_cpp/src/rerun/compiler_utils.hpp b/rerun_cpp/src/rerun/compiler_utils.hpp index 8aae606bc42a..c6ea5724ae9d 100644 --- a/rerun_cpp/src/rerun/compiler_utils.hpp +++ b/rerun_cpp/src/rerun/compiler_utils.hpp @@ -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 diff --git a/rerun_cpp/src/rerun/component_column.cpp b/rerun_cpp/src/rerun/component_column.cpp index 70b637eb9273..9f3bcf7e9523 100644 --- a/rerun_cpp/src/rerun/component_column.cpp +++ b/rerun_cpp/src/rerun/component_column.cpp @@ -2,6 +2,7 @@ #include "arrow_utils.hpp" #include "c/rerun.h" +#include "compiler_utils.hpp" #include #include @@ -20,7 +21,12 @@ namespace rerun { ) { // Convert lengths into offsets. std::vector 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]; } diff --git a/scripts/ci/build_and_upload_wheels.py b/scripts/ci/build_and_upload_wheels.py index 2a977d6a68a5..94c0ca149225 100755 --- a/scripts/ci/build_and_upload_wheels.py +++ b/scripts/ci/build_and_upload_wheels.py @@ -61,9 +61,7 @@ def __str__(self) -> str: return self.value -def build_and_upload( - bucket: Bucket, mode: BuildMode, gcs_dir: str, target: str, compatibility: str, upload_gcs: bool -) -> None: +def build_and_upload(bucket: Bucket | None, mode: BuildMode, gcs_dir: str, target: str, compatibility: str) -> None: if mode is BuildMode.PYPI: # Only build web viewer when publishing to pypi run("pixi run rerun-build-web-release") @@ -90,7 +88,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}") @@ -111,13 +109,17 @@ 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(), args.compat, - args.upload_gcs, ) diff --git a/scripts/roundtrip_utils.py b/scripts/roundtrip_utils.py index 4cb5eb121ffa..85775b5a238f 100644 --- a/scripts/roundtrip_utils.py +++ b/scripts/roundtrip_utils.py @@ -4,7 +4,6 @@ from __future__ import annotations -import multiprocessing import os import subprocess @@ -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: diff --git a/tests/roundtrips.py b/tests/roundtrips.py index 0d8e51ee011c..4c493a90d669 100755 --- a/tests/roundtrips.py +++ b/tests/roundtrips.py @@ -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", @@ -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("----------------------------------------------------------") @@ -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": @@ -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"