Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Can't build a project that contain only ``library()``

未关闭
#842 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
linux, macos, python

调研方向

从链接的复现项目中的 meson.build 以及 issue 中描述的 workflow 命令开始,然后比较 Windows、Linux 和 macOS 上的 wheel 构建。复现缺少 .lib 导致的失败,并检查生成的 wheel 标签;完成的标准是一个仅包含库的项目能够在所有报告的平台上构建,并获得预期的 wheel 兼容性标签。

由索引模型根据 Issue 内容生成。

描述

not-a-bug

Problem 1
When building my wheel on windows, I get this error:

[1/2] D:\a\test_meson\test_meson\.mesonpy-v0dib87v\example.dll
[2/2] D:\a\test_meson\test_meson\.mesonpy-v0dib87v\example.lib
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.13.12\x64\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
    main()
    ~~~~^^
  File "C:\hostedtoolcache\windows\Python\3.13.12\x64\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.13.12\x64\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 280, in build_wheel
    return _build_backend().build_wheel(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        wheel_directory, config_settings, metadata_directory
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\runneradmin\AppData\Local\Temp\build-env-03i4_as2\Lib\site-packages\mesonpy\__init__.py", line 1203, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\runneradmin\AppData\Local\Temp\build-env-03i4_as2\Lib\site-packages\mesonpy\__init__.py", line 1257, in build_wheel
    return project.wheel(out).name
           ~~~~~~~~~~~~~^^^^^
  File "C:\Users\runneradmin\AppData\Local\Temp\build-env-03i4_as2\Lib\site-packages\mesonpy\__init__.py", line 1100, in wheel
    return builder.build(directory)
           ~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\runneradmin\AppData\Local\Temp\build-env-03i4_as2\Lib\site-packages\mesonpy\__init__.py", line 511, in build
    self._install_path(whl, src, dst)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\AppData\Local\Temp\build-env-03i4_as2\Lib\site-packages\mesonpy\__init__.py", line 465, in _install_path
    wheel_file.write(origin, destination.as_posix())
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\AppData\Local\Temp\build-env-03i4_as2\Lib\site-packages\mesonpy\_wheelfile.py", line 97, in write
    with open(filename, 'rb') as f:
         ~~~~^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\a\\test_meson\\test_meson\\.mesonpy-v0dib87v\\example.lib'
ERROR Backend subprocess exited when trying to invoke build_wheel

Problem 2
On platform where I can build the wheel without issue, even thought I don't use python extension, the wheel is named like this: example-1.0.0-cp313-cp313-linux_x86_64.whl, example-1.0.0-cp313-cp313-macosx_15_0_arm64.whl.
I would have expected to be example-1.0.0-py3-none-linux_x86_64.whl, example-1.0.0-py3-none-macosx_15_0_arm64.whl.

How to reproduce
You can get the project here: https://github.com/moi15moi/test_meson
It is a really simple project. The meson.build just contain a library().

Note that you can see how I builded the wheel in the workflow: https://github.com/moi15moi/test_meson/actions/runs/24110794731
On unix, I used the command python -m build --wheel and on windows, I used the command python -m build --wheel -Csetup-args="--vsenv".

主要语言
Python
星标
180
派生
93
平均合并
20 小时 58 分钟
30 天内合并 PR
22

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mesonbuild/meson-python 的其他 Issue

查看 mesonbuild/meson-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。