Skip to content

Nondeterministic errors with MODULE.bazel flag_alias() #28836

@gregestren

Description

@gregestren

Description of the bug:

Context: bazel-contrib/rules_python#3450 (comment).

  • That PR adds flag_alias MODULE.bazel registrations for rules_python flags
  • rules_python CI sometimes fails on no such package '@@rules_python//python/config_settings': The repository '@@rules_python' could not be resolved
  • It seems to only apply to rules that call transitions (building a straight py_binary never showed issues).
  • I think switching from USE_BAZEL_VESION=last_rc (9.0.0rc6) to USE_BAZEL_VERSION=last_green fixes it.
  • But the error doesn't consistently happen.

Which category does this issue belong to?

Configurability

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Clone rules_python at commit bazel-contrib/rules_python@c91d9f0
  2. Run $ USE_BAZEL_VERSION=9.0.0rc6; bazelisk clean && bazelisk build --nobuild //tests/py_zipapp:system_python_zipapp. This fails many times in a row, then succeeds many times in a row
  3. Run $ USE_BAZEL_VERSION=last_green; bazelisk clean && bazelisk build --nobuild //tests/py_zipapp:system_python_zipapp. This seems to always succeed.

A custom bazel built at https://github.com/bazelbuild/bazel/tree/release-9.0.1 with #28835 cherrypicked non-determinsitcally fails with I think a different (and smaller) error:

py_zipapp_rule.bzl:234:32: Starlark flag '//python/config_settings:build_python_zip' and its alias '//command_line_option:build_python_zip' have different values: 'false' and 'false'

I remember seeing that last error and I think someone fixed it, but I can't remember where...

Which operating system are you running Bazel on?

Linux

What's the output of git remote get-url origin; git rev-parse HEAD ?

git@github.com:bazel-contrib/rules_python.git
c91d9f026c8d10b1807a3ad5cc6dc2027a65e98e

Metadata

Metadata

Labels

P1I'll work on this now. (Assignee required)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionstype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions