userver icon indicating copy to clipboard operation
userver copied to clipboard

build fail on archlinux for 'backtrace.h' not found but actually it's there.

Open zhongwm opened this issue 1 year ago • 3 comments

It complains

[cmake] 
[cmake] CMake Error at build/_deps/userver-src/third_party/boost_stacktrace/CMakeLists.txt:43 (message):
[cmake]   Failed to find <backtrace.h>.  Use -DUSERVER_FEATURE_STACKTRACE=0 or
[cmake]   install the required packages (for Ubuntu: build-essential or
[cmake]   libgcc-*-dev).
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: /usr/bin/cmake --no-warn-unused-c

1. Gcc name triplet not match on my laptop

. My system has default gcc path like this: /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/ userver-src/third_party/boost_stacktrace/CMakeLists.txt line 35:

file(GLOB BacktraceIncludeFiles
             "/usr/lib/gcc/x86_64-linux-gnu/*/include/backtrace.h"
        )

2. On my laptop the backtrace.h is under /usr/include not under the gcc/xxx/yyyy/include folder, therefore the cmake script fails to find it the way shown in the above cmake lines.

Turns out my system's /usr/include/backtrace.h is owned by AUR package libbacktrace-git r77.g9ae4f4a-1.

zhongwm avatar Nov 13 '23 03:11 zhongwm

Looks like that knowledge is already reflected in docs https://userver.tech/d3/da9/md_en_2userver_2tutorial_2build.html#autotoc_md476 and the package libbacktrace-git is in the deps list https://github.com/userver-framework/userver/blob/develop/scripts/docs/en/deps/arch.md

apolukhin avatar Nov 15 '23 07:11 apolukhin

Thanks for your reply. I've updated the description. I made a small change on the find GLOB path, but for the second problem, only /usr/include/backtrace.h no gcc specific backtrace.h, I don't have a clue which I should use, are they the same thing just in different location.

zhongwm avatar Nov 16 '23 06:11 zhongwm

We should actually use just Boost.Stacktrace instead of using our copy in third_party/boost_stacktrace.

Anton3 avatar Jan 04 '24 15:01 Anton3

Fixed in https://github.com/userver-framework/userver/commit/68574f5b83f560ab802bef79c6ae5795493efc1d

Anton3 avatar Feb 18 '24 17:02 Anton3