Skip to content

Commit adf69bd

Browse files
OSS-Fuzz Teamcopybara-github
authored andcommitted
Make binary_name explicitly shared
PiperOrigin-RevId: 837501046
1 parent c9db9f9 commit adf69bd

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

infra/base-images/base-builder/indexer/manifest_types.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,13 @@ class BinaryConfig:
132132
133133
Attributes:
134134
kind: The kind of binary configuration.
135-
binary_args: The arguments to pass to the binary, for example
136-
"<input_file>".
135+
binary_name: The name of the executable file.
137136
"""
138137

139138
kind: BinaryConfigKind
140139

140+
binary_name: str
141+
141142
@classmethod
142143
def from_dict(cls, config_dict: Mapping[str, Any]) -> Self:
143144
"""Deserializes the correct `BinaryConfig` subclass from a dict."""
@@ -176,7 +177,6 @@ class HarnessKind(enum.StrEnum):
176177
class CommandLineBinaryConfig(BinaryConfig):
177178
"""Configuration for a command-line userspace binary."""
178179

179-
binary_name: str
180180
binary_args: list[str]
181181
# Additional environment variables to pass to the binary. They will overwrite
182182
# any existing environment variables with the same name.
@@ -399,12 +399,6 @@ def save_build(
399399

400400
self.validate()
401401

402-
if not hasattr(self.binary_config, "binary_name"):
403-
raise RuntimeError(
404-
"Attempting to save a binary config type without binary_name."
405-
" This is not yet supported. Kind: {self.binary_config.kind}."
406-
)
407-
408402
with tempfile.NamedTemporaryFile() as tmp:
409403
mode = "w:gz" if archive_path.suffix.endswith("gz") else "w"
410404
with tarfile.open(tmp.name, mode) as tar:
@@ -449,7 +443,9 @@ def _save_dir(
449443

450444
dumped_self = self
451445
if self.index_db_version is None:
452-
index_db_version = _get_sqlite_db_user_version(index_dir / INDEX_DB)
446+
index_db_version = _get_sqlite_db_user_version(
447+
pathlib.Path(index_dir) / INDEX_DB
448+
)
453449
dumped_self = dataclasses.replace(
454450
self, index_db_version=index_db_version
455451
)

0 commit comments

Comments
 (0)