Regarding testing, I think we generally test build systems/configurations by having builders that use them. We do have a Bazel builder; I'm not sure how many more Bazel builders for other configurations we'd want at this stage... maybe one more for the component build would be okay; if it only compiles (doesn't run tests) and runs infrequently / with low priority and without being a tree closer (unless/until we decide that we want it to be one), maybe it doesn't need too many resources. +Michael Achenbach <[email protected]> WDYT?
Obviously we'd first need to get the Bazel+component build working before it makes sense to set up a bot for it. On Tue, Feb 6, 2024 at 7:28 PM 'Elliott Brossard' via v8-dev < [email protected]> wrote: > I doubt this is the right approach, by the way, but I was able to link > successfully by commenting out > https://github.com/v8/v8/blob/ebd3e99c85fb93e7ddea207233e35f53742c2e05/src/snapshot/embedded/platform-embedded-file-writer-generic.cc#L60 > so that the symbols aren't declared as hidden. I'm guessing that in the GN > build, there's some other configuration difference that allows linking to > succeed even with the hidden symbols. > > On Tue, Feb 6, 2024 at 9:12 AM Elliott Brossard < > [email protected]> wrote: > >> Thanks! That's helpful. If I do figure out a way to make this work, what >> is the best way to add tests for Bazel build configurations? If you have a >> sample commit, that would be great. >> >> On Tue, Feb 6, 2024 at 4:09 AM 'Victor Gomes' via v8-dev < >> [email protected]> wrote: >> >>> >>> >>> On Tue, Feb 6, 2024 at 1:02 PM Jakob Kummerow <[email protected]> >>> wrote: >>> >>>> On Mon, Feb 5, 2024 at 11:42 PM 'Elliott Brossard' via v8-dev < >>>> [email protected]> wrote: >>>> >>>>> https://github.com/v8/v8/blob/main/bazel/defs.bzl sets `linkstatic` >>>>> to `True` for all of the library targets, and there is no option to create >>>>> shared objects for the libraries instead (as far as I can tell). If I >>>>> naively patch `defs.bzl` to have `linkstatic = False`, I get the following >>>>> link errors: >>>>> >>>>> ``` >>>>> ld.lld: error: undefined reference due to --no-allow-shlib-undefined: >>>>> v8_Default_embedded_blob_code_ >>>>> >>> referenced by >>>>> bazel-out/k8-fastbuild/bin/_solib_k8/libexternal_Sv8_Slibv8_Ulibshared_Uicu.so >>>>> >>>>> ld.lld: error: undefined reference due to --no-allow-shlib-undefined: >>>>> v8_Default_embedded_blob_code_size_ >>>>> >>> referenced by >>>>> bazel-out/k8-fastbuild/bin/_solib_k8/libexternal_Sv8_Slibv8_Ulibshared_Uicu.so >>>>> >>>>> ld.lld: error: undefined reference due to --no-allow-shlib-undefined: >>>>> v8_Default_embedded_blob_data_ >>>>> >>> referenced by >>>>> bazel-out/k8-fastbuild/bin/_solib_k8/libexternal_Sv8_Slibv8_Ulibshared_Uicu.so >>>>> >>>>> ld.lld: error: undefined reference due to --no-allow-shlib-undefined: >>>>> v8_Default_embedded_blob_data_size_ >>>>> >>> referenced by >>>>> bazel-out/k8-fastbuild/bin/_solib_k8/libexternal_Sv8_Slibv8_Ulibshared_Uicu.so >>>>> collect2: error: ld returned 1 exit status >>>>> ``` >>>>> >>>>> I think (please correct me if I'm wrong) that the gn-based build does >>>>> support generating shared objects for the various V8 libraries instead, >>>>> and >>>>> I see references e.g. to defines like `BUILDING_V8_SHARED` in >>>>> https://github.com/v8/v8/blob/main/BUILD.gn. I'm not interested in >>>>> cross-version stability, just the ability to link dynamically in order to >>>>> have smaller test binaries involving V8, but I'm wondering: >>>>> * Is it true that the gn build supports dynamic linking? I'm having >>>>> trouble deciphering this from the docs/sources. >>>>> >>>> >>>> Yes, definitely. I use it all the time. >>>> The GN build supports everything. The Bazel build is known to support >>>> only a subset of configuration options. >>>> >>>> >>>>> * Is dynamic linking with the Bazel build on the roadmap? I don't see >>>>> any related mentions on the issue tracker >>>>> <https://issues.chromium.org/issues?q=is:open>. >>>>> >>>> >>>> I don't know. >>>> >>> No, we don't have dynamic linking on the roadmap. >>> >>>> >>>> If you have time/interest to figure out how to support dynamic-linking >>>> (aka shared-library aka component) builds with the Bazel build, we would >>>> probably accept patches (as long as they're not too intrusive or add too >>>> much maintenance burden going forward). >>>> >>> +1 to that. >>> >>>> >>>> -- >>> >>> -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAKSzg3THWm%2Bt%2BhXwQUWjMKmxgP%3DpE9kW8bqy_-m-KaF0W77SyA%40mail.gmail.com.
