Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Enable proper stack trace with symbols.

Kishore Nallan2f7328c5caaa
diff --git a/.bazelrc b/.bazelrc
index c759e3df..3132ba8c 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -2,6 +2,7 @@ build --incompatible_strict_action_env
build --action_env=BAZEL_CXXOPTS="-std=c++17"
build --define=TYPESENSE_VERSION=\"nightly\"
build --cxxopt="-std=c++17"
+build --strip=never
build --jobs=6
test --jobs=6
diff --git a/BUILD b/BUILD
index d16eba97..a2780d5d 100644
--- a/BUILD
+++ b/BUILD
@@ -55,6 +55,16 @@ cc_library(
],
)
+cc_library(
+ name = "linux_deps",
+ defines = [
+ "NDEBUG",
+ ],
+ deps = [
+ "@elfutils//:libdw",
+ ],
+)
+
COPTS = [
"-Wall",
"-Wextra",
@@ -75,10 +85,13 @@ cc_binary(
],
linkopts = select({
"@platforms//os:linux": ["-static-libstdc++", "-static-libgcc"],
- "//conditions:default": [],
}),
- copts = COPTS,
- deps = [":common_deps"],
+ copts = COPTS + select({
+ "@platforms//os:linux": ["-DBACKWARD_HAS_DW=1", "-DBACKWARD_HAS_UNWIND=1"],
+ }),
+ deps = [":common_deps"] + select({
+ "@platforms//os:linux": [":linux_deps"],
+ }),
)
cc_binary(
diff --git a/WORKSPACE b/WORKSPACE
index 9fc1cbdc..098015ff 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -283,3 +283,11 @@ http_file(
sha256 = "55c1c510ca6335c049f5696f3b94ac7be61e84f3e27cd8169021929b3db99651",
urls = ["https://gist.githubusercontent.com/kishorenc/1d330714eb07019f210f16ccb3991217/raw/bd52e05375d305d5aaa7ac06219af999726933a4/token_offsets.log"],
)
+
+http_archive(
+ name = "elfutils",
+ build_file = "//bazel:elfutils.BUILD",
+ sha256 = "ecc406914edf335f0b7fc084ebe6c460c4d6d5175bfdd6688c1c78d9146b8858",
+ strip_prefix = "elfutils-0.182",
+ urls = ["https://sourceware.org/elfutils/ftp/0.182/elfutils-0.182.tar.bz2"],
+)
diff --git a/bazel/elfutils.BUILD b/bazel/elfutils.BUILD
new file mode 100644
index 00000000..625a300f
--- /dev/null
+++ b/bazel/elfutils.BUILD
@@ -0,0 +1,25 @@
+load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")
+
+package(default_visibility = ["//visibility:public"])
+
+filegroup(
+ name = "all_srcs",
+ srcs = glob(["**"]),
+ visibility = ["//visibility:public"],
+)
+
+configure_make(
+ name = "libdw",
+ configure_options = [
+ "--disable-libdebuginfod",
+ "--disable-debuginfod",
+ "--without-lzma",
+ "--without-bzlib",
+ ],
+ lib_source = "//:all_srcs",
+ out_lib_dir = "lib",
+ out_static_libs = ["libdw.a", "libelf.a"],
+ deps = [
+ "@com_github_madler_zlib//:zlib",
+ ],
+)
diff --git a/include/backward.hpp b/include/backward.hpp
index 30eb9540..02a735de 100644
--- a/include/backward.hpp
+++ b/include/backward.hpp
@@ -4191,6 +4191,7 @@ private:
Printer printer;
printer.address = true;
+ printer.snippet = false;
//printer.print(st, stderr);
std::stringstream error_lines;