Skip to content

Commit f64e025

Browse files
committed
Make Xvfb more robust when run inside a container
1 parent 14f5006 commit f64e025

File tree

4 files changed

+5
-56
lines changed

4 files changed

+5
-56
lines changed

alloy_adapter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def setup_stats(self, run_id):
5252
if "GC_LOG_DIR" in run_id.env:
5353
logdir = run_id.env["GC_LOG_DIR"]
5454
run_id.env["GC_LOG_FILE"] = f"{logdir}-{bm}.csv"
55-
run_id.env["DISPLAY"] = ":99"
5655

5756
def acquire_command(self, run_id):
5857
self.setup_stats(run_id)

build.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,6 @@ def has_unstaged_changes(c, directory):
228228
return result.exited != 0
229229

230230

231-
@contextmanager
232-
def xvfb_display(width=1280, height=720, colordepth=24, display=99):
233-
xvfb = Xvfb(width=width, height=height, colordepth=colordepth, display=display)
234-
try:
235-
xvfb.start()
236-
yield xvfb
237-
finally:
238-
xvfb.stop()
239-
240-
241231
def patch_repo(c, repo_path, patch_file):
242232
repo_path = Path(repo_path)
243233
patch_file = Path(patch_file)
@@ -693,17 +683,13 @@ class Alacritty(BenchmarkSuite):
693683
)
694684

695685
@property
696-
def cfg_args(self):
686+
def cmd_args(self):
697687
return (
698688
f"-e bash -c \"[ ! -f {self.VTE_BENCH.src / 'benchmarks' / '%(benchmark)s' / 'setup'} ] || "
699689
f"{self.VTE_BENCH.src / 'benchmarks' / '%(benchmark)s' / 'setup'} && "
700690
f"{self.VTE_BENCH.src / 'benchmarks' / '%(benchmark)s' / 'benchmark'}\""
701691
)
702692

703-
# @property
704-
# def cfg_args(self):
705-
# return f"""-e bash -c \"[ ! -f {self.VTE_BENCH.src / 'benchmarks' / '%(benchmark)s' / 'setup'} ] || {self.VTE_BENCH.src / 'benchmarks' / '%(benchmark)s' / 'setup'} && {self.VTE_BENCH.src / 'benchmarks' / '%(benchmark)s' / 'benchmark'}\""""
706-
707693
def build(self, c, target_dir, install_dir, bench_cfg_bin, profile, env):
708694
self.VTE_BENCH.fetch()
709695
self.ALACRITTY.fetch()
@@ -747,7 +733,7 @@ def run(self, c, pexecs, config):
747733
]
748734

749735
if self.suite.name == "alacritty":
750-
with Xvfb():
736+
with Xvfb(display="99"):
751737
c.run(" ".join(rebench_cmd), warn=True, pty=True)
752738
else:
753739
c.run(" ".join(rebench_cmd), warn=True, pty=True)
@@ -998,16 +984,13 @@ def config(self) -> Path:
998984
"env": {
999985
"GC_LOG_DIR": str(cfg.metrics_data),
1000986
"LD_PRELOAD": libgc,
987+
"DISPLAY": ":99",
1001988
}
1002989
}
1003990
)
1004991
else:
1005992
exec_part[cfg.name].update(
1006-
{
1007-
"env": {
1008-
"LD_PRELOAD": libgc,
1009-
}
1010-
}
993+
{"env": {"LD_PRELOAD": libgc, "DISPLAY": ":99"}}
1011994
)
1012995

1013996
for e in self.experiments:

patch/alacritty.arc.diff

Lines changed: 0 additions & 22 deletions
This file was deleted.

patch/alacritty.gc.diff

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs
2-
index 6bbf8dfd..e80a28fa 100644
2+
index 6bbf8dfd..3409851b 100644
33
--- a/alacritty/src/main.rs
44
+++ b/alacritty/src/main.rs
55
@@ -1,5 +1,6 @@
@@ -9,17 +9,6 @@ index 6bbf8dfd..e80a28fa 100644
99
#![warn(rust_2018_idioms, future_incompatible)]
1010
#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use)]
1111
#![cfg_attr(clippy, deny(warnings))]
12-
@@ -18,6 +19,10 @@ use std::io::{self, Write};
13-
use std::path::PathBuf;
14-
use std::{env, fs};
15-
16-
+use std::gc::GcAllocator;
17-
+#[global_allocator]
18-
+static A: GcAllocator = GcAllocator;
19-
+
20-
use log::info;
21-
#[cfg(windows)]
22-
use windows_sys::Win32::System::Console::{AttachConsole, FreeConsole, ATTACH_PARENT_PROCESS};
2312
diff --git a/alacritty/src/window_context.rs b/alacritty/src/window_context.rs
2413
index cfc3cd96..bfca494b 100644
2514
--- a/alacritty/src/window_context.rs

0 commit comments

Comments
 (0)