libsinsp.pc references build tree instead of install prefix
Describe the bug
Notice the references to /tmp/guix-build-falcosecurity-libs-0.15.1-drv-0 in the pkg-config libsinsp.pc file, as shown by the grep command below:
$ grep -rin guix-build /gnu/store/c363y8pvmynd2c8dg83802891n4v03nr-falcosecurity-libs-0.15.1
grep: /gnu/store/c363y8pvmynd2c8dg83802891n4v03nr-falcosecurity-libs-0.15.1/lib/libscap_engine_savefile.a : fichiers binaires correspondent
/gnu/store/c363y8pvmynd2c8dg83802891n4v03nr-falcosecurity-libs-0.15.1/lib/pkgconfig/libsinsp.pc:11:Cflags: -I${includedir}/falcosecurity/libsinsp -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build/driver/src -I/gnu/store/vbb4mazz64v6gy10nzz1dp1ixk690fav-tbb-2021.6.0/include/tbb -I/gnu/store/9jkzwa8j0ag4n0bwmdwn9k313ilwgywf-jsoncpp-1.9.5/include -I/gnu/store/m57i4jra2yg42sz886qyz6x5qz2bxiai-valijson-1.0.2/include -I/gnu/store/4w850l8yy5lj5mvrfq253bcs8axhnizc-re2-2022-12-01/include -I/gnu/store/0kzjzrgsn7k1clc6mxk5ndfmsikwm7wz-c-ares-1.18.1/include -I/gnu/store/54cqjg46c15qsx75b63rfbmvshw8w5nd-curl-8.5.0/include
This then causes issues like:
CMake Error in userspace/sysdig/CMakeLists.txt:
Imported target "PkgConfig::LIBSINSP" includes non-existent path
"/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
With CMake when one tries to use it with pkg_check_modules.
How to reproduce it
Build it in a different location than its installation prefix.
Expected behaviour
The pkg-config file include directives in CFLAGS should refer to the installed files in their final location (installation prefix), not those from the build tree.
Environment
- Falco version: 0.15.1
- OS: Guix System
- Kernel: Linux hurd 6.8.8-gnu #1 SMP PREEMPT_DYNAMIC 1 x86_64 GNU/Linux
- Installation method: From source.
A workaround is to remove the @SINSP_PKG_CONFIG_INCLUDES@ template variable from the userspace/libsinsp/libsinsp.pc.in source file before configuration.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle rotten
/remove-lifecycle rotten
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle rotten
I think that had gotten taken care of by some related work that has now been merged.