bazel-contrib / bazel-contrib/rules_python

Toolchain setup includes defunct "m"-suffixed includes

Đang mở
#3,281 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Starlark
Star
688
Fork
721
Merge trung bình
15 giờ 7 phút
Pull request đã merge (30 ngày)
76

Mô tả

Over in the setup of the python header targets, some code paths still add e.g. `include/pythonX.Ym` as includes paths.

In https://github.com/bazel-contrib/rules_python/pull/3274#discussion_r2357738084 nicholasjng pointed out the python-build-standalone don't appear to include such files anymore.

I'm pretty sure these m-suffixed things are a defunct Python notation for...something. Some quick searching turned up maybe something to do with the `--pymalloc` flag? https://peps.python.org/pep-3149/#:~:text=By%20default%20in%20Python%203.2%2C%20configure%20enables%20%2D%2Dwith%2Dpymalloc%20so%20shared%20library%20file%20names%20would%20appear%20as%20foo.cpython%2D32m.so.%20When%20the%20other%20two%20flags%20are%20also%20enabled%2C%20the%20file%20names%20would%20be%20foo.cpython%2D32dmu.so.

Gemini says:

> The Python build flag related to pymalloc was historically --with-pymalloc. This flag was used during the configuration phase when building Python from source. When enabled, it would configure Python to use its specialized object allocator, pymalloc, which is designed for performance and memory efficiency with small Python objects.
> Prior to Python 3.8, enabling --with-pymalloc would also result in an "m" flag being included in the SOABI (Shared Object Application Binary Interface) tag, which affected the naming of extension modules (e.g., python3.7m versus python3.7). This indicated that the build was configured with pymalloc.
> However, as of Python 3.8, pymalloc is enabled by default, and the --with-pymalloc build flag is no longer necessary or impactful in the same way. The "m" flag in the SOABI tag was also removed because pymalloc is now the standard allocator.

This sounds vaguely familar. I _think_ what it said is right.

In anycase, all signs point to that suffix being defunct, so we can remove the code that adds it.

* https://github.com/bazel-contrib/rules_python/blob/0cd9bfafc7ebf4cde2e4f84cab6ae756753f9660/python/private/hermetic_runtime_repo_setup.bzl#L124

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu tại python/private/hermetic_runtime_repo_setup.bzl, khoảng dòng 124, và lần theo phần thiết lập target header Python. Xác định các đường dẫn thêm include có hậu tố m và loại bỏ phần bổ sung đã lỗi thời đó. Hoàn tất khi toolchain không còn bao gồm các đường dẫn đó và phần thiết lập header Python vẫn hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.