Skip to content

Commit

Permalink
Merge pull request #102 from jacob-hughes/allow_debug_boehm
Browse files Browse the repository at this point in the history
Run Boehm assertions on CI
  • Loading branch information
ltratt authored Dec 4, 2023
2 parents ef706e8 + 14d1407 commit 0fa1863
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .buildbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

19 changes: 15 additions & 4 deletions library/boehm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 0fa1863

Please sign in to comment.