stacktrace icon indicating copy to clipboard operation
stacktrace copied to clipboard

Standalone version

Open ceztko opened this issue 6 years ago • 11 comments

Is there a standalone version od the library? If no, how easy it would be to strip it from boost just using C++14 standard libraries?

ceztko avatar Oct 31 '19 00:10 ceztko

After the sad news about the rejection for c++20, I think having a standalone version became more urgent. Boost aims to have many libraries inserted in the standard but many simple can't afford to add boost as a dependency or often the burden to add such big (compile time) dependency for just one package is simple not worth, for example in embedded platforms, ios/android development.

ceztko avatar Nov 16 '19 13:11 ceztko

It's not rejected, it just didn't get on time for C++20. C++23 is the new milestone (and only LWG review remains).

If you want a standalone version - just do it :-) Fork and remove the Boost dependencies. I would provide a link in the Boost docs to the forked standalone version.

apolukhin avatar Nov 19 '19 19:11 apolukhin

@apolukhin : Do you think you could make it easier for us by pointing out "hitches" in yanking out the Boost dependencies?

eyalroz avatar Apr 02 '20 12:04 eyalroz

Most of the dependencies are in tests. It seems fine to leave tests dependent on Boost, while making the remaining parts of the library standalone.

apolukhin avatar May 05 '20 17:05 apolukhin

Well, some dependencies are not in tests. For example, in stacktrace.hpp we have:

#include <boost/core/explicit_operator_bool.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/container_hash/hash_fwd.hpp>

eyalroz avatar Jun 03 '20 14:06 eyalroz

Actually, there are lots of dependencies in the library includes. I've started working on getting rid of them (and made it easy for me by assuming C++11 or later), but some of that is not trivial (e.g. replacing NOINLINE and FORCE_INLINE, boost::demagle etc.). Then there is the matter of switching from the Boost build system to CMake, to make life more sane - and that also means generating a configuration file using CMake checks, trying to compile the files in build/ from within CMake, and so on.

So, lots and lots of work.

I'm working on this at my fork repo - whoever is interested is welcome to go there and either submit a PR or file an issue.

eyalroz avatar Jun 03 '20 22:06 eyalroz

Update: I'm making progress in removing Boost dependencies:

  • Using a CMake-based build system
  • Remaining Boost dependencies: winapi; everything else is self-contained.
  • Examples build and run, except for one which crashes.
  • I'm not able to get the library to properly decrypt stack traces using the instructions in the documentation, i.e. I get opaque numbers for each stack trace line.

I could really use some help from people with Windows experience.

eyalroz avatar Jul 15 '20 08:07 eyalroz

What kind of help you need for the Windows part?

ceztko avatar Jul 15 '20 09:07 ceztko

@ceztko :

  1. Figure out how to extract the minimal relevant part of boost's winapi/ code to meet stacktrace's needs.
  2. Add dependencies and settings in CMakeLists.txt to: 2.1 Correctly choose what gets built on Windows 2.2 Ensure the build on Windows actually passes (or at least - relay bugs to me and correspond about addressing them on the bug page)
  3. Check the small bits of Windows-related code I've introduced (mostly boost-modified/config/platform.hpp) to make sure I haven't missed anything

eyalroz avatar Jul 15 '20 09:07 eyalroz

Has anyone ever managed to do this?

TomArrow avatar Apr 21 '23 08:04 TomArrow

@TomArrow : Well, a couple of years back, I worked on this:

https://github.com/eyalroz/stacktrace

and it was kinda-working. But I haven't kept it up-to-date. Also, stack traces are going into the standard in C++23, so not a lot of motivation to work on stand-alone just for older code I suppose. Still, you're welcome to try my repo.

eyalroz avatar Apr 21 '23 09:04 eyalroz