Skip to content

Commit

Permalink
Normalize labels
Browse files Browse the repository at this point in the history
  • Loading branch information
nya3jp committed Apr 1, 2024
1 parent f3011d2 commit 0ef1a65
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contest/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
def _normalize_label(label):
if label.startswith("@//"):
return label[1:]
return label

def _dataset_generate_impl(ctx):
out = ctx.actions.declare_file(ctx.label.name + ".zip")
ctx.actions.run(
Expand Down Expand Up @@ -179,7 +184,7 @@ def _simple_judge_impl(ctx):
executable = ctx.executable._generator,
arguments = [
"--output=" + out.path,
"--judge_name=" + str(ctx.label),
"--judge_name=" + _normalize_label(str(ctx.label)),
"--simple_judge=" + ctx.executable._simple_judge.short_path,
"--comparator=" + ctx.executable.comparator.short_path,
"--dataset=" + ctx.file.dataset.short_path,
Expand Down Expand Up @@ -237,7 +242,7 @@ def _interactive_judge_impl(ctx):
executable = ctx.executable._generator,
arguments = [
"--output=" + out.path,
"--judge_name=" + str(ctx.label),
"--judge_name=" + _normalize_label(str(ctx.label)),
"--interactive_judge=" + ctx.executable._interactive_judge.short_path,
"--exec=" + ctx.executable.exec.short_path,
"--dataset=" + ctx.file.dataset.short_path,
Expand Down

0 comments on commit 0ef1a65

Please sign in to comment.