Skip to content

Make //docs:sphinx_build_test work on RBE - #11573

Open
hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260929-sphinx
Open

hzeller wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
hzeller:feature-20260929-sphinx

Conversation

@hzeller

@hzeller hzeller commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

The sphinx test was copying a source file and attempting to modify that. However, in an RBE environment, source files are read-only, so the copy was also read-only. Fixed that by explicitly making it writable.

@hzeller
hzeller requested a review from a team as a code owner September 29, 2026 17:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies docs/sphinx_build_test.py to use shutil.copyfile instead of shutil.copy2 when copying the README.md file to a temporary directory, and explicitly sets the destination file's permissions to 0o644 using os.chmod. There are no review comments, and I have no feedback to provide.

@oharboe

oharboe commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

RBE => Remote Build Execution

@hzeller

hzeller commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Anyone having a look at this ?

@hzeller

hzeller commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Looks like the CI failure is due to some docker glitch

@oharboe oharboe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying bug is copying permissions onto scratch files we then edit; RBE is just where it surfaced. Could the PR be framed that way? Suggested title:

docs: sphinx_build_test: don't copy permissions onto scratch files

Suggested description:

sphinx_build_test copies README.md into a tempdir because conf.py's setup() rewrites it in place. It used shutil.copy2, which also copies the source's permission bits, so a read-only input gave a read-only scratch copy and setup() failed. Use shutil.copyfile, which copies contents only.

The copytree on line 37 has the same pattern: it copies directory permissions, and setup() creates files inside the copied docs/. It may break the same way, though I haven't confirmed it.

Comment thread docs/sphinx_build_test.py Outdated
The sphinx test was copying a source file and attempting to modify
that. However, in an RBE environment, source files are read-only,
so the copy was also read-only. Fixed that by explicitly making
it writable.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller
hzeller force-pushed the feature-20260929-sphinx branch from a39f08c to 4360dd8 Compare October 7, 2026 07:15
@oharboe

oharboe commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

@hzeller I also think that this will be reviewed faster if you reframe it as handling read only source files case, such as Remote Batch Execution, RBE. I didn't know what RBE was.

@hzeller

hzeller commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

The important part for the code is that the file is writable, because that is what the code wants to do, so that is what the comment says and the programmer intents.
And the commit description says where the lack of doing that is noticed: in the more strict RBE environment.
Is there anything missing in the change description that would help making it more obvious ?

(RBE is just the Bazel Remote Build Execution which we already partially use wit the remote cache. You yourself already fixed a writable issue before to fix something showing up under RBE #10823 )

@oharboe

oharboe commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

@osamahammad21 I think this makes sense and is a really simple and safe change and I'm rooting for remote execution environments 🥺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants