EnterpriseDB / system_stats

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

No such file or directory pgxs.mk #28

Open ccsalway opened 6 months ago

ccsalway commented 6 months ago

When I try to make this on a Rocky Linux 9.3 using postgres-16, I get

# PATH="/usr/pgsql-16/bin:$PATH" make USE_PGXS=1
"Platform is: linux"
Makefile:85: /usr/pgsql-16/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/pgsql-16/lib/pgxs/src/makefiles/pgxs.mk'.  Stop.
ccsalway commented 6 months ago

Assuming it's because I need the devel for postgresql, I get

# dnf install postgresql16-devel
Last metadata expiration check: 0:13:38 ago on Thu 25 Jan 2024 13:49:05 GMT.
Error: 
 Problem: cannot install the best candidate for the job
  - nothing provides perl(IPC::Run) needed by postgresql16-devel-16.1-2PGDG.rhel9.x86_64 from pgdg16
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
ccsalway commented 6 months ago

I followed https://docs.fedoraproject.org/en-US/epel/ and enabled crb repo and then ran dnf install postgresql16-devel which got rid of the perl(IPC::Run) error..... but now when i run the compile, i get

# PATH="/usr/pgsql-16/bin:$PATH" make USE_PGXS=1
"Platform is: linux"
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -fvisibility=hidden -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o system_stats.o system_stats.c
gcc: fatal error: cannot read spec file ‘/usr/lib/rpm/redhat/redhat-hardened-cc1’: No such file or directory
compilation terminated.
make: *** [<builtin>: system_stats.o] Error 1
ccsalway commented 6 months ago

Next I ran the following to squash the cannot read spec file error and then reran

dnf install redhat-rpm-config

at this point, ive lost the will to live!

ccsalway commented 6 months ago

Finally, I restart postgresql and run

postgres=# CREATE EXTENSION system_stats;
CREATE EXTENSION

and then grant the permission to the user

GRANT monitor_system_stats to admin;

What an arse!