Skip to content

Commit 34360e8

Browse files
committed
Fix handling of metrics in Alloy compilations
1 parent 287ac31 commit 34360e8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

artefacts.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ def build(self):
202202

203203
class Alloy(Artefact):
204204
DEFAULT_FLAGS: ClassVar[Dict[str, bool]] = {
205-
"gc-metrics": False,
206205
"finalizer-safety-analysis": False,
207206
"finalizer-elision": True,
208207
"premature-finalizer-prevention": True,
@@ -215,14 +214,19 @@ def __init__(self, profile: "ExperimentProfile", metrics=False):
215214
self.profile = profile
216215
self.metrics = metrics
217216
self._config = None
217+
self.flags = self.DEFAULT_FLAGS.copy() | (self.profile.alloy_flags or {})
218218

219219
@property
220220
def config(self) -> Path:
221-
if self._config and self._config.exists():
221+
if self._config:
222222
return self._config
223223

224+
flags = self.flags.copy()
225+
if self.metrics:
226+
flags.update({"gc-metrics": True})
227+
224228
config = {
225-
"alloy": self.flags,
229+
"alloy": flags,
226230
"rust": {
227231
"codegen-units": 0,
228232
"optimize": True,
@@ -243,10 +247,6 @@ def config(self) -> Path:
243247
toml.dump(config, f)
244248
return file
245249

246-
@property
247-
def flags(self):
248-
return self.DEFAULT_FLAGS.copy() | (self.profile.alloy_flags or {})
249-
250250
@property
251251
def name(self) -> str:
252252
if not self.flags["gc-default-allocator"]:

0 commit comments

Comments
 (0)