Building cvmfs on alpine linux "musl" not "glibc"

Hello

I am trying to build cvmfs on alpine linux and obviously failed at the first stage…

alpine-virt-318:~/cvmfs/build$ cmake ../
Running CMake version 3.26.5
Installing shared libraries to: lib64
-- checking gcc version...
-- using compiler opt flag -Os 
Enable inotify support
-- running bootstrap.sh ...
Bootstrap - Externals lib location: /home/bisadm/cvmfs/externals
Bootstrap - Externals build location: /home/bisadm/cvmfs/externals_build
Bootstrap - Externals install location: /home/bisadm/cvmfs/externals_install
Bootstrap - Base CVMFS C flags: -Os  -g -fno-strict-aliasing -fasynchronous-unwind-tables -fno-omit-frame-pointer -fwrapv -fvisibility=hidden -Wall -Wno-format-truncation -fno-optimize-sibling-calls
Bootstrap - Base CVMFS C++ flags: -Os  -g -fno-strict-aliasing -fasynchronous-unwind-tables -fno-omit-frame-pointer -fwrapv -fvisibility=hidden -Wall -Wno-format-truncation -fno-exceptions -fno-optimize-sibling-calls
Bootstrap - 64bit: TRUE
Bootstrap - found libcurl
Bootstrap - found libcrypto
Bootstrap - found pacparser
Bootstrap - found zlib
Bootstrap - found sparsehash
Bootstrap - found leveldb
Bootstrap - found googletest
Bootstrap - found ipaddress
Bootstrap - found maxminddb
Bootstrap - found protobuf
Bootstrap - found googlebench
Bootstrap - found sqlite3
Bootstrap - found vjson
Bootstrap - found sha3
Bootstrap - found libarchive
Project prefix path: /home/bisadm/cvmfs/externals_install
System prefix path: /usr/local;/usr;/;/usr;/usr;/usr/X11R6;/usr/pkg;/opt
CMake Error at CMakeLists.txt:250 (message):
  execinfo.h is missing on your system
Call Stack (most recent call first):
  CMakeLists.txt:266 (pedantic_include_check)
  CMakeLists.txt:304 (look_for_required_include_files)


-- Configuring incomplete, errors occurred!

execinfo.h is provided on CentOS-7 by glibc-headers but as alpine linux is musl based, there is no glibc …

dead end?

Thanks

Tru

Hi Tru,

welcome to the forum! This does not seem like a dead end, but certainly means some work will have to be done. CVMFS explicitly uses execinfo to generate stack traces, so you’d either need to ifdef-out this functionality, or you could check if getting this header file from another package is is an option for you (a quick web search indicates that libexecinfo has been removed from alpine, but libelfutil-dev could be an option?).

Hello Valentin,

Thanks for the hint:

alpine-virt-318:~/cvmfs/build$ apk info -L elfutils-dev
elfutils-dev-0.189-r2 contains:
usr/include/dwarf.h
usr/include/gelf.h
usr/include/libelf.h
usr/include/nlist.h
usr/include/elfutils/elf-knowledge.h
usr/include/elfutils/known-dwarf.h
usr/include/elfutils/libasm.h
usr/include/elfutils/libdw.h
usr/include/elfutils/libdwelf.h
usr/include/elfutils/libdwfl.h
usr/include/elfutils/version.h
usr/lib/libasm.so
usr/lib/libdw.so
usr/lib/libelf.so
usr/lib/pkgconfig/libdw.pc
usr/lib/pkgconfig/libelf.pc

no execinfo.h ! cmake fails at the same step (obviously):

alpine-virt-318:~/cvmfs/build$ \rm -rf *; cmake ..
...
-- Looking for syslog.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for execinfo.h
-- Looking for execinfo.h - not found
CMake Error at CMakeLists.txt:250 (message):
  execinfo.h is missing on your system
Call Stack (most recent call first):
  CMakeLists.txt:266 (pedantic_include_check)
  CMakeLists.txt:304 (look_for_required_include_files)

-- Configuring incomplete, errors occurred!

cvmfs is not alone:

Cheers

Tru

Oh, I missed the closed issue:

Tru

I’ve quickly tried to build GitHub - resslinux/libexecinfo from source and that seems to work - although I would not use this in production, in the end it’ll likely be better to patch out execinfo alltogether.

Going on to compile, I’ve hit
https://inbox.vuxu.org/musl/20220412182436.519e76e5598d272e7a1afada@zhasha.com/T/

and

https://bugs.gentoo.org/717542

but gcc seems happy with the workaround that can luckily also be found in those links.

Next, it seems like <glob.h> in musl also differs significantly, missing functionality used in swissknife_sync

I have manually compiled libexecinfo but I am stuck a little further down (after adding manually more packages)…

alpine-virt-318:~/cvmfs/build$ \rm -rf * && cmake ..
<...>
Using libcrypto for libcvmfs_crypto from /home/bisadm/cvmfs/externals_install/crypto/include
-- Found GTest: /home/bisadm/cvmfs/externals_install/lib/libgtest.a  
-- Found VJSON: /home/bisadm/cvmfs/externals_install/lib/libvjson.a  
-- Found LibArchive: /home/bisadm/cvmfs/externals_install/lib/libarchive.a  
-- Found ZLIB: /home/bisadm/cvmfs/externals_install/lib/libz.a (found version "1.2.8")  
-- Found SHA3: /home/bisadm/cvmfs/externals_install/lib/libsha3.a  
-- Found CARES: /home/bisadm/cvmfs/externals_install/lib/libcares.a  
-- Found CURL: /home/bisadm/cvmfs/externals_install/lib/libcurl.a (found version "7.86.0")  
-- Checking for module 'sqlite3'
--   Found sqlite3, version 3.41.2
-- Found Sqlite3: /home/bisadm/cvmfs/externals_install/lib/libsqlite3.a
-- Found leveldb: /home/bisadm/cvmfs/externals_install/lib  
-- Found UUID: /usr/lib/libuuid.so
-- Found pacparser: /home/bisadm/cvmfs/externals_install/lib/libpacparser.a
-- Found Sparsehash: /home/bisadm/cvmfs/externals_install/include  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Protobuf: /home/bisadm/cvmfs/externals_install/lib/libprotobuf.a  
-- Found FUSE: /usr/lib/libfuse.so
-- Found FUSE3: /usr/lib/libfuse3.so
Enable Fuse3 cache_readdir support
-- Found PythonLibs: /usr/lib/libpython3.11.so (found version "3.11.6") 
FATAL Cap include dirs cannot be found
FATALPcap library cannot be found
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find LibCAP (missing: CAP_LIBRARIES CAP_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindLibCAP.cmake:42 (find_package_handle_standard_args)
  CMakeLists.txt:438 (find_package)


-- Configuring incomplete, errors occurred!
alpine-virt-318:~/cvmfs/build$ 

but libpcap-dev is installed …

alpine-virt-318:~/cvmfs/build$ apk info |grep libpcap
libpcap
libpcap-dev

just as a side note: if you fail during the “cmake” process of cvmfs and you install new packages, you have start the configuration process from new. easiest is to just delete build/ and recreate it

edit: sometimes it also includes the externals externals_build/ and externals_install/

and for the libcap it seems like you might have nstalled the wrong package.

there is a libcap package (no libPcap) for alpine Alpine Linux packages

oh… facepalm’ed, fixing my typoed installed libcap-dev.

thx

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.