From e398f9b2081abc750f0345e2310a5c1fdadfef6c Mon Sep 17 00:00:00 2001 From: Jake Hughes Date: Mon, 4 Dec 2023 15:59:17 +0000 Subject: [PATCH 1/2] Allow Boehm builds to be configured with debug syms and asserts --- library/boehm/build.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/library/boehm/build.rs b/library/boehm/build.rs index 7a08250849f3e..178353a2a8811 100644 --- a/library/boehm/build.rs +++ b/library/boehm/build.rs @@ -34,13 +34,24 @@ fn main() { run("git", |cmd| cmd.arg("clone").arg(BOEHM_ATOMICS_REPO).current_dir(&boehm_src)); } - cmake::Config::new(&boehm_src) + let mut build = cmake::Config::new(&boehm_src); + build .pic(true) - .profile("Release") .define("BUILD_SHARED_LIBS", "OFF") .cflag("-DGC_ALWAYS_MULTITHREADED") - .cflag("-DGC_JAVA_FINALIZATION") - .build(); + .cflag("-DGC_JAVA_FINALIZATION"); + + if env::var("ENABLE_GC_ASSERTIONS").map_or(false, |v| v == "true") { + build.define("enable_gc_assertions", "ON"); + } + + if env::var("ENABLE_GC_DEBUG").map_or(false, |v| v == "true") { + build.profile("Debug"); + } else { + build.profile("Release"); + } + + build.build(); println!("cargo:rustc-link-search=native={}", &build_dir.display()); println!("cargo:rustc-link-lib=static=gc"); From 14d14074ce4a0ec4e5d9e9f22210fc331addc8fa Mon Sep 17 00:00:00 2001 From: Jake Hughes Date: Mon, 4 Dec 2023 16:05:25 +0000 Subject: [PATCH 2/2] Run Alloy with GC assertions on CI --- .buildbot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildbot.sh b/.buildbot.sh index 12e09b518b433..5b3f52b93e219 100644 --- a/.buildbot.sh +++ b/.buildbot.sh @@ -14,5 +14,5 @@ export RUSTUP_HOME="`pwd`/.rustup" # Ensure the build fails if it uses excessive amounts of memory. ulimit -d $((1024 * 1024 * 8)) # 8 GiB -/usr/bin/time -v python3 x.py test --stage 2 --config .buildbot.config.toml --exclude rustdoc-json --exclude debuginfo +ENABLE_GC_ASSERTIONS=true /usr/bin/time -v python3 x.py test --stage 2 --config .buildbot.config.toml --exclude rustdoc-json --exclude debuginfo