`other.test_cmake_cxx_import_std` fails on CMake 3.30–4.0.2 due to missing `CMAKE_EXPERIMENTAL_CXX_IMPORT_STD` UUIDs

Abierto Apto para principiantes
#28,160 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@subhaushsingh ya está trabajando en esto.

Desde el 4/11/2026.

  • #28165 de @subhaushsingh — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
85/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cmake, cpp

Línea de trabajo

Lee test/cmake/cxx_import_std/CMakeLists.txt y compara sus ramas de versiones de CMake con los intervalos de versiones del issue. Actualiza la selección experimental de UUID para CMake 3.30–3.31 y 4.0.0–4.0.2; luego ejecuta other.test_cmake_cxx_import_std de test/test_other.py con esas versiones de CMake. El trabajo estará terminado cuando la prueba se configure y compile correctamente con las versiones afectadas.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I found this when testing on a VM with a newer version of CMake than what we are currently testing:

Description

cmake/Modules/Platform/Emscripten.cmake supports CMAKE_CXX_MODULE_STD on CMake >= 3.30 (added in #27065), and other.test_cmake_cxx_import_std in test/test_other.py runs whenever CMake >= (3, 30) is detected.

However, test/cmake/cxx_import_std/CMakeLists.txt only sets CMAKE_EXPERIMENTAL_CXX_IMPORT_STD for CMake >= 4.3.0 and 4.0.3..4.2.x:

cmake_minimum_required(VERSION 3.30)

set(CMAKE_CXX_MODULE_STD ON)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.3.0)
  set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD 451f2fe2-a8a2-47c3-bc32-94786d8fc91b)
else()
  set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD d0edc3af-4c50-42ea-a356-e2862fe7a444)
endif()

Because CircleCI's Linux Docker image (emscripten/emscripten-ci:jammy.v2) has CMake 3.22.1 and test_cmake_cxx_import_std is not marked @crossplatform, the test is currently skipped on CircleCI. On environments with CMake 3.30–3.31 (such as Ubuntu 24.04 / GitHub Actions ubuntu-latest with CMake 3.31.6) or CMake 4.0.0–4.0.2, CMake rejects the UUID and disables import std:

CMake Warning (dev) at /usr/share/cmake-3.31/Modules/Compiler/CMakeCommonCompilerMacros.cmake:248 (message):
  CMAKE_EXPERIMENTAL_CXX_IMPORT_STD is set to incorrect value
  "d0edc3af-4c50-42ea-a356-e2862fe7a444".  See `Help/dev/experimental.rst`
  for CMake's C++ `import std` support.
...
CMake Error in CMakeLists.txt:
  The "CXX_MODULE_STD" property on the target "cxx_import_std23" requires
  that the "__cmake_cxx23" target exist, but it was not provided by the
  toolchain.
...
test/cmake/cxx_import_std/main.cpp:1:8: fatal error: module 'std' not found
    1 | import std;
      | ~~~~~~~^~~
Proposed Fix

Update test/cmake/cxx_import_std/CMakeLists.txt to include the experimental gate UUIDs for CMake 3.30.0–3.31.x (0e5b6991-d74f-4b3d-a41c-cf096e0b2508) and CMake 4.0.0–4.0.2 (a9e1cf81-9932-4810-974b-6eccaf14e457):

if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.3.0)
  set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD 451f2fe2-a8a2-47c3-bc32-94786d8fc91b)
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL 4.0.3)
  set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD d0edc3af-4c50-42ea-a356-e2862fe7a444)
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL 4.0.0)
  set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD a9e1cf81-9932-4810-974b-6eccaf14e457)
else()
  set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD 0e5b6991-d74f-4b3d-a41c-cf096e0b2508)
endif()
Lenguaje dominante
C++
Estrellas
27.8k
Forks
3.6k
Merge medio
1 d 6 h
PR fusionados (30 d)
181

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de emscripten-core/emscripten

Todos los issues de emscripten-core/emscripten

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.