Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Gazelle occasionally overwrites py_binary targets when new .py files are added #2670

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

Closed
michael-christen opened this issue Mar 16, 2025 · 0 comments

Comments

@michael-christen
Copy link
Contributor

michael-christen commented Mar 16, 2025

🐞 bug report

Affected Rule

  • py_binary

Is this a regression?

I don't think this is a regression as I've seen this since I started using gazelle.

Description

When running gazelle on a directory with a new .py file that satisfies the constraints for a py_binary, it will replace existing py_binary definitions for this new .py file.

🔬 Minimal Reproduction

Here's a reproduction on my personal repo, lmk if it'd be easier to make a whole new repo:

michael-christen/toolbox#213

I'm not having much luck with a simpler attempt at reproduction:

🔥 Exception or Error

No exception, just a silent overriding of behavior.

🌍 Your Environment

Operating System:

  
± lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy
  

Output of bazel version:

  
± bazel version
Bazelisk version: v1.24.1
INFO: Invocation ID: ef6a53a8-04a1-4f25-a901-b8283410ff9e
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0
  

bazel commit: bazelbuild/bazel@0ddcfd3

Rules_python version:

  
0.34.0
  

Anything else relevant?

I've seen this across a wide variety of repos and setups.

# gazelle:python_generation_mode file

is configured in BUILD

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

No branches or pull requests

1 participant