Skip to content

Add encoding parameter to fix CI. #14792

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 1 commit into from
Jul 16, 2025
Merged

Add encoding parameter to fix CI. #14792

merged 1 commit into from
Jul 16, 2025

Conversation

jpakkane
Copy link
Member

The test does not actually fail, but the test runner seems to think that if anything gets printed to stderr, that is a failure.

https://nibblestew.blogspot.com/2019/04/an-important-message-for-people.html

The test does not actually fail, but the test runner seems to think
that if _anything_ gets printed to stderr, that is a failure.

https://nibblestew.blogspot.com/2019/04/an-important-message-for-people.html
@nirbheek
Copy link
Member

How does adding encoding/text parameters cause the test to not output to stderr? I would've thought that stderr=subprocess.STDOUT would be the fix here.

@eli-schwartz
Copy link
Member

eli-schwartz commented Jul 13, 2025

Python will print internal EncodingWarning for call sites that don't use encoding='utf-8', because the CI exports an environment variable that makes it treat them as a warning.

Unfortunately python upstream has chosen to make it impossible to use an environment variable to only produce EncodingWarning for specific modules (in particular we care about this for mesonbuild.*) so we have to first trigger the warnings like this and then make them "werror" by running code in mesonmain.py using the warnings module. So it "leaks" into the test runner even though we don't actually want it to.

However, I don't either get why this would be an error. The warning would happen in process by the test runner logic but not coming from the subprocess. It is run_meson_command_tests.py that will print an encoding warning, surely. What is checking for noisy stderr there?

@nirbheek
Copy link
Member

It's powershell on Azure CI: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/powershell-v1?view=azure-pipelines

failOnStandardError - Fail on Standard Error
boolean. Default value: true.

If the value of this boolean is true, the task fails if any errors are written to the error pipeline or if any data is written to the Standard Error stream. Otherwise, the task relies on the exit code to determine failure.

So setting that to false will fix it.

@jpakkane
Copy link
Member Author

What is checking for noisy stderr there?

The testing framework itself.

@jpakkane
Copy link
Member Author

So setting that to false will fix it.

This is an issue that keeps popping up. It's better to fix it properly rather than disable in build settings, because if you do the latter, this will keep reappearing in the future as test and CI frameworks change.

@jpakkane jpakkane merged commit e7c71e7 into master Jul 16, 2025
36 checks passed
@jpakkane jpakkane deleted the fixci_again branch July 16, 2025 19: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.

3 participants