fastfetch-cli / fastfetch

An actively maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
10k stars 397 forks source link

Does not compile on macOS due to undeclared PATH_MAX #380

Closed aaronfranke closed 1 year ago

aaronfranke commented 1 year ago

I followed the compilation instructions in the README, but it does not compile on macOS 13.1 (but it does work on Linux).

% cmake --build . --target fastfetch --target flashfetch
[  1%] Building C object CMakeFiles/libfastfetch.dir/src/logo/image/image.c.o
fastfetch/src/logo/image/image.c:690:42: error: use of undeclared identifier 'PATH_MAX'
    ffStrbufInitA(&requestData.cacheDir, PATH_MAX * 2);
                                         ^
fastfetch/src/logo/image/image.c:706:47: error: use of undeclared identifier 'PATH_MAX'
    ffStrbufEnsureFree(&requestData.cacheDir, PATH_MAX);
                                              ^
2 errors generated.

I skipped the issue template because this isn't about an issue about running fastfetch, it's an issue about compiling it.

CarterLi commented 1 year ago

It built cleanly for me and Github Action

LinusDierheimer commented 1 year ago

What is the cmake configure output?

aaronfranke commented 1 year ago
% cmake ..
-- The C compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2") 
-- Build type: Release
-- Threads type: pthread
fatal: No names found, cannot describe anything.
-- Looking for utmpx.h
-- Looking for utmpx.h - found
-- Library: found VULKAN
-- Library: found IMAGEMAGICK7
-- Library: missing: IMAGEMAGICK6
-- Library: found ZLIB
-- Library: missing: CHAFA
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/aaronfranke/workspace/fastfetch/build
CarterLi commented 1 year ago

Should be fixed in https://github.com/LinusDierheimer/fastfetch/commit/012c7552eb4e88ad2eec6c4f085c32567e2bf368

aaronfranke commented 1 year ago

I can confirm that the latest dev branch compiles and runs on macOS. Thanks!