[HACL] The `HACL_CAN_COMPILE_VEC128` macro is not defined when building Python with `-Wundef`
Maintainer thường phản hồi trong vòng 1 ngày
@tamaki0575-cloud đang làm issue này rồi.
Từ ngày 21/11/2026.
- #162393 của @tamaki0575-cloud — đang mở
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 64/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- build-system
Hướng nghiên cứu
Các cảnh báo đến từ #if HACL_CAN_COMPILE_VEC128 / ..._VEC256 trong Modules/_hacl/Hacl_Streaming_HMAC.c (khoảng 18 vị trí), trong khi Modules/blake2module.c và Modules/hmacmodule.c cho thấy các macro thường được chuyển tiếp từ _Py_HACL_CAN_COMPILE_VEC* như thế nào. Trước tiên hãy quyết định vị trí sửa: bảo vệ từng #if trong file .c, hoặc định nghĩa các macro trong Modules/_hacl/internal/Hacl_Streaming_HMAC.h — kiểm tra cách các nguồn _hacl được vendored/tạo lại trước khi chỉnh sửa, vì các file được tạo có thể bị ghi đè. Build lại với -Wundef (xem gh-162214) và xác nhận các cảnh báo Hacl_Streaming_HMAC đã biến mất; hoàn tất nghĩa là một build sạch, không chỉ là một build im lặng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The HACL_CAN_COMPILE_VEC128 and HACL_CAN_COMPILE_VEC256 macros are not defined when building Python with -Wundef. See issue gh-162214 for -Wundef flag.
Build logs:
gcc -Wno-unused-variable -c -I./Modules/_hacl -I./Modules/_hacl/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-overflow -Wsign-compare -g -Og -Wall -Wundef -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -fPIC -o Modules/_hacl/Hacl_Streaming_HMAC.o ./Modules/_hacl/Hacl_Streaming_HMAC.c
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function 'malloc_':
./Modules/_hacl/Hacl_Streaming_HMAC.c:477:13: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
477 | #if HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:540:13: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
540 | #if HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function 'init':
./Modules/_hacl/Hacl_Streaming_HMAC.c:654:9: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
654 | #if HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:671:9: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
671 | #if HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function 'update_multi':
./Modules/_hacl/Hacl_Streaming_HMAC.c:771:9: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
771 | #if HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:796:9: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
796 | #if HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function 'update_last':
./Modules/_hacl/Hacl_Streaming_HMAC.c:897:9: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
897 | #if HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:921:9: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
921 | #if HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function 'finish':
./Modules/_hacl/Hacl_Streaming_HMAC.c:1043:9: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
1043 | #if HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:1060:9: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
1060 | #if HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function 'copy':
./Modules/_hacl/Hacl_Streaming_HMAC.c:1342:9: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
1342 | #if HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:1381:9: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
1381 | #if HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function 'hash':
./Modules/_hacl/Hacl_Streaming_HMAC.c:1468:13: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
1468 | #if HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:1480:13: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
1480 | #if HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c: In function '_Py_LibHacl_Hacl_Streaming_HMAC_malloc_':
./Modules/_hacl/Hacl_Streaming_HMAC.c:1971:8: warning: 'HACL_CAN_COMPILE_VEC256' is not defined, evaluates to '0' [-Wundef]
1971 | #if !HACL_CAN_COMPILE_VEC256
| ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_hacl/Hacl_Streaming_HMAC.c:1977:8: warning: 'HACL_CAN_COMPILE_VEC128' is not defined, evaluates to '0' [-Wundef]
1977 | #if !HACL_CAN_COMPILE_VEC128
| ^~~~~~~~~~~~~~~~~~~~~~~
One solution would be to replace #if HACL_CAN_COMPILE_VEC128 with #if defined(HACL_CAN_COMPILE_VEC128) && HACL_CAN_COMPILE_VEC128 (and same change for the 256 macro) in Modules/_hacl/Hacl_Streaming_HMAC.c.
Modules/blake2module.c and Modules/hmacmodule.c define the two macros. Example:
#if defined(__APPLE__) && defined(__arm64__)
# undef _Py_HACL_CAN_COMPILE_VEC128
# undef _Py_HACL_CAN_COMPILE_VEC256
#endif
// HACL* expects HACL_CAN_COMPILE_VEC* macros to be set in order to enable
// the corresponding SIMD instructions so we need to "forward" the values
// we just deduced above.
#define HACL_CAN_COMPILE_VEC128 _Py_HACL_CAN_COMPILE_VEC128
#define HACL_CAN_COMPILE_VEC256 _Py_HACL_CAN_COMPILE_VEC256
But Modules/_hacl/internal/Hacl_Streaming_HMAC.h doesn't set these macros.
- Ngôn ngữ chính
- Python
- Star
- 78.4k
- Fork
- 36.6k
- Merge trung bình
- 23 giờ 34 phút
- Pull request đã merge (30 ngày)
- 610
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python/cpython
-
interpreter-core type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
stdlib topic-subprocess type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
corner case: base64.b32decode ignorechars=b'=' miscounts paddingCó thể đã có người làm @ElDShell đã nhận hôm nay. Đang mở3.15 easy type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
python/cpython#162353 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TracebackException.lineno changes from str to int after format() when a keyword typo suggestion is foundCó thể đã có người làm @Sudhakar7J đã nhận 2 ngày trước. Đang mởstdlib type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
python/cpython#162296 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
zipfile: ZipInfo.comment exceeding 65535 bytes causes struct.error in ZipFile.close() without proper validationCó thể đã có người làm @1cbyc đã nhận 5 ngày trước. Đang mởstdlib type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của python/cpython
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
vllm-project/vllm#69304 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pydantic/pydantic-ai#14187 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
prebid/salesagent#2676 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 62/100
sunososobro-hub/cloudball#339 ·
Maintainer thường phản hồi trong vòng 1 ngày