Python packaging tools can't resolve the package metadata without `libsystemd`
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Domínio
- build-system
Direção de pesquisa
Start by reproducing the uv sync failure for systemd-python==235 on a non-Linux platform without libsystemd, then read the Meson build configuration and the linked meson-python issue. Evaluate the proposed optional C-extension approach; done means package metadata can be resolved without those libraries while preserving the stated runtime behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I ran into this whilst trying to move my project to replace poetry with uv.
One interesting property of uv, is that it creates a lockfile that works for all platforms. This means that even if systemd-python is only installed on Linux ("systemd-python>=231; sys_platform == 'linux'" in the dependencies), it needs to be able to resolve the package metadata.
The problem is, as far as I can tell, mesonpy always run the meson build, even just for resolving the package metadata. And because the current meson build will hard-fail if libsystemd isn't available, regardless of the platform, it makes generating/updating the uv lockfile impossible on non-linux platforms.
❯ uv sync
× Failed to build `systemd-python==235`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)
[stderr]
Cannot find libsystemd or libsystemd-journal:
Package libsystemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd' found
Package libsystemd-journal was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd-journal.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd-journal' found
hint: This usually indicates a problem with the package or the build environment.
help: `systemd-python` (v235) was included because `matrix-synapse[systemd]` (v1.148.0rc1) depends on `systemd-python>=231`
Some background about this issue on the mesonpy side can be read here: https://github.com/mesonbuild/meson-python/issues/236
Now, this could be solved by making the C extension optional, and throw at runtime if it was built without it. It's not ideal, it would stop failing at build-time, but would make it possible to use python-systemd in projects using uv without requiring libsystemd to be available
Another very creative solution would be to write a special build backend which delegates to mesonpy in most cases, but provides its own prepare_metadata_for_build_wheel implementation… but that feels a bit overkill
Last but not least, using another build backend than mesonpy could be a solution, but definitely more involved.
I'll put up a draft PR for the first solution shortly to let you evaluate how that feels
- Linguagem predominante
- C
- Estrelas
- 522
- Forks
- 79
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de systemd/python-systemd
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
systemd/python-systemd#177 · 1 comentário · 1 reação ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
systemd/python-systemd#169 · 1 comentário ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
systemd/python-systemd#152 · 1 comentário · 13 reações ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
systemd/python-systemd#146 · 2 comentários ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
systemd/python-systemd#143 · 3 comentários ·
Todas as issues de systemd/python-systemd
Issues semelhantes
-
os:linux
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
mpv-player/mpv#18510 · 2 comentários ·
-
internal.h中,漏掉了1个定义。 Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 95/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Broadcast Documentation Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
kovidgoyal/kitty#10516 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 80/100