Skip to content

Output generated by gazelle_python_manifest is not deterministic#812

Description

@abhishekshivanna

馃悶 bug report

Affected Rule

The issue is caused by the rule:

load("@rules_python//gazelle/manifest:defs.bzl", "gazelle_python_manifest")

Is this a regression?

Don't think so, probably always existed

Description

When invoking the update rule on gazelle_python_manifest the output generated to the gazelle_python.yaml mapping file is not deterministic. This non-determinism causes the test rule (gazelle_python_manifest.test) to always fail.

馃敩 Minimal Reproduction

I've created a sample repository with a dependency that triggers this bug: https://github.com/abhishekshivanna/rules_python_bug

You can run bazel run //:gazelle_python_manifest.update to see that the gazelle_python.yaml constantly changes on subsequent runs.

馃敟 Exception or Error

bazel run //:gazelle_python_manifest.test
INFO: Analyzed target //:gazelle_python_manifest.test (8 packages loaded, 213 targets configured).
INFO: Found 1 target...
Target //:gazelle_python_manifest.test up-to-date:
  bazel-bin/gazelle_python_manifest.test
INFO: Elapsed time: 0.707s, Critical Path: 0.44s
INFO: 6 processes: 4 internal, 2 darwin-sandbox.
INFO: Build completed successfully, 6 total actions
INFO: Build completed successfully, 6 total actions
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:gazelle_python_manifest.test
-----------------------------------------------------------------------------
2022/08/28 19:36:37 ERROR: "/Users//code/rules_python_bug/gazelle_python.yaml" is out-of-date, follow the intructions on this file for updating.

馃實 Your Environment

Operating System:

  
Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64
  

Output of bazel version:

  
Bazelisk version: development
Build label: 5.2.0
Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 7 16:11:09 2022 (1654618269)
Build timestamp: 1654618269
Build timestamp as int: 1654618269
  

Rules_python version:

  
http_archive(
    name = "rules_python",
    sha256 = "a3a6e99f497be089f81ec082882e40246bfd435f52f4e82f37e89449b04573f6",
    strip_prefix = "rules_python-0.10.2",
    url = "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/bazelbuild/rules_python/archive/refs/tags/0.10.2.tar.gz",
)
  

Anything else relevant?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions