Skip to content

Revert "bumped minimum CMake version to 3.21.0" - #2554

Merged
CarterLi merged 1 commit into
devfrom
revert-2517-patch-1
Sep 1, 2026
Merged

Revert "bumped minimum CMake version to 3.21.0"#2554
CarterLi merged 1 commit into
devfrom
revert-2517-patch-1

Conversation

@CarterLi

@CarterLi CarterLi commented Sep 1, 2026

Copy link
Copy Markdown
Member

Reverts #2517

Causes #2553, for some reason

@CarterLi

CarterLi commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

I don't know why bumping minimal CMake version changes the behavior of cpack, but it does.

@CarterLi
CarterLi merged commit 37c198d into dev Sep 1, 2026
43 of 47 checks passed
@Guiorgy

Guiorgy commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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 C_STANDARD is set to invalid value '23' :P

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 build-linux-hosts.yml it installs gcc 13 (sudo apt-get install -y gcc-13), and yet as far as I can tell C23 (-std=c23) was only added in GCC 14 and as experimental at that:

A further version of the C standard, known as C2X, is under development; experimental and incomplete support for this is enabled with -std=c2x.

A further version of the C standard, known as C23, is under development and expected to be published in 2024 as ISO/IEC 9899:2024. (While in development, drafts of this standard version were referred to as C2X.) Experimental and incomplete support for this is enabled with -std=c23 or -std=iso9899:2024.

The package source (ppa:ubuntu-toolchain-r/test) used has GCC 15 which has full support of C23 and uses it as the default:

The default, if no C language dialect options are given, is -std=gnu23.

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...

@CarterLi

CarterLi commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants