Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@boost//:stacktrace is missing libbacktrace dependency #534

Open
rnburn opened this issue Jan 4, 2024 · 5 comments
Open

@boost//:stacktrace is missing libbacktrace dependency #534

rnburn opened this issue Jan 4, 2024 · 5 comments

Comments

@rnburn
Copy link

rnburn commented Jan 4, 2024

I get this error when building

> bazel build //...
WARNING: Download from https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz failed: class javax.net.ssl.SSLHandshakeException PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
INFO: Analyzed 793 targets (1 packages loaded, 656 targets configured).
INFO: Found 793 targets...
ERROR: /home/rnburn/.cache/bazel/_bazel_rnburn/d8123aa23bfc2a43914d6af343f507b1/external/boost/BUILD.bazel:1900:14: Compiling libs/stacktrace/src/backtrace.cpp [for tool] failed: (Exit 1): clang-18 failed: error executing command (from target @boost//:stacktrace) /nix/store/42m4mx42crcs69qjbwalxyfkki3vdg0p-clang/bin/clang-18 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object ... (remaining 291 arguments skipped)
In file included from external/boost/libs/stacktrace/src/backtrace.cpp:15:
In file included from external/boost/libs/stacktrace/include/boost/stacktrace/detail/frame_unwind.ipp:25:
external/boost/libs/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp:23:13: fatal error: 'backtrace.h' file not found
@rnburn
Copy link
Author

rnburn commented Jan 4, 2024

For reference, here's a PR with a small patch I put together that adds the libbacktrace dependency: spaceandtimelabs/blitzar#78

But it would probably need to be modified to be usable for a more general context.

@cpsauer
Copy link
Collaborator

cpsauer commented Jan 5, 2024

Hey, Ryan! I'm definitely not the biggest Linux expert here, but I think this comes down to currently assuming that libbacktrace is installed on the system--when it's not always by default, and not on your guys'.

IMO there's room for a better general Bazel thing here for Linux where rules install what they need (see bazelbuild/bazel#17099), maybe selecting on a flag that lets you build and link statically.

@cpsauer
Copy link
Collaborator

cpsauer commented Jan 5, 2024

Anyway, this project is mostly community maintained. (And as much as I wish I could just dive in and fix this one, I don't have bandwidth right now--but I figured I'd hop in and try to help some.)

If you're down to contribute to the ecosystem, I think getting Bazel into libbacktrace (or into the central registry and adding it here) would be quite valuable, as could building the package install stuff linked above!

Thanks,
Chris

@rnburn
Copy link
Author

rnburn commented Jan 6, 2024

Hey Chris, thanks for getting back to me. I agree that having bazel support for libbacktrace would be valuable -- but that might be a bit too big of a project for me to try to tackle right now.

However, I think you could fairly easly add a custom build file for libbacktrace in the same way you are doing for zlib and bzip2 here: https://github.com/nelhage/rules_boost/blob/master/boost/boost.bzl#L117-L124

That's something I might be able to put together a PR for if you'd be ok with a simple build like this: https://github.com/spaceandtimelabs/blitzar/blob/main/WORKSPACE#L30-L45

I can probably rework it so that it doesn't use https://github.com/bazelbuild/rules_foreign_cc if you'd prefer to avoid adding that as a dependency.

@cpsauer
Copy link
Collaborator

cpsauer commented Jan 6, 2024

I think that'd be quite valuable!

Definitely worth avoiding rules_foreign_cc if we easily can, though, since it has a bunch of limitations esp around cross-platform build, as I recall. If you succeed with that, I still think it might be worth seeing if libbacktrace would take the BUILD file!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants