Skip to content

Also print fixed ... messages with -stdout#1373

Merged
vladmos merged 3 commits intobazelbuild:mainfrom
fmeum:stdout-modified
Sep 30, 2025
Merged

Also print fixed ... messages with -stdout#1373
vladmos merged 3 commits intobazelbuild:mainfrom
fmeum:stdout-modified

Conversation

@fmeum
Copy link
Contributor

@fmeum fmeum commented Jun 21, 2025

This makes it easier for users to implement a "check only" mode that doesn't modify any files, but is able to tell which ones would have been changed by buildozer.

Work towards bazelbuild/bazel#24263

@fmeum
Copy link
Contributor Author

fmeum commented Jun 21, 2025

@Wyverald FYI

@dws
Copy link
Contributor

dws commented Sep 24, 2025

+1 to getting this landed

@fmeum
Copy link
Contributor Author

fmeum commented Sep 24, 2025

@vladmos

This makes it easier for users to implement a "check only" mode that doesn't modify any files, but is able to tell which ones would have been changed by buildozer.
@fmeum fmeum requested a review from oreflow September 26, 2025 16:53
@vladmos vladmos merged commit 2eb4fcc into bazelbuild:main Sep 30, 2025
2 checks passed
@fmeum fmeum deleted the stdout-modified branch September 30, 2025 14:08
@fmeum
Copy link
Contributor Author

fmeum commented Sep 30, 2025

@vladmos Would it be possible to get this released so that Bazel can start depending on this behavior?

@vladmos
Copy link
Member

vladmos commented Oct 1, 2025

@fmeum This change causes some failures internally and may need to be reverted. The feedback I got:

This change seems on the surface desirable as it corrects the flaw that without the "modified:" argument, the consumer could not distinguish RETURN_CODE_OK_NO_CHANGES from RETURN_CODE_OK. (It was getting "NO_CHANGES" no matter what). Unfortunately it causes problems with Python API users that have "out, err = buildozer.Buildozer().invoke()" because the secondary value is now the non-empty contents of stderr which is treated as a success/fail indicator (empty string = good).

Do you have any reasonable changes in mind that would both satisfy your needs and are not breaking at the same point? Or at least easy to fix on the consumer side (without actually parsing stderr)?

@fmeum
Copy link
Contributor Author

fmeum commented Oct 1, 2025

It does seem wrong to me to treat stderr != "" as indicating an error. Would consumers be able to check the exit code somehow? Is the buildozer Python API public?

@meteorcloudy
Copy link
Member

@fmeum @vladmos This seems to still blocking the progress of bazelbuild/bazel#25540?

@oreflow in case you could help

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.

5 participants