Skip to content

Commit

Permalink
cleanup: get rid of cruft ORFS, knows the stage of all relevant varia…
Browse files Browse the repository at this point in the history
…bles

Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Dec 21, 2024
1 parent 45e6af0 commit 6bd4fd9
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions openroad.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1285,31 +1285,7 @@ ORFS_STAGE_TO_VARIABLES = {
for stage in ALL_STAGES
}

STAGE_TO_VARIABLES = {
stage: [
variable
for variable, stages in BAZEL_VARIABLE_TO_STAGES.items()
if stage in stages
] + BAZEL_STAGE_TO_VARIABLES.get(stage, [])
for stage in ALL_STAGES
}

VARIABLE_TO_STAGES = {
variable: [
stage
for stage in ALL_STAGES
if variable in STAGE_TO_VARIABLES[stage]
]
for variable in _union(*STAGE_TO_VARIABLES.values())
}

[
fail("Variable {} is defined the same in ORFS and Bazel {}".format(variable, stages))
for variable, stages in VARIABLE_TO_STAGES.items()
if variable in ORFS_VARIABLE_TO_STAGES and sorted(ORFS_VARIABLE_TO_STAGES[variable]) == sorted(stages)
]

ALL_STAGE_TO_VARIABLES = {stage: _union(STAGE_TO_VARIABLES.get(stage, []), ORFS_STAGE_TO_VARIABLES.get(stage, [])) for stage in ALL_STAGES}
ALL_STAGE_TO_VARIABLES = {stage: ORFS_STAGE_TO_VARIABLES.get(stage, []) for stage in ALL_STAGES}

ALL_VARIABLE_TO_STAGES = {
variable: [
Expand Down

0 comments on commit 6bd4fd9

Please sign in to comment.