[HACL] The `HACL_CAN_COMPILE_VEC128` macro is not defined when building Python with `-Wundef`
Los mantenedores suelen responder en 1 día
@tamaki0575-cloud ya está trabajando en esto.
Desde el 21/11/2026.
- #162393 de @tamaki0575-cloud — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 64/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- build-system
Línea de trabajo
Las advertencias provienen de #if HACL_CAN_COMPILE_VEC128 / ..._VEC256 en Modules/_hacl/Hacl_Streaming_HMAC.c (unos 18 sitios), mientras que Modules/blake2module.c y Modules/hmacmodule.c muestran cómo se reenvían normalmente las macros desde _Py_HACL_CAN_COMPILE_VEC*. Primero decide el lugar de la corrección: proteger cada #if en el archivo .c, o definir las macros en Modules/_hacl/internal/Hacl_Streaming_HMAC.h — comprueba cómo se vendorizan/regeneran las fuentes _hacl antes de editar, ya que los archivos generados pueden sobrescribirse. Recompila con -Wundef (ver gh-162214) y confirma que las advertencias de Hacl_Streaming_HMAC han desaparecido; hecho significa una compilación limpia, no solo silenciosa.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 78.4k
- Forks
- 36.6k
- Merge medio
- 23 h 34 min
- PR fusionados (30 d)
- 610
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python/cpython
-
interpreter-core type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
stdlib topic-subprocess type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
corner case: base64.b32decode ignorechars=b'=' miscounts paddingPosiblemente ocupada @ElDShell la tomó hoy. Abierto3.15 easy type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
python/cpython#162353 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
TracebackException.lineno changes from str to int after format() when a keyword typo suggestion is foundPosiblemente ocupada @Sudhakar7J la tomó hace 2 días. Abiertostdlib type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
python/cpython#162296 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
zipfile: ZipInfo.comment exceeding 65535 bytes causes struct.error in ZipFile.close() without proper validationPosiblemente ocupada @1cbyc la tomó hace 5 días. Abiertostdlib type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
Todos los issues de python/cpython
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
vllm-project/vllm#69304 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
pydanty:is-working
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pydantic/pydantic-ai#14187 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
test
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
prebid/salesagent#2676 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 62/100
sunososobro-hub/cloudball#339 ·
Los mantenedores suelen responder en 1 día