Open andrewrk opened 1 year ago
Fixed by:
diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp
index 0cb01e50..d3071e57 100644
--- a/server/TracySourceView.cpp
+++ b/server/TracySourceView.cpp
@@ -2,7 +2,7 @@
#include <inttypes.h>
#include <stdio.h>
-#include <capstone.h>
+#include <capstone/capstone.h>
#include "imgui.h"
#include "TracyCharUtil.hpp"
diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp
index d3820076..4a354200 100644
--- a/server/TracyWorker.cpp
+++ b/server/TracyWorker.cpp
@@ -19,7 +19,7 @@
#include <inttypes.h>
#include <sys/stat.h>
-#include <capstone.h>
+#include <capstone/capstone.h>
#define ZDICT_STATIC_LINKING_ONLY
#include "../zstd/zdict.h"
[19:42 wolf@oberon:~]% pkg-config --cflags capstone
-I/usr/include/capstone
[19:42 wolf@oberon:~]% ls -l /usr/include/capstone/capstone.h
.rw-r--r-- 30k root 28 kwi 2022 /usr/include/capstone/capstone.h
[19:42 wolf@oberon:~]% pacman -Q capstone
capstone 4.0.2-6
This issue has surfaced earlier and there's no easy fix. See #170 and especially #429. Maybe I should use __has_include
? Ugh...
Yeah that's unfortunate. I don't really know of a way to nicely solve this. The best I know how to do is to do it the way that feels the most "standard" to you, and relying on systems to provide patches to make it work for their nonstandard include paths. For me the "standard" way would be including the directory prefix in the #include
sites (like the patch above) and then pointing the blame at distributions for not packaging this way.
If you're interested in considering it, I could provide a build.zig
file for Tracy which would allow using the zig build system to provide most of the dependencies rather than relying on system packages, which might be nice for users who could then run zig build
on any system (including Windows) rather than having to install a bunch of dependencies that are different across different systems (such as capstone). It might increase the "it just works" factor for some people.
The best I know how to do is to do it the way that feels the most "standard" to you, and relying on systems to provide patches to make it work for their nonstandard include paths. For me the "standard" way would be including the directory prefix in the
#include
sites (like the patch above) and then pointing the blame at distributions for not packaging this way.
Yeah, we're kinda at this point right now. The true culprit is that capstone has been in the RC phase for 5.0 for more than a year.
If you're interested in considering it, I could provide a
build.zig
file for Tracy
Thank you for the offer, but I don't think having another build system that would inevitably go out of the sync sooner rather than later would be beneficial to people. I'd rather have just one thing that works well.
Not really a fix, but for anyone else seeing the error, I just wanted to point out that the following would also work
make CFLAGS="-I/usr/include/capstone" # change to path that includes capstone.h
This seems to be a breaking change.
Version 4 of capstone: #include <capstone/capstone.h>
https://github.com/capstone-engine/capstone/blame/4.0.2/capstone.pc.in
Version 5 of capstone: #include <capstone.h>
https://github.com/capstone-engine/capstone/blame/5.0.1/capstone.pc.in
https://github.com/microsoft/vcpkg/issues/34292
Tracy v0.9.1
the nix packages I have in this environment are:
capstone (4.0.2) is included.