build/chromeos_buildflags.h file not found on Linux

54 views
Skip to first unread message

Stephen O'Sullivan

unread,
Apr 7, 2022, 10:41:54 AM4/7/22
to Crashpad-dev
Hey folks,

I came across this issue when linking on Linux. It seems as if the chromeos_buildflags.h isn't found under the directory it should be when included in the crashpad_client.h

```clang++ -I /home/stephen/crashpad/crashpad -I /home/stephen/crashpad/crashpad/third_party/mini_chromium/mini_chromium -o test_with_crashpad test.cpp ~/crashpad/crashpad/out/Default/obj/client/libcommon.a ~/crashpad/crashpad/out/Default/obj/client/libclient.a ~/crashpad/crashpad/out/Default/obj/util/libutil.a ~/crashpad/crashpad/out/Default/obj/third_party/mini_chromium/mini_chromium/base/libbase.a
In file included from test.cpp:2:
/home/stephen/crashpad/crashpad/client/crashpad_client.h:27:10: fatal error: 'build/chromeos_buildflags.h' file not found```

Another dev here came across a similar issue and recommended reverting to a previous revision. Has anyone else run into a similar issue.

Thank you in advance, 
Stephen

Mark Mentovai

unread,
Apr 7, 2022, 11:05:45 AM4/7/22
to Stephen O'Sullivan, Crashpad-dev, Joshua Peraza
The dependencies generally look right, and I suspect you’ll find build/chromeos_buildflags.h in out/Default/gen. The problem is that clang++ is being invoked without any -I naming that directory.

It looks like the chromeos_buildflags parts originally introduced in https://chromium-review.googlesource.com/c/2622766 didn’t do anything in the crashpad_is_standalone build to add root_gen_dir (which in your case would be out/Default/gen) to include_dirs where needed. We have something for this in the util target directly, but it’s not exposed to all things that will see #include "build/chromeos_buildflags.h", such as via an #include chain that you seem to be seeing here. That bit in util was really only intended to handle the mig action, which is an Apple-specific thing, and which doesn’t leak beyond that target.

We don’t see this in the crashpad_is_in_chromium build because Chromium has this. Crashpad has been a little more precise about specifying dependencies and directories.

--
You received this message because you are subscribed to the Google Groups "Crashpad-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crashpad-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/crashpad-dev/bfe9be07-d39b-4708-8659-b8ac0162f0e6n%40chromium.org.

Stephen O'Sullivan

unread,
Apr 8, 2022, 3:17:56 AM4/8/22
to Mark Mentovai, Crashpad-dev, Joshua Peraza
Hey Mark,

Cheers for the quick response, that did the trick. This might be expected behaviour but interestingly enough I needed to install zlib1g-dev and libcurl4-openssl-dev separately, when I originally ran `gn gen out/Default`.
Just in case there's anything missing on the out-of-the-box build side of things.

Stephen

Mark Mentovai

unread,
Apr 8, 2022, 9:52:20 AM4/8/22
to Stephen O'Sullivan, Crashpad-dev, Joshua Peraza
We mention zlib1g-dev in the build instructions, but not libcurl4-openssl-dev. That one is trickier. We do have a build-time dependency on curl/curl.h when building for Linux, but that header can be provided by a number of conflicting libcurl-*-dev packages. I don’t think we take a position regarding which dev package to use or what flavor of runtime implementation we require. In fact, at runtime, we’ll try all of the known flavors.

Perhaps our docs should say “a libcurl4-*-dev package such as libcurl4-openssl-dev”.
Reply all
Reply to author
Forward
0 new messages