Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: treat ignore_root_user_error either ignored or warning #2739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 5, 2025

Conversation

mattem
Copy link
Contributor

@mattem mattem commented Apr 5, 2025

Previously #2636 changed the semantics of ignore_root_user_error from "ignore" to "warning". This is now flipped back to ignoring the issue, and will only emit a warning when the attribute is set False.

This does also change the semantics of what #2636 did by flipping the attribute, as now there is no warning, and the user would have to explicitly set it to False (they don't want to ignore the error) to see the warning.

@mattem mattem requested review from rickeylev and aignas as code owners April 5, 2025 16:04
@@ -803,8 +803,8 @@ to spurious cache misses or build failures).
However, if the user is running Bazel as root, this read-onlyness is not
respected. Bazel will print a warning message when it detects that the runtime
installation is writable despite being made read only (i.e. it's running with
root access). If this attribute is set to `False`, Bazel will make it a hard
error to run with root access instead.
root access) while this attribute is set `False`, however this messaging can be ignored by setting
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps this should be flipped back to False, so the user gets the warning (like they do now with the default), and True is then a true ignore.

Another option would be to make this a tri-state in a non-breaking way, or perhaps add yet another attribute (likely not preferable).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can have it print a warning if the root module is what configured the toolchain?

The situation I want to avoid is warning spam -- if a downstream user is running as root (for whatever reason), and happens to depend on rules_python (unbeknowst to them, and out of their control), getting warning spam is somewhat annoying.

I do wish we understood the cause here better. I'm mostly sure that the various glob-excludes have fixed this. And there's always the alternative to generate hash-based pyc files at repo-time (when possible) to help avoid the issue further.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The situation I want to avoid is warning spam

That's excellent to hear, and was the motivation for this diff.
We have quite a number of toolchains registered (arguably too many), and received a lot of warnings (we actually fail builds if too many new log lines are introduced). The change in semantics in #2636 made it hard to remove the warnings, which led to me patching the logger and disabling warnings (now upstreamed as #2737)

@@ -803,8 +803,8 @@ to spurious cache misses or build failures).
However, if the user is running Bazel as root, this read-onlyness is not
respected. Bazel will print a warning message when it detects that the runtime
installation is writable despite being made read only (i.e. it's running with
root access). If this attribute is set to `False`, Bazel will make it a hard
error to run with root access instead.
root access) while this attribute is set `False`, however this messaging can be ignored by setting
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can have it print a warning if the root module is what configured the toolchain?

The situation I want to avoid is warning spam -- if a downstream user is running as root (for whatever reason), and happens to depend on rules_python (unbeknowst to them, and out of their control), getting warning spam is somewhat annoying.

I do wish we understood the cause here better. I'm mostly sure that the various glob-excludes have fixed this. And there's always the alternative to generate hash-based pyc files at repo-time (when possible) to help avoid the issue further.

@rickeylev rickeylev enabled auto-merge April 5, 2025 18:23
@rickeylev rickeylev added this pull request to the merge queue Apr 5, 2025
Merged via the queue into bazel-contrib:main with commit 6854dc3 Apr 5, 2025
3 checks passed
@mattem mattem deleted the fix/ignore_root_warning branch April 5, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.