Repository navigation
Conversation
OpenROAD's install puts yaml2json in bin/ next to openroad. Copy it into the flow image with openroad, and stop the builder image when either is missing, so the flow can read variables.yaml without PyYAML on the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PFLaG12qpV6aKy7cdfwXT Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the dependency on pyyaml and the pre-generated variables.json file by utilizing the yaml2json executable to convert variables.yaml to JSON on the fly, which is then parsed using Python's built-in json module. The feedback highlights an issue in flow/scripts/variables.mk where YAML2JSON may resolve incorrectly to ./yaml2json if OPENROAD_EXE is set to a bare command name without a directory path, and suggests a robust fallback logic to handle this case.
The readers of variables.yaml, defaults.py (variables.mk),
non_stage_variables.py (util.tcl) and generate-variables-docs.py, read
it as JSON on stdin from OpenROAD's yaml2json:
$(YAML2JSON) variables.yaml | $(PYTHON_EXE) defaults.py
Each fails on empty input, so a missing or failing yaml2json stops make
and the stage instead of running with no defaults.
YAML2JSON defaults to yaml2json next to OPENROAD_EXE, where OpenROAD's
install puts it.
variables.json, yaml_to_json.py and the CI step that kept the two in
sync are deleted. The variables.yaml CI job builds yaml2json from
tools/OpenROAD to regenerate FlowVariables.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PFLaG12qpV6aKy7cdfwXT
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Nothing in the flow imports yaml any more. Remove pyyaml from the pip requirements and their locks, and python3-yaml from DependencyInstaller.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PFLaG12qpV6aKy7cdfwXT Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: fewer papercuts in CI and locally.
flow/scripts/variables.jsonis generated fromvariables.yamland committed to git, CI fails when the two drift apart, and every installer carries PyYAML only to regenerate it. This removes the dependency, the committed.jsonand the check. Proposed in #4180.How: the flow pipes
variables.yamlthrough OpenROAD'syaml2jsoninto its readers.variables.json,yaml_to_json.py, the sync step and PyYAML are deleted.What:
openroad; the builder image stops when either is missing.$(YAML2JSON) variables.yaml | $(PYTHON_EXE) <reader>.pyinvariables.mk,util.tcland the docs CI job; each reader fails on empty input.YAML2JSONdefaults toyaml2jsonnext toOPENROAD_EXEand is listed invariables.yaml. Deletesvariables.json, its.gitattributesentry,yaml_to_json.pyand the "Check variables.json is up to date" step. The variables.yaml CI job builds//src/yaml2jsonintools/OpenROADwith bazelisk.pyyamlitself; nothing else depended on it), andpython3-yamlfromDependencyInstaller.sh.Verified on this branch with
yaml2jsonfrom #12102:defaults.pyprints the sameexport VAR?=valuelines as fromvariables.json(sorted diff empty).non_stage_variables.pylists the same variables for synth, floorplan, place, cts, grt, route and final.generate-variables-docs.pyregeneratesFlowVariables.mdbyte-identical, apart from the newYAML2JSONrow.yaml2json,makestops with[ERROR][FLOW] Could not read the defaults in .../variables.yaml with YAML2JSON=...anderase_non_stage_variableserrors withcouldn't execute.Draft: needs The-OpenROAD-Project/OpenROAD#12102 and an OpenROAD submodule bump that brings it in; this PR does not bump
tools/OpenROAD. Until then the Docker builder check and the variables.yaml CI job fail, for want ofyaml2json.Nix is not updated in this PR; Nix users update
flake.nix.🤖 Generated with Claude Code
https://claude.ai/code/session_018PFLaG12qpV6aKy7cdfwXT