Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Linking broken on Linux x86-64?

Abierto
#13 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cmake, rust
Área
build-system

Línea de trabajo

Comienza con CMakeLists.txt y el subdirectorio hello, luego inspecciona el hello/CMakeFiles/hello.dir/link.txt generado y reproduce el comportamiento con make VERBOSE=1. Rastrea por qué la regla de compilación de Rust produce un objeto, pero la regla de enlazado solo muestra variables; el trabajo está terminado cuando construir hello crea un ejecutable enlazado en lugar de solo hello.rs.o.

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

Descripción

The included example hello binary seems to be disabled. After enabling it...:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52419eb..d033346 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 enable_language(Rust)
 include(CMakeCargo)
 
+add_subdirectory(hello)
 add_subdirectory(hello_world)
 add_subdirectory(crates)

an object file is generated but no linked executable:

$ find build/hello
build/hello
build/hello/Makefile
build/hello/CMakeFiles
build/hello/CMakeFiles/hello.dir
build/hello/CMakeFiles/hello.dir/link.txt
build/hello/CMakeFiles/hello.dir/flags.make
build/hello/CMakeFiles/hello.dir/hello.rs.o
build/hello/CMakeFiles/hello.dir/depend.internal
build/hello/CMakeFiles/hello.dir/cmake_clean.cmake
build/hello/CMakeFiles/hello.dir/build.make
build/hello/CMakeFiles/hello.dir/DependInfo.cmake
build/hello/CMakeFiles/hello.dir/progress.make
build/hello/CMakeFiles/hello.dir/depend.make
build/hello/CMakeFiles/CMakeDirectoryInformation.cmake
build/hello/CMakeFiles/progress.marks
build/hello/cmake_install.cmake

It looks like the link step is just echoing some commands. Am I missing something?

CMakeRust/build/hello$ make VERBOSE=1
cd /home/jnewsome/src/CMakeRust/build && /usr/bin/cmake -H/home/jnewsome/src/CMakeRust -B/home/jnewsome/src/CMakeRust/build --check-build-system CMakeFiles/Makefile.cmake 0
cd /home/jnewsome/src/CMakeRust/build && /usr/bin/cmake -E cmake_progress_start /home/jnewsome/src/CMakeRust/build/CMakeFiles /home/jnewsome/src/CMakeRust/build/hello/CMakeFiles/progress.marks
cd /home/jnewsome/src/CMakeRust/build && make -f CMakeFiles/Makefile2 hello/all
make[1]: Entering directory '/home/jnewsome/src/CMakeRust/build'
make -f hello/CMakeFiles/hello.dir/build.make hello/CMakeFiles/hello.dir/depend
make[2]: Entering directory '/home/jnewsome/src/CMakeRust/build'
cd /home/jnewsome/src/CMakeRust/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/jnewsome/src/CMakeRust /home/jnewsome/src/CMakeRust/hello /home/jnewsome/src/CMakeRust/build /home/jnewsome/src/CMakeRust/build/hello /home/jnewsome/src/CMakeRust/build/hello/CMakeFiles/hello.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/jnewsome/src/CMakeRust/build'
make -f hello/CMakeFiles/hello.dir/build.make hello/CMakeFiles/hello.dir/build
make[2]: Entering directory '/home/jnewsome/src/CMakeRust/build'
[ 50%] Building Rust object hello/CMakeFiles/hello.dir/hello.rs.o
cd /home/jnewsome/src/CMakeRust/build/hello && echo "CMAKE_Rust_COMPILE_OBJECT"
CMAKE_Rust_COMPILE_OBJECT
cd /home/jnewsome/src/CMakeRust/build/hello && echo "TARGET: hello TARGET_BASE: hello  OBJECT: CMakeFiles/hello.dir/hello.rs.o OBJECTS: OBJECTS OBJECT_DIR: CMakeFiles/hello.dir SOURCE: /home/jnewsome/src/CMakeRust/hello/hello.rs SOURCES: SOURCES  LINK_LIBRARIES: LINK_LIBRARIES FLAGS:  LINK_FLAGS: LINK_FLAGS "
TARGET: hello TARGET_BASE: hello  OBJECT: CMakeFiles/hello.dir/hello.rs.o OBJECTS: OBJECTS OBJECT_DIR: CMakeFiles/hello.dir SOURCE: /home/jnewsome/src/CMakeRust/hello/hello.rs SOURCES: SOURCES  LINK_LIBRARIES: LINK_LIBRARIES FLAGS:  LINK_FLAGS: LINK_FLAGS 
cd /home/jnewsome/src/CMakeRust/build/hello && /home/jnewsome/.cargo/bin/rustc --emit obj /home/jnewsome/src/CMakeRust/hello/hello.rs -o CMakeFiles/hello.dir/hello.rs.o
[100%] Linking Rust executable hello
cd /home/jnewsome/src/CMakeRust/build/hello && /usr/bin/cmake -E cmake_link_script CMakeFiles/hello.dir/link.txt --verbose=1
echo "CMAKE_Rust_LINK_EXECUTABLE"
CMAKE_Rust_LINK_EXECUTABLE
echo "TARGET: hello TARGET_BASE: hello  OBJECT: OBJECT OBJECTS: CMakeFiles/hello.dir/hello.rs.o OBJECT_DIR: CMakeFiles/hello.dir SOURCE: SOURCE SOURCES: SOURCES  LINK_LIBRARIES:  FLAGS:  LINK_FLAGS:  "
TARGET: hello TARGET_BASE: hello  OBJECT: OBJECT OBJECTS: CMakeFiles/hello.dir/hello.rs.o OBJECT_DIR: CMakeFiles/hello.dir SOURCE: SOURCE SOURCES: SOURCES  LINK_LIBRARIES:  FLAGS:  LINK_FLAGS:  
make[2]: Leaving directory '/home/jnewsome/src/CMakeRust/build'
[100%] Built target hello
make[1]: Leaving directory '/home/jnewsome/src/CMakeRust/build'
/usr/bin/cmake -E cmake_progress_start /home/jnewsome/src/CMakeRust/build/CMakeFiles 0
Lenguaje dominante
CMake
Estrellas
175
Forks
30
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

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 Devolutions/CMakeRust

Todos los issues de Devolutions/CMakeRust

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.