Skip to content

Conversation

@eli-schwartz
Copy link
Member

No description provided.

We don't test shell integration in CI -- as is obvious from the fact
that commit 202d15d added additional
code that, in the testsuite would fatally error.

I don't think it is a good idea to add hacky workarounds for software
nobody understands or uses and isn't tested in CI. Which is a
description that has always fit "fish" like a glove (it is a shell that
doesn't even support being run as a login shell, among numerous other
issues).

In mesonbuild#15086 (review)
I raised concerns about its inclusion, but due to the holiday season was
unable to respond in the narrow window of time between being asked for
my reasons and the PR being merged without review. Still, the zsh
changes are great, let's keep them. Zsh is a widely used shell that is
well understood without hacks.
It was proposed to be added, but then questioned and removed in
mesonbuild#15086 (comment)

> I'm not sure this is correct. IIUC, this file is passed as a
> configuration file to bash thus it needs to be written with the system
> encoding, which in Python should be what you get when encoding is not
> specified.

It is insane(ly broken) to use a non-ascii-compatible encoding, and we
exclusively write ascii. We also test in CI that the encoding= argument
is *explicitly* passed, and we do so precisely because python 3.15
changes the meaning of `encoding=None` from "system encoding" to
"utf-8", so in the most absolute sense, it is simply wrong to review an
`encoding=` PR and say to remove the encoding to get the system
encoding.

The bash logic has had that problem forever; the zsh logic only since
the recent PR. Switch both to explicitly require utf-8, which is
ascii-compatible and everyone should use anyway.

Fixes:
```
Traceback (most recent call last):
  File ".../mesonbuild/mesonmain.py", line 193, in run
    return options.run_func(options)
           ~~~~~~~~~~~~~~~~^^^^^^^^^
  File ".../mesonbuild/mdevenv.py", line 226, in run
    tmprc = tempfile.NamedTemporaryFile(mode='w')
  File "/usr/lib/python3.13/tempfile.py", line 574, in NamedTemporaryFile
    encoding = _io.text_encoding(encoding)
EncodingWarning: 'encoding' argument not specified

ERROR: Unhandled python exception

    This is a Meson bug and should be reported!
```
prompt_command already has "[]" pre-added, so zsh ended up with e.g.

```
[[trivial test]] $
```

whereas bash used:
```
[trivial test] $
```
tmprc.flush()
args.append("--rcfile")
args.append(tmprc.name)
elif args[0].endswith('fish'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SIGINT issue was fixed upstream in 2019 and should be reverted. Don't know about the rest.

@dcbaker
Copy link
Member

dcbaker commented Oct 16, 2025

I don't have a comment on the first patch, but the fix encoding and double bracket patches are both r-b me.

I'm happy to merge those separately if the fish patch needs further discussion.

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.

4 participants