-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Build on Debian 11 #2518
Comments
Hi, The log doesn't seem to contain the actual error. Is there more to it before? |
I can't reproduce this either. Could you try running with build with |
ninja -v |
unky@linux-dell-9010:~/develop/EvaluationSlintUi/build/Debug/_deps/slint-build$ ./slint-compiler --version I Think the Lint Compiler has an Problem but say noting |
So what does this do:
What is the exit code? Any errors? What about the second part of the failing command line:
The last is in one line just in case github messed this up... |
I tried to reproduce with your repository, but it compile fine. Can you try passing |
punky@linux-dell-9010:~/develop/EvaluationSlintUi/build/Debug$ /usr/local/bin/cmake -E cmake_transform_depfile Ninja gccdepfile \
/home/punky/develop/EvaluationSlintUi \
/home/punky/develop/EvaluationSlintUi/src/TestApp \
/home/punky/develop/EvaluationSlintUi/build/Debug \
/home/punky/develop/EvaluationSlintUi/build/Debug/src/TestApp \
/home/punky/develop/EvaluationSlintUi/build/Debug/src/TestApp/mainWindow.d \
/home/punky/develop/EvaluationSlintUi/build/Debug/CMakeFiles/d/8f95644e58f18a99ff162d2792d2da53bacea92e8d2ac4a377c38039aab95a7c.d
punky@linux-dell-9010:~/develop/EvaluationSlintUi/build/Debug$ echo $?
2 punky@linux-dell-9010:~/develop/EvaluationSlintUi/build/Debug$ /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build/slint-compiler /home/punky/develop/EvaluationSlintUi/src/ui/mainWindow.slint -o src/TestApp/mainWindow.h --depfile src/TestApp/mainWindow.d --style fluent --embed-resources=as-absolute-path
punky@linux-dell-9010:~/develop/EvaluationSlintUi/build/Debug$ echo $?
0 punky@linux-dell-9010:~/develop/EvaluationSlintUi/build/Debug$ cmake --build . -v
[0/7] cd /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-src/api/cpp && /usr/local/bin/cmake -E env SLINT_GENERATED_INCLUDE_DIR=/home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build/generated_include/ SLINT_NO_QT=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/x86_64-linux-gnu-g++-10 CC_x86_64-unknown-linux-gnu=/usr/bin/x86_64-linux-gnu-gcc-10 CXX_x86_64-unknown-linux-gnu=/usr/bin/x86_64-linux-gnu-g++-10 CORROSION_BUILD_DIR=/home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build CARGO_BUILD_RUSTC=/home/punky/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc /home/punky/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo rustc --lib --target=x86_64-unknown-linux-gnu --no-default-features --features=interpreter,backend-winit,renderer-winit-femtovg --package slint-cpp --manifest-path /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-src/api/cpp/Cargo.toml --target-dir /home/punky/develop/EvaluationSlintUi/build/Debug/./cargo/build -- -Cdefault-linker-libraries=yes
Finished dev [unoptimized + debuginfo] target(s) in 0.25s
[1/7] cd /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-src/tools/compiler && /usr/local/bin/cmake -E env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/x86_64-linux-gnu-g++-10 CC_x86_64-unknown-linux-gnu=/usr/bin/x86_64-linux-gnu-gcc-10 CXX_x86_64-unknown-linux-gnu=/usr/bin/x86_64-linux-gnu-g++-10 CORROSION_BUILD_DIR=/home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build CARGO_BUILD_RUSTC=/home/punky/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc /home/punky/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo rustc --bin=slint-compiler --target=x86_64-unknown-linux-gnu --package slint-compiler --manifest-path /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-src/tools/compiler/Cargo.toml --target-dir /home/punky/develop/EvaluationSlintUi/build/Debug/./cargo/build -- -Cdefault-linker-libraries=yes
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
[2/7] cd /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build && /usr/local/bin/cmake -E make_directory /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build && /usr/local/bin/cmake -E copy_if_different /home/punky/develop/EvaluationSlintUi/build/Debug/./cargo/build/x86_64-unknown-linux-gnu/debug/libslint_cpp.so /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build
[4/7] cd /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build && /usr/local/bin/cmake -E make_directory /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build && /usr/local/bin/cmake -E copy_if_different /home/punky/develop/EvaluationSlintUi/build/Debug/./cargo/build/x86_64-unknown-linux-gnu/debug/slint-compiler /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build
[5/7] cd /home/punky/develop/EvaluationSlintUi/build/Debug && /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build/slint-compiler /home/punky/develop/EvaluationSlintUi/src/ui/mainWindow.slint -o src/TestApp/mainWindow.h --depfile src/TestApp/mainWindow.d --style fluent --embed-resources=as-absolute-path && /usr/local/bin/cmake -E cmake_transform_depfile Ninja gccdepfile /home/punky/develop/EvaluationSlintUi /home/punky/develop/EvaluationSlintUi/src/TestApp /home/punky/develop/EvaluationSlintUi/build/Debug /home/punky/develop/EvaluationSlintUi/build/Debug/src/TestApp /home/punky/develop/EvaluationSlintUi/build/Debug/src/TestApp/mainWindow.d /home/punky/develop/EvaluationSlintUi/build/Debug/CMakeFiles/d/8f95644e58f18a99ff162d2792d2da53bacea92e8d2ac4a377c38039aab95a7c.d
FAILED: src/TestApp/mainWindow.h /home/punky/develop/EvaluationSlintUi/build/Debug/src/TestApp/mainWindow.h
cd /home/punky/develop/EvaluationSlintUi/build/Debug && /home/punky/develop/EvaluationSlintUi/build/Debug/_deps/slint-build/slint-compiler /home/punky/develop/EvaluationSlintUi/src/ui/mainWindow.slint -o src/TestApp/mainWindow.h --depfile src/TestApp/mainWindow.d --style fluent --embed-resources=as-absolute-path && /usr/local/bin/cmake -E cmake_transform_depfile Ninja gccdepfile /home/punky/develop/EvaluationSlintUi /home/punky/develop/EvaluationSlintUi/src/TestApp /home/punky/develop/EvaluationSlintUi/build/Debug /home/punky/develop/EvaluationSlintUi/build/Debug/src/TestApp /home/punky/develop/EvaluationSlintUi/build/Debug/src/TestApp/mainWindow.d /home/punky/develop/EvaluationSlintUi/build/Debug/CMakeFiles/d/8f95644e58f18a99ff162d2792d2da53bacea92e8d2ac4a377c38039aab95a7c.d
ninja: build stopped: subcommand failed. Display no Error or Warning is my Problem to find an solution. |
Great, so the Slint compiler runs fine, cmake fails afterwards when trying to process the files. In CMake 3.26 I can not find any docs on what that command does, only hints about that it changed in version 3.20. So maybe this is one of those areas in flux in CMake at this time? Which version of CMake are you using? Debian 11 apparently has cmake version 3.18.4, which is too old for us. I assume you use a newer one? Maybe it is due to cmake 3.20+ generating the build system and then somehow cmake 3.18 ends up driving the build? CMake should catch that though. Your demo project builds fine on Windows 11 using cmake 3.26.2, but that does of course not help you on Debian 11 ;-) |
On my Debian the CMake version is 3.21.3 On Windows 10 With CMake 3.26.3 and VS 2022 Compiler it also can Compile. On Debian with CMake 3.26.3 is also Compiling now but the path to libslint_cpp.so is hardcoded why ? punky@linux-dell-9010:~/develop/EvaluationSlintUi/bin/Linux$ ./SlintUiTestApp.bin
./SlintUiTestApp.bin: error while loading shared libraries: _deps/slint-build/libslint_cpp.so: cannot open shared object file: No such file or directory |
Do you happen to know what you did to make your code build on Debian 11? Anything we can try to handle/document for the next user? |
I don't know what the problem is in CMake. I don't understand this |
So I can close this issue :-) Please feel free to open another one about your linking issue. You asked CMake to fetch and build Slint in your CMakeLists.txt. It did and put it into |
Can you explain a little what the problem is? Does it not find the library when running, or do you want to prepare your binary for distribution and therefore replace the absolute path with a path relative to the binary? If it's the latter, then perhaps you may want to run chrpath on the binary and change the rpath to be relative, like this: |
punky@linux-dell-9010:~/develop/EvaluationSlintUi/bin/Linux$ chrpath -l SlintUiTestApp.bin
SlintUiTestApp.bin: no rpath or runpath tag found.
punky@linux-dell-9010:~/develop/EvaluationSlintUi/bin/Linux$ ./SlintUiTestApp.bin
./SlintUiTestApp.bin: error while loading shared libraries: _deps/slint-build/libslint_cpp.so: cannot open shared object file: No such file or directory
punky@linux-dell-9010:~/develop/EvaluationSlintUi/bin/Linux$ It do not Work my Build Dir is bin/Linux |
Do you have libslint_cpp.so somewhere below your build directory? |
I can reproduce the problem trying to build your app from your repository with make. if i do
And the relative rpath path seems indeed a bad idea. |
I see this in set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/") This instructs CMake to generate a relative rpath for the artifacts in the build directory as well as for what's installed. To be able to run the resulting binary from the build directory, the slint library would then have to be placed in the build directory relative to the application binary, but I don't see any instructions in CMakeLists.txt for that. @DerKleinePunk what's the desired setup you'd like to have for the binary after it's being built and after being installed? |
Sorry for late Response in .vscode dir is an lauch.json i will use this to Debug the Application |
I can reproduce this issue locally now. I think #2731 fixes this. I'll check. |
So with #2731 and the following patch below I get what I think is the correct initial result: diff --git a/CMakeLists.txt b/CMakeLists.txt
index f766fde..db24132 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,8 +5,6 @@ SET(SLINT_FEATURE_BACKEND_QT OFF)
#Set CMake variables to disable rpath
-#set(CMAKE_SKIP_BUILD_RPATH TRUE)
-set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/")
@@ -16,13 +14,11 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/slint-ui/slint.git
# `release/1` will auto-upgrade to the latest Slint >= 1.0.0 and < 2.0.0
# `release/1.0` will auto-upgrade to the latest Slint >= 1.0.0 and < 1.1.0
- GIT_TAG release/1
+ GIT_TAG master
SOURCE_SUBDIR api/cpp
)
FetchContent_MakeAvailable(Slint)
-SET_TARGET_PROPERTIES(Slint PROPERTIES NO_SONAME 1)
-
SET (MAINFOLDER ${PROJECT_SOURCE_DIR})
IF("${TARGET}" STREQUAL "")
Correct dependency without slashes in the path: $ patchelf --print-needed bin/Linux/SlintUiTestApp.bin
libslint_cpp.so
libstdc++.so.6
libgcc_s.so.1
libc.so.6 Rpath on the build artefact set correctly: $ patchelf --print-rpath bin/Linux/SlintUiTestApp.bin
/home/slint/src/EvaluationSlintUi/build/_deps/slint-build What's needed next is support for installation. I think this should be tracked in slint-ui/slint-cpp-template#14 . |
No idea fix this Error
https://github.com/DerKleinePunk/EvaluationSlintUi
The text was updated successfully, but these errors were encountered: