Skip to content

Commit 12aab39

Browse files
Fix: prevent make.py from updating uv.lock
Replace the direct usage of ./make.py with uv run --frozen make.py to ensure dependencies remain locked during execution.
1 parent 46a13e5 commit 12aab39

8 files changed

Lines changed: 16 additions & 14 deletions

File tree

.github/workflows/build-guidelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Build documentation
4040
run: |
4141
mkdir -p build
42-
./make.py 2>&1 | tee build/build.log
42+
uv run --frozen make.py 2>&1 | tee build/build.log
4343
# Check for a wide range of error indicators in the log
4444
if grep -q -E "Traceback" build/build.log; then
4545
echo "::error::Build errors detected in log"

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ This repository contains Coding Guidelines for writing Safety Critical Rust, dev
99

1010
The Safety-Critical Rust Coding Guidelines website uses `Sphinx` and `Sphinx-Needs` to build a rendered version of the coding guidelines, and `uv` to install and manage Python dependencies (including Sphinx itself). To simplify building the rendered version, we created a script called `make.py` that takes care of invoking Sphinx with the right flags.
1111

12-
- On Linux and macOS, build the rendered version by running `./make.py`.
13-
- On Windows systems, build the rendered version by running `uv run make.py`.
12+
Build the rendered version by running:
13+
14+
```shell
15+
uv run --frozen make.py
16+
```
1417

1518
By default, Sphinx uses incremental rebuilds to generate the content that
1619
changed since the last invocation. If you notice a problem with incremental
1720
rebuilds, pass the `-c` flag to clear the existing artifacts before
18-
building `./make.py -c`.
21+
building `uv run --frozen make.py -c`.
1922

2023
The following output is generated:
2124

@@ -30,7 +33,7 @@ The following output is generated:
3033
If you're working without internet access or want to avoid reaching out to remote resources, you can pass the `--offline` flag:
3134

3235
```shell
33-
./make.py --offline
36+
uv run --frozen make.py --offline
3437
```
3538

3639
This prevents the build system from attempting to fetch remote resources, such as updates to the specification. Use this flag when you need reproducible or air-gapped builds.
@@ -48,7 +51,7 @@ The file is checked against the current live version of the specification, which
4851
If you run into this while developing a coding guideline, you may ignore this error by running the build with:
4952

5053
```shell
51-
./make.py --ignore-spec-lock-diff
54+
uv run --frozen make.py --ignore-spec-lock-diff
5255
```
5356

5457
#### Auditing the difference

docs/bibliography.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ bibliography_fail_on_inconsistent = True
116116

117117
```bash
118118
# Normal build (no URL validation)
119-
./make.py
119+
uv run --frozen make.py
120120

121121
# Build with URL validation (for CI)
122-
./make.py --validate-urls
122+
uv run --frozen make.py --validate-urls
123123

124124
# Debug build with URL validation
125-
./make.py --debug --validate-urls
125+
uv run --frozen make.py --debug --validate-urls
126126
```
127127

128128
## GitHub Issue Template

docs/fls-audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The FLS repo and delta binaries are cached under `./.cache/fls-audit/` and are s
124124
After completing the checklist, update the local `spec.lock`:
125125

126126
```shell
127-
./make.py --update-spec-lock-file
127+
uv run --frozen make.py --update-spec-lock-file
128128
```
129129

130130
Open a new PR with only the changes needed to rationalize the guidelines with

exts/coding_guidelines/fls_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def check_fls(app, env):
4949
error_message += "\n\tuv run python scripts/fls_audit.py"
5050
error_message += "\nIf the audit tool reports missing baseline metadata, provide --baseline-fls-commit/--current-fls-commit or set GITHUB_TOKEN when using deployment offsets."
5151
error_message += "\nOnce resolved, you may run the following to update the local spec lock file:"
52-
error_message += "\n\t./make.py --update-spec-lock-file"
52+
error_message += "\n\tuv run --frozen make.py --update-spec-lock-file"
5353
logger.error(error_message)
5454
raise FLSValidationError(error_message)
5555
# Check if all referenced FLS IDs exist

make.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env -S uv run
21
# SPDX-License-Identifier: MIT OR Apache-2.0
32
# SPDX-FileCopyrightText: The Coding Guidelines Subcommittee Contributors
43

scripts/generate-rst-comment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def generate_comment(
648648
With `:glob:` you do not need to update the index per guideline.
649649
6. **Build locally** to verify the guideline renders correctly:
650650
```bash
651-
./make.py
651+
uv run --frozen make.py
652652
```
653653
7. **Commit and push** your changes:
654654
```bash

scripts/split_guidelines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def main():
479479
old_file = src_dir / f"{chapter}.rst"
480480
if old_file.exists():
481481
print(f" rm {old_file}")
482-
print("3. Build the documentation to verify: ./make.py")
482+
print("3. Build the documentation to verify: uv run --frozen make.py")
483483
print("4. Update any tooling (guideline-from-issue.py, etc.)")
484484
else:
485485
print("\n=== To apply changes ===")

0 commit comments

Comments
 (0)