Dynamic control over ninja parallelism, or generic dynamic features
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- build-system, tooling
调研方向
先从 meson-python 现有的开发者接口和链接的 SciPy PR 18451 开始,然后比较 gh-159 版本的使用场景与 upstream ninja issue。完成标准是确定并记录一种机制,用于在 build 之前运行由 package 定义的 Python,并设置 compile-args 和 version 等受支持的属性。
由索引模型根据 Issue 内容生成。
描述
First the specific feature we need in SciPy: set the number of parallel compile jobs for ninja to equal the number of available physical cores (n_phys). We have a number of reports about the ninja default setting, which is 2*n_phys + 2, either giving out of memory errors or even crashing the build machine outright:
- https://github.com/scipy/scipy/issues/17941 is a report for a Chromebook running Debian (with a very good description of the problem and background info)
- https://github.com/scipy/scipy/issues/18443 reports the issue on multiple Windows machines, with a regular 8-core CPU and 16 GB RAM
- https://github.com/ninja-build/ninja/issues/2187 is a/the relevant upstream issue
For local development this was not difficult to address (see https://github.com/scipy/scipy/pull/18451), because SciPy has a developer interface where we can run custom code before invoking Meson. However, for pip install & co, there is no way to do that currently. So a user who may be installing some random package that happens to depend on SciPy may get crash or hang that we can't easily prevent. Hardcoding, say, -j4 is not great - there is no setting that works on low-end machines without throwing away lots of performance on high-end machines. The optimal settings seems to always be close to the number of physical cores.
So, ideally there would be a hook that meson-python exposes to package authors which can run arbitrary Python code to then set compile-args with.
I also see a more general pattern here, with gh-159 being another example of the need to execute code first and then set some build-related property (the package version in that case). It's a very similar case, and rather than a specific solution for each of these two problems, we may consider a general mechanism to deal with this kind of thing. Maybe a single Python function to execute, which must return a dict containing a pre-determined set of keys, including version, compile-args and the other *-args knobs.
Thoughts?
- 主要语言
- Python
- 星标
- 180
- 派生
- 93
- 平均合并
- 20 小时 58 分钟
- 30 天内合并 PR
- 22
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mesonbuild/meson-python 的其他 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
mesonbuild/meson-python#541 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
mesonbuild/meson-python#473 · 6 条评论 ·
维护者通常 1 天内回复
-
documentation enhancement tests
难度 5/5 一周以上 新手友好度 45/100
mesonbuild/meson-python#903 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 52/100
mesonbuild/meson-python#871 · 7 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
pip install overrides existing build configuration可能已有人在做 @Alvaro-Kothe 于 113 天前认领。 未关闭question
难度 3/5 1-2 天 新手友好度 68/100
mesonbuild/meson-python#851 · 6 条评论 ·
维护者通常 1 天内回复
查看 mesonbuild/meson-python 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
-
Harmony OPeNDAP SubSetter (HOSS) Geographic LARC_CLOUD PREFIRE_SAT2_AUX-SAT R01 production
难度 2/5 1-3 小时 新手友好度 68/100
nasa/harmony-autotester#245 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
Deltares/imod-python#1928 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
feature
难度 2/5 1-3 小时 新手友好度 66/100