EnterpriseDB / system_stats

A Postgres extension for exposing system metrics such as CPU, memory and disk information
Other
111 stars 24 forks source link

'kIOMainPortDefault' is only available on macOS 12.0 #26

Open ivan-strogan opened 7 months ago

ivan-strogan commented 7 months ago

Hello,

I am trying to install this on macOS 14.2 (23C64) on a 2018 15" MacBook Pro 2.6 GHz 6-Core Intel Core i7 and getting the following error:

user ~/Downloads/system_stats-2.0  $ PATH="/Applications/Postgres.app/Contents/Versions/16/bin:$PATH" make USE_PGXS=1
"Platform is: darwin"
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro  -Os -mmacosx-version-min=10.13 -arch arm64 -arch x86_64  -fvisibility=hidden -I. -I./ -I/Applications/Postgres.app/Contents/Versions/16/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/16/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/16/share/icu -I/Applications/Postgres.app/Contents/Versions/16/include/libxml2 -I/Applications/Postgres.app/Contents/Versions/16/include -I/Applications/Postgres.app/Contents/Versions/16/include  -I/Applications/Postgres.app/Contents/Versions/16/include  -c -o darwin/io_analysis.o darwin/io_analysis.c
darwin/io_analysis.c:44:35: error: 'kIOMainPortDefault' is only available on macOS 12.0 or newer [-Werror,-Wunguarded-availability-new]
        if (IOServiceGetMatchingServices(kIOMainPortDefault,
                                         ^~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:112:19: note: 'kIOMainPortDefault' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 10.13.0
const mach_port_t kIOMainPortDefault
                  ^
darwin/io_analysis.c:44:35: note: enclose 'kIOMainPortDefault' in a __builtin_available check to silence this warning
        if (IOServiceGetMatchingServices(kIOMainPortDefault,
                                         ^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [darwin/io_analysis.o] Error 1
WillBMease commented 7 months ago

getting this same error on macbook m3 max, i'm Sonoma 14.2.1, I installed Postgres.app instead of through homebrew as well if that makes a difference