Revert "bumped minimum CMake version to 3.21.0" - #2554
Conversation
This reverts commit 233c481.
|
I don't know why bumping minimal CMake version changes the behavior of cpack, but it does. |
|
Huh? 😅 It's still the case that build fails with older CMake ¯\_(ツ)_/¯ > docker run --rm -it -v /tmp/cmake:/tmp/cmake -w /tmp/cmake debian:bullseye bash
# apt update && apt install -y git build-essential pkg-config python3 cmake
# git clone --branch dev --depth 1 https://github.com/fastfetch-cli/fastfetch.git && cd fastfetch
# mkdir build && cd build
# cmake --version
cmake version 3.18.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).
# cmake ..
-- Build for system processor: amd64
-- Build type: RelWithDebInfo
-- Threads type: pthread
-- Enabling LTO
-- Target dirs: ROOT="" USR="/usr" HOME="/home" ETC="/etc"
fatal: No names found, cannot describe anything.
-- Found Python: /usr/bin/python3.9 (found version "3.9.2") found components: Interpreter
-- Minifying 'help.json'
-- Generating 'fastfetch.1'
-- Performing Test COMPILER_SUPPORTS_COUNT_OF
CMake Error at /tmp/cmake/fastfetch/build/CMakeFiles/CMakeTmp/CMakeLists.txt:15 (add_executable):
C_STANDARD is set to invalid value '23'
CMake Error at /usr/share/cmake-3.18/Modules/CheckCSourceCompiles.cmake:109 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
CMakeLists.txt:1436 (check_c_source_compiles)
-- Configuring incomplete, errors occurred!
See also "/tmp/cmake/fastfetch/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/cmake/fastfetch/build/CMakeFiles/CMakeError.log".Note Edit: I tried reproducing this in a Trixie Docker container and it built and packed just fine with minimum set to 3.21? > docker run --rm -it -v /tmp/cmake:/tmp/cmake -w /tmp/cmake debian:trixie bash
# apt update && apt install -y git build-essential pkg-config python3 cmake nano file
# git clone --branch dev --depth 1 https://github.com/fastfetch-cli/fastfetch.git && cd fastfetch
# mkdir build && cd build
# cmake --version
cmake version 3.31.6
CMake suite maintained and supported by Kitware (kitware.com/cmake).
# gcc --version
gcc (Debian 14.2.0-19) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# nano ../CMakeLists.txt
# cat ../CMakeLists.txt | head -1
cmake_minimum_required(VERSION 3.21.0)
# cmake ..
# cpack --verbose -G DEB
# file fastfetch
fastfetch: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f062535971b95eb5649a25b39c7fd0e1b7116075, for GNU/Linux 3.2.0, with debug_info, not stripped
# dpkg -i fastfetch-linux-amd64.deb
Selecting previously unselected package fastfetch.
(Reading database ... 23689 files and directories currently installed.)
Preparing to unpack fastfetch-linux-amd64.deb ...
Unpacking fastfetch (2.68.1) ...
Setting up fastfetch (2.68.1) ...So something else seems to be the issue? Maybe an issue with CI/CD? Edit2: Also @CarterLi looking at
The package source (
So maybe we should use that to build fastfetch instead? Edit3: Tried using GCC 13 in Trixie and still no issues: > docker run --rm -it -v /tmp/cmake:/tmp/cmake -w /tmp/cmake debian:trixie bash
# apt update && apt install -y git build-essential gcc-13 pkg-config python3 cmake nano file
# git clone --branch dev --depth 1 https://github.com/fastfetch-cli/fastfetch.git && cd fastfetch
# mkdir build && cd build
# cmake --version
cmake version 3.31.6
CMake suite maintained and supported by Kitware (kitware.com/cmake).
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
# gcc --version
gcc (Debian 13.3.0-16) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# nano ../CMakeLists.txt
# cat ../CMakeLists.txt | head -1
cmake_minimum_required(VERSION 3.21.0)
# cmake ..
# cpack --verbose -G DEB
# file fastfetch
fastfetch: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=863c528ed717cce4e351541066a4cdedf744dc08, for GNU/Linux 3.2.0, with debug_info, not stripped
# dpkg -i fastfetch-linux-amd64.deb
(Reading database ... 23987 files and directories currently installed.)
Preparing to unpack fastfetch-linux-amd64.deb ...
Unpacking fastfetch (2.68.1) over (2.68.1) ...
Setting up fastfetch (2.68.1) ...Also tried GCC 13 and Ninja generator, but still a 64 bit binary was generated... |
|
The problem was that the linux-i686 workflow generated a package named amd64 You should use the instructions from https://github.com/fastfetch-cli/fastfetch/blob/dev/.github%2Fworkflows%2Fbuild-linux-i686.yml |
Yep, confirmed building using The workflow sets # file fastfetch
fastfetch: ELF 32-bit LSB pie executable, Intel i386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=da48b4a3210f67f34479810f18254cbcca803253, for GNU/Linux 3.2.0, with debug_info, not stripped
# ls fastfetch-linux-*
fastfetch-linux-i686.debFrom 3.21 docs:
Edit: I modified CMakeLists.txt to print the values before and after overriding Looks like it was made into a read-only or something in newer versions :/ |
|
Make a PR tofix that? |
That was just a workaround that kinda worked. The actual issue is that, from what I can tell, newer CMake are much stricter, the # cat ../i386-toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i386)
set(CMAKE_C_FLAGS "-m32 -march=i686 -mtune=i686")
# CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake .. -DCMAKE_C_FLAGS="-m32 -march=i686 -mtune=i686" -DCMAKE_SYSTEM_N
AME=Linux -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=i386 -DCMAKE_TOOLCHAIN_FILE=../i386-toolchain.cmake -DCMAKE_SYSTEM_PROCESSOR_OVERRIDE=whatever
CMake Warning at CMakeLists.txt:4 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is CMAKE_SYSTEM_PROCESSOR_OVERRIDE
is whatever
CMake Warning at CMakeLists.txt:6 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is whatever
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is whatever
-- Build for system processor: whatever
-- The C compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at CMakeLists.txt:26 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is i386
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is whatever
CMake Warning at CMakeLists.txt:28 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is i386
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is whatever
-- Build for system processor: i386I tried setting it both before # file fastfetch && ls fastfetch-linux-*
fastfetch: ELF 32-bit LSB pie executable, Intel i386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=5059d181a0ab9b9adf3a011299f2ab436e5c250d, for GNU/Linux 3.2.0, with debug_info, not stripped
fastfetch-linux-i386.debHowever, I am by no means an expert, toolchain files are new to me, I am still trying to look deeper. Edit: Supposed we use toolchain files, do we create them inside git worktree and persist them, or generate them on the fly inside workflows? Edit2: # CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake .. -DCMAKE_C_FLAGS="-m32 -march=i686 -mtune=i686" -DCMAKE_SYSTEM_N
AME=Linux -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=i386 -DCMAKE_SYSTEM_PROCESSOR_OVERRIDE=whatever
CMake Warning at CMakeLists.txt:4 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is whatever
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is whatever
CMake Warning at CMakeLists.txt:6 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is whatever
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is whatever
-- Build for system processor: whatever
CMake Warning at CMakeLists.txt:26 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is whatever
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is whatever
CMake Warning at CMakeLists.txt:28 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is whatever
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is whatever
-- Build for system processor: whateverI am lost... Why does it work again?! XD |
|
CMake is such a mess... According to this issue the Anyway, while trying different things I tried setting # rm -rf build2/* && CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -S . -B build2 -DCMAKE_C_FLAGS="-m32 -march=i686 -mtu
ne=i686" -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=i386 -DCMAKE_SYSTEM_PROCESSOR_OVERRIDE=i686 && (cd build2 && cpack --debug -G DEB)
CMake Warning at CMakeLists.txt:4 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is CMAKE_SYSTEM_PROCESSOR_OVERRIDE
is i686
CMake Warning at CMakeLists.txt:6 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is i686
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is i686
-- Build for system processor: i686
-- The C compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at CMakeLists.txt:26 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is x86_64
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is i686
CMake Warning at CMakeLists.txt:28 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is x86_64
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is i686
-- Build for system processor: amd64
...
# rm -rf build2/* && CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -S . -B build2 -DCMAKE_C_FLAGS="-m32 -march=i686 -mtu
ne=i686" -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=i386 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR_OVERRIDE=i686 && (cd build2 && cpack --debug -G DEB)
CMake Warning at CMakeLists.txt:4 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is CMAKE_SYSTEM_PROCESSOR_OVERRIDE
is i686
CMake Warning at CMakeLists.txt:6 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is i686
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is i686
-- Build for system processor: i686
-- The C compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at CMakeLists.txt:26 (message):
--------- before: CMAKE_SYSTEM_PROCESSOR is i686
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is i686
CMake Warning at CMakeLists.txt:28 (message):
--------- after: CMAKE_SYSTEM_PROCESSOR is i686
CMAKE_SYSTEM_PROCESSOR_OVERRIDE is i686
-- Build for system processor: i686So can this be it? Could you also try setting min version to |
|
Created a new PR #2565 |
Reverts #2517
Causes #2553, for some reason