Skip to content

Commit

Permalink
Fix contributor CI (#7879)
Browse files Browse the repository at this point in the history
### What

Note that this PR comes from a fork, which triggers contributor ci
rather than maintainer ci.

Fixes various issues with the contributor ci which mostly come down to
tooling problems.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7879?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7879?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7879)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
Wumpf authored Oct 24, 2024
1 parent 3d06b31 commit 5770d58
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 68 deletions.
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
14 changes: 8 additions & 6 deletions scripts/ci/build_and_upload_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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}")
Expand All @@ -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,
)


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

0 comments on commit 5770d58

Please sign in to comment.