Skip to content

Commit c8b3a49

Browse files
authored
Replace -_ or _- patterns with - (#111)
Docker appears to have an undocumented name rule that disallows dashes (`-`) followed by underscores (`_`) (and `-`s after `_`), which caused some of our projects to fail to build. This PR fixes this issue by replacing these patterns (`[_-]{2, }`) with `-`.
1 parent bd16690 commit c8b3a49

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

experiment/evaluator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ def do_check_target(self, ai_binary: str, target_path: str) -> Result:
205205
# Replace "::" and any character not \w, _, or . with "-".
206206
valid_docker_tag_name = re.sub(r'::', '-', self.benchmark.id)
207207
valid_docker_tag_name = re.sub(r'[^\w_.]', '-', valid_docker_tag_name)
208+
# Docker fails with tags containing -_ or _-.
209+
valid_docker_tag_name = re.sub(r'[-_]{2,}', '-', valid_docker_tag_name)
208210
generated_oss_fuzz_project = f'{valid_docker_tag_name}-{sample_id}'
209211
self.create_ossfuzz_project(generated_oss_fuzz_project, target_path)
210212

0 commit comments

Comments
 (0)