// This is a shim header to include the right speex header. // Use this instead of referencing the speex header directly. #if defined(USE_SYSTEM_SPEEX) #include <speex/speex.h> #else #include "third_party/speex/include/speex/speex.h" #endif
2. Explicit #if at every #include, e.g. net/base/crl_set.cc (note this is .cc filed compared to .h file above):
#if defined(USE_SYSTEM_ZLIB) #include <zlib.h> #else #include "third_party/zlib/zlib.h" #endif
3. Using the prefix for our advantage:
#include "unicode/coll.h" #include "unicode/locid.h" #include "unicode/uchar.h" #include "unicode/uscript.h"
Note that with above, we set the include path to contain our third_party dir, and rely on distros removing bundled headers when using system ICU, and in that case headers from /usr/include are used.
What solution would you prefer for v8? Note that there is usage in both WebKit and chromium tree, and in WebKit we seem to be using just #include "v8.h", see e.g. src/third_party/WebKit/Source/WebKit/chromium/src/WebKit.cpp. How about converting chromium code to the same style? I could do that.
Paweł
I don't think we should support using the system version of V8. We depend on implementation details of V8 for the exact version we build with.
Adam
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
Even in cases where the API is ABI compatible, we develop WebKit and
V8 in parallel assuming details of how each component works.
Otherwise, we wouldn't be able to make improvements like
<https://bugs.webkit.org/show_bug.cgi?id=98725>.
Obviously, Chromium is an open source project and you're free to try
to use the system version of V8, but it's going to break in difficult
to predict (or even realize) ways.
On Fri, Oct 19, 2012 at 1:12 AM, David Turner <di...@chromium.org> wrote:
> As someone who regrettably had to deal with binary compatibility issues for
> many years, I'd like to warn against using any system version of a C++
> library, unless it has an official ABI stability policy in place (and I
> don't think any of the Chromium dependencies does).
On Fri, Oct 19, 2012 at 9:47 AM, Paweł Hajdan, Jr.The "if needed" part of this paragraph is what concerns me. How do
<phajd...@chromium.org> wrote:
> On Gentoo Linux we use system v8 since October 2011 with no problems. We can
> handle dependencies properly (e.g. depend on a version of v8 that version of
> chrome was released with if needed), and watch ABI changes:
> http://upstream-tracker.org/versions/v8.html . Thanks to SONAME all reverse
> dependencies of v8 are properly rebuilt on update.
you know whether Chromium need a particular version?
local v8_bundled="$(chromium_bundled_v8_version)" local v8_installed="$(chromium_installed_v8_version)" einfo "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}"
We only test with precisely one version of V8.
It's possible that Chromium won't work properly with other versions. Do you run the full test suite in
every configuration to validate that you've got the right version?
I'm confused. I thought we had resolved this issue via chat.
And what of the case where security updates are made to Chromium's(pulled) v8 but that are not in the system v8?
This happens regularly with other libraries, such that for some critical, security-sensitive
libraries, we've retroactively removed support for using the system
version (ZLIB is a perfect example of where we no longer use or will
even compile with the system zlib)
I think there's a real trade-off for security, since changes such as
to Chromium's zlib, particularly if they're not yet upstreamed or not
accepted upstream, are not visible to the package/distro maintainers.
That said, and biased towards both Chromium style and Chromium
readability, I would prefer shim-headers such as #1 over the solutions
presented in #2 or #3, especially for widely-used headers such as V8.
#if defined(USE_SYSTEM_ZLIB)// System zlib is not expected to have workaround for http://crbug.com/139744,// so disable compression in that case.// TODO(phadjan.jr): Remove the special case when it's no longer necessary.static const int kCompressorLevel = 0;#else // !defined(USE_SYSTEM_ZLIB)static const int kCompressorLevel = 9;#endif // !defined(USE_SYSTEM_ZLIB)
--