Skip to content

Commit 1bc72ee

Browse files
committed
docs: vendor OpenROAD sources instead of fetching master
conf.py fetched three files from OpenROAD master at build time and spliced them with regex guarded by bare assert. A heading rename upstream broke the build with a message naming neither file nor fix, python -O stripped the guard entirely, and the docs tracked master rather than the pinned tools/OpenROAD submodule. Sources are vendored at the submodule SHA under docs/_vendor and refreshed by the existing update-OR cron job, so the build makes no network calls and check_vendored_docs.py fails the submodule bump instead of the docs build. Only the Supported Operating Systems section of index.md is vendored, not the whole landing page: conf.py consumes nothing else, and the surrounding prose trips this repo's blocked-content check. Vendored copies keep upstream trailing whitespace so the refresh stays idempotent, so .gitattributes exempts them from whitespace checking. Drops docs/SupportedOS, which Sphinx published as an orphan copy of OpenROAD's landing page.
1 parent 56496f3 commit 1bc72ee

13 files changed

Lines changed: 1172 additions & 51 deletions

‎.gitattributes‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# Make Github ignore the designs folder when determining repo language
22
flow/designs/src/* linguist-vendored
33
flow/scripts/variables.json linguist-generated=true
4+
5+
# Byte-for-byte copies of OpenROAD files, regenerated by
6+
# docs/scripts/refresh_openroad_docs.py. Upstream's trailing whitespace must
7+
# survive verbatim, or the refresh is no longer idempotent and the vendored
8+
# copies stop matching the commit SOURCE.json pins.
9+
docs/_vendor/openroad/** -whitespace

‎.github/workflows/github-actions-cron-update-OR.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
echo "::set-output name=has_update::$(git --no-pager diff --name-only origin/master..HEAD)"
2323
git checkout master
2424
git pull
25+
- name: Refresh vendored OpenROAD docs
26+
# docs/conf.py reads docs/_vendor/openroad/ instead of downloading from
27+
# GitHub while Sphinx runs, so the vendored copies must be re-taken at
28+
# the new submodule SHA. Running it here puts the docs refresh in the
29+
# same commit as the submodule bump, which is what
30+
# docs/scripts/check_vendored_docs.py asserts.
31+
run: python3 docs/scripts/refresh_openroad_docs.py
2532
- if: "steps.remote-update.outputs.has_update != ''"
2633
name: Create Draft PR
2734
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1

‎.gitignore‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ perf.data
8585
perf.data.old
8686

8787
# documentation specific
88+
# Everything below is generated by docs/conf.py during `make html`; the sources
89+
# are docs/index.md, ../README.md and docs/_vendor/openroad/ (see
90+
# docs/_vendor/openroad/README.md).
8891
docs/main
8992
docs/build
90-
SupportedOS.md
9193
index2.md
9294
Manpage.md
9395
mainREADME.md
96+
docs/contrib/GitGuide.md
9497
build
9598
.scala-build/
9699
.bsp/

‎docs/_vendor/openroad/GitGuide.md‎

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# Git Quickstart
2+
3+
This tutorial serves as a quickstart to Git and contributing to our repository. If you have not already set up OpenROAD, please follow the instructions [here](../user/Build.md).
4+
5+
```{tip} This basic tutorial gives instruction for basic password Git authentication.
6+
If you would like to setup SSH authentication, please follow this [guide](https://help.github.com/set-up-git-redirect).
7+
```
8+
9+
## Forking
10+
11+
You will need your own fork to work on the code. Go to the `OpenROAD` project
12+
[page](https://github.com/The-OpenROAD-Project/OpenROAD) and hit the `Fork` button. You will
13+
want to clone your fork to your machine:
14+
15+
```shell
16+
git clone https://github.com/your-user-name/OpenROAD.git
17+
cd OpenROAD
18+
git remote add upstream https://github.com/The-OpenROAD-Project/OpenROAD.git
19+
git fetch upstream
20+
```
21+
22+
This creates the directory `OpenROAD` and connects your repository to
23+
the upstream (master project) *OpenROAD* repository.
24+
25+
## Creating a branch
26+
27+
You want your master branch to reflect only production-ready code, so create a
28+
feature branch for making your changes. For example:
29+
30+
```shell
31+
git checkout master && git branch shiny-new-feature
32+
git checkout shiny-new-feature
33+
# Or equivalently,
34+
git checkout master && git checkout -b shiny-new-feature
35+
```
36+
37+
This changes your working directory to the shiny-new-feature branch. Keep any
38+
changes in this branch specific to one bug or feature so it is clear
39+
what the branch brings to OpenROAD. You can have many shiny-new-features
40+
and switch in between them using the git checkout command.
41+
42+
When creating this branch, make sure your master branch is up to date with
43+
the latest upstream master version. To update your local master branch, you
44+
can do:
45+
46+
```shell
47+
git checkout master
48+
git pull upstream master
49+
```
50+
51+
When you want to update the feature branch with changes in master after
52+
you created the branch, check the section on
53+
[updating a PR](#updating-your-pull-request).
54+
55+
## Committing your code
56+
Keep style fixes to a separate commit to make your pull request more readable. Once you've made changes, you can see them by typing:
57+
58+
```shell
59+
git status
60+
```
61+
62+
If you have created a new file, it is not being tracked by git. Add it by typing:
63+
```shell
64+
git add path/to/file-to-be-added.py
65+
```
66+
67+
Doing `git status` again should give something like:
68+
```shell
69+
# On branch shiny-new-feature
70+
#
71+
# modified: /relative/path/to/file-you-added.py
72+
#
73+
```
74+
75+
Finally, commit your changes to your local repository with an explanatory commit
76+
message. Do note the `-s` option is needed for developer signoff.
77+
```shell
78+
git commit -s -m "your commit message goes here"
79+
```
80+
81+
## Pushing your changes
82+
83+
When you want your changes to appear publicly on your GitHub page, push your
84+
forked feature branch's commits:
85+
86+
```shell
87+
git push origin shiny-new-feature
88+
```
89+
90+
Here `origin` is the default name given to your remote repository on GitHub.
91+
You can see the remote repositories:
92+
93+
```shell
94+
git remote -v
95+
```
96+
97+
If you added the upstream repository as described above you will see something
98+
like:
99+
100+
```shell
101+
origin https://github.com/your-user-name/OpenROAD.git (fetch)
102+
origin https://github.com/your-user-name/OpenROAD.git (push)
103+
upstream https://github.com/The-OpenROAD-Project/OpenROAD.git (fetch)
104+
upstream https://github.com/The-OpenROAD-Project/OpenROAD.git (push)
105+
```
106+
107+
Now your code is on GitHub, but it is not yet a part of the OpenROAD project. For that to
108+
happen, a pull request needs to be submitted on GitHub.
109+
110+
## Review your code
111+
112+
When you're ready to ask for a code review, file a pull request. Before you do, once
113+
again make sure that you have followed all the guidelines outlined in the [Developer's Guide](./DeveloperGuide.md)
114+
regarding code style, tests, performance tests, and documentation. You should also
115+
double check your branch changes against the branch it was based on:
116+
117+
1. Navigate to your repository on GitHub -- https://github.com/your-user-name/OpenROAD
118+
1. Click on `Branches`
119+
1. Click on the `Compare` button for your feature branch
120+
1. Select the `base` and `compare` branches, if necessary. This will be `master` and
121+
`shiny-new-feature`, respectively.
122+
123+
## Submitting the pull request
124+
125+
If everything looks good, you are ready to make a pull request. A pull request is how
126+
code from a local repository becomes available to the GitHub community and can be looked
127+
at and eventually merged into the master version. This pull request and its associated
128+
changes will eventually be committed to the master branch and available in the next
129+
release. To submit a pull request:
130+
131+
1. Navigate to your repository on GitHub
132+
1. Click on the ``Compare & pull request`` button
133+
1. You can then click on ``Commits`` and ``Files Changed`` to make sure everything looks
134+
okay one last time
135+
1. Write a description of your changes in the ``Preview Discussion`` tab
136+
1. Click ``Send Pull Request``.
137+
138+
This request then goes to the repository maintainers, and they will review
139+
the code.
140+
141+
## Updating your pull request
142+
143+
Based on the review you get on your pull request, you will probably need to make
144+
some changes to the code. In that case, you can make them in your branch,
145+
add a new commit to that branch, push it to GitHub, and the pull request will be
146+
automatically updated. Pushing them to GitHub again is done by:
147+
148+
```shell
149+
git push origin shiny-new-feature
150+
```
151+
152+
This will automatically update your pull request with the latest code and restart the
153+
[Continuous Integration](./CI.md) tests.
154+
155+
Another reason you might need to update your pull request is to solve conflicts
156+
with changes that have been merged into the master branch since you opened your
157+
pull request.
158+
159+
To do this, you need to `merge upstream master` in your branch:
160+
161+
```shell
162+
git checkout shiny-new-feature
163+
git fetch upstream
164+
git merge upstream/master
165+
```
166+
167+
If there are no conflicts (or they could be fixed automatically), a file with a
168+
default commit message will open, and you can simply save and quit this file.
169+
170+
If there are merge conflicts, you need to solve those conflicts. See
171+
this [article](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/)
172+
for an explanation on how to do this.
173+
Once the conflicts are merged and the files where the conflicts were solved are
174+
added, you can run ``git commit`` to save those fixes.
175+
176+
If you have uncommitted changes at the moment you want to update the branch with
177+
master, you will need to ``stash`` them prior to updating.
178+
179+
```{seealso}
180+
See the stash [docs](https://git-scm.com/book/en/v2/Git-Tools-Stashing-and-Cleaning).
181+
```
182+
This will effectively store your changes and they can be reapplied after updating.
183+
184+
After the feature branch has been updated locally, you can now update your pull
185+
request by pushing to the branch on GitHub:
186+
187+
```shell
188+
git push origin shiny-new-feature
189+
```
190+
191+
## Tips for a successful pull request
192+
193+
If you have made it to the `Review your code` phase, one of the core contributors may
194+
take a look. Please note however that a handful of people are responsible for reviewing
195+
all of the contributions, which can often lead to bottlenecks.
196+
197+
To improve the chances of your pull request being reviewed, you should:
198+
199+
- **Reference an open issue** for non-trivial changes to clarify the PR's purpose
200+
- **Ensure you have appropriate tests**. These should be the first part of any PR
201+
- **Keep your pull requests as simple as possible**. Larger PRs take longer to review
202+
- **Ensure that CI is in a green state**. Reviewers may not even look otherwise
203+
- **Keep updating your pull request**, either by request or every few days
204+
205+
## Acknowledgements
206+
207+
This page has been adapted from [pandas Developer Guide](https://pandas.pydata.org/docs/development/contributing.html).

‎docs/_vendor/openroad/README.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Vendored OpenROAD documentation sources
2+
3+
**Do not edit these files by hand.** They are verbatim copies of files from the
4+
[OpenROAD](https://github.com/The-OpenROAD-Project/OpenROAD) repository, taken at
5+
the exact commit that the `tools/OpenROAD` submodule pins. `SOURCE.json` records
6+
the repository, the commit SHA, and the upstream path of every file here.
7+
8+
| File | Upstream path | Used by `docs/conf.py` to build |
9+
| --- | --- | --- |
10+
| `GitGuide.md` | `docs/contrib/GitGuide.md` | `docs/contrib/GitGuide.md` (renamed for ORFS, with `contrib/GitGuideAdapter.md` spliced in) |
11+
| `index-SupportedOS.md` | `docs/index.md`, `## Supported Operating Systems` section only | that section, demoted to `####`, spliced into `docs/index2.md` under `### Setup` |
12+
| `utl-README.md` | `src/utl/README.md` | `docs/Manpage.md` |
13+
14+
Only what `docs/conf.py` consumes is stored. OpenROAD's `docs/index.md` is a
15+
landing page and ORFS renders exactly one section of it, so the refresh script
16+
extracts that section and vendors it alone — copying the whole page in would
17+
bring unrelated project prose into this repository to render one table.
18+
19+
The repo-relative links in `utl-README.md` are rewritten to absolute GitHub URLs
20+
at the vendored SHA, because they would otherwise resolve against this
21+
repository and 404.
22+
23+
These files are exempt from the whitespace checks in `.gitattributes`: they are
24+
byte-for-byte upstream copies, and the refresh script is only idempotent if
25+
nothing rewrites them.
26+
27+
## Why these are vendored
28+
29+
`docs/conf.py` used to `requests.get()` all three files from
30+
`raw.githubusercontent.com/.../OpenROAD/master/` while Sphinx was running. That
31+
made the documentation build require network access, produced non-reproducible
32+
output, tracked OpenROAD `master` rather than the version ORFS actually ships,
33+
and overwrote files in the working tree on every local `make html`. Vendoring
34+
gives the documentation the same hash-pinned reproducibility as
35+
`docs/requirements_lock.txt`.
36+
37+
## Refreshing
38+
39+
```shell
40+
python3 docs/scripts/refresh_openroad_docs.py
41+
```
42+
43+
This is the only thing that downloads from GitHub, and it is wired into
44+
`.github/workflows/github-actions-cron-update-OR.yml` so the nightly
45+
submodule-bump PR carries the refreshed docs in the same commit. Run it by hand
46+
whenever you bump `tools/OpenROAD` yourself.
47+
48+
## Checking
49+
50+
```shell
51+
python3 docs/scripts/check_vendored_docs.py
52+
```
53+
54+
Asserts, offline, that `SOURCE.json`'s SHA still matches
55+
`git rev-parse HEAD:tools/OpenROAD`, that every heading `docs/conf.py` splices
56+
on is still present, and that `index-SupportedOS.md` still holds exactly one
57+
`##` section. Run it on any pull request that bumps `tools/OpenROAD`.

‎docs/_vendor/openroad/SOURCE.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"_comment": "Generated by docs/scripts/refresh_openroad_docs.py -- do not edit by hand. Run that script to re-vendor after bumping the tools/OpenROAD submodule.",
3+
"repo": "The-OpenROAD-Project/OpenROAD",
4+
"sha": "ab6fd26351dc449e69059684dc6aa9ae9046eb36",
5+
"files": {
6+
"docs/contrib/GitGuide.md": {
7+
"vendored": "GitGuide.md"
8+
},
9+
"docs/index.md": {
10+
"vendored": "index-SupportedOS.md",
11+
"section": {
12+
"start": "## Supported Operating Systems",
13+
"end": "## Code of conduct"
14+
}
15+
},
16+
"src/utl/README.md": {
17+
"vendored": "utl-README.md",
18+
"links_rewritten": true
19+
}
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Supported Operating Systems
2+
3+
Note that depending on the installation method, we have varying levels of
4+
support for various operating systems.
5+
6+
Legend:
7+
- `Y` for supported.
8+
- `-` for unsupported.
9+
10+
| Operating System | Local Installation | Prebuilt Binaries | Docker Installation | Windows Subsystem for Linux |
11+
| --- | --- | --- | --- | --- |
12+
| Debian 12 | `Y` | `Y` | `Y` | `-` |
13+
| Debian 13 | `Y` | `Y` | `Y` | `-` |
14+
| Ubuntu 22.04 | `Y` | `Y` | `Y` | `-` |
15+
| Ubuntu 24.04 | `Y` | `Y` | `Y` | `-` |
16+
| Ubuntu 26.04 | `Y` | `Y` | `Y` | `-` |
17+
| RHEL 8/9 | `Y` | `-` | `Y` | `-` |
18+
| Rocky 8 | `Y` | `-` | `Y` | `-` |
19+
| Rocky 9 | `Y` | `-` | `Y` | `-` |
20+
| macOS | `Y` | `-` | `Y` | `-` |
21+
| Windows 10 and above | `-` | `-` | `Y` | `Y` |
22+
23+

0 commit comments

Comments
 (0)