Git Product home page Git Product logo

Comments (8)

BenjaminLawson avatar BenjaminLawson commented on September 1, 2024

It seems like private_hdrs passed to cc_common.compile() in _cc_emboss_aspect_impl are not working for a repo outside of emboss. I wonder why this is working in other projects. Maybe a different version of Bazel?

from emboss.

BenjaminLawson avatar BenjaminLawson commented on September 1, 2024

cc_common.compile() appears to no longer even be supported in Bazel 7: https://bazel.build/rules/lib/toplevel/cc_common

I am using 6.4.0 though.

from emboss.

reventlov avatar reventlov commented on September 1, 2024

Your team may be the only active Emboss + Bazel users.

I am tempted to just revert 378cd5d and handle the import-of-imports-across-projects problem a different way, because it really feels like the aspect stuff isn't quite stable enough, and it doesn't seem to be working quite the way I thought it did.

There are some non-public issues, as well.

from emboss.

BenjaminLawson avatar BenjaminLawson commented on September 1, 2024

This is the depset that is passed as private_hdrs to cc_common.compile:

depset([<source file runtime/cpp/emboss_arithmetic.h>, <source file runtime/cpp/emboss_arithmetic_all_known_generated.h>, <source file runtime/cpp/emboss_arithmetic_maximum_operation_generated.h>, <source file runtime/cpp/emboss_array_view.h>, <source file runtime/cpp/emboss_bit_util.h>, <source file runtime/cpp/emboss_constant_view.h>, <source file runtime/cpp/emboss_cpp_types.h>, <source file runtime/cpp/emboss_cpp_util.h>, <source file runtime/cpp/emboss_defines.h>, <source file runtime/cpp/emboss_enum_view.h>, <source file runtime/cpp/emboss_maybe.h>, <source file runtime/cpp/emboss_memory_util.h>, <source file runtime/cpp/emboss_prelude.h>, <source file runtime/cpp/emboss_text_util.h>, <source file runtime/cpp/emboss_view_parameters.h>, <generated file external/pigweed/pw_bluetooth/public/pw_bluetooth/hci_common.emb.h>, <generated file external/pigweed/pw_bluetooth/public/pw_bluetooth/hci_vendor.emb.h>])

from emboss.

BenjaminLawson avatar BenjaminLawson commented on September 1, 2024

I found a terrible workaround. If I prefix all internal emboss C++ header includes with "external/com_googletest_emboss", then clang can find the headers:

#include "external/com_google_emboss/runtime/cpp/emboss_cpp_util.h"

from emboss.

tpudlik avatar tpudlik commented on September 1, 2024

Another workaround might be to add the includes = ["."] attribute to the cpp_utils cc_library.

@comius I suspect this should not be required, but there's a bug in how the Emboss build rules use cc_common. Could you take a look? Maybe the error will be obvious to you!

from emboss.

BenjaminLawson avatar BenjaminLawson commented on September 1, 2024

I found what seems to be a fix:

    runtime_cc_info = ctx.attr._emboss_cc_runtime[CcInfo]
    transitive_headers = depset(
        direct = headers,
        transitive = [
                         dep[EmbossCcHeaderInfo].transitive_headers
                         for dep in ctx.rule.attr.deps
                     ],
    )
    (cc_compilation_context, cc_compilation_outputs) = cc_common.compile(
        name = ctx.label.name,
        actions = ctx.actions,
        feature_configuration = feature_configuration,
        cc_toolchain = cc_toolchain,
        public_hdrs = headers,
        private_hdrs = transitive_headers.to_list(),
        compilation_contexts = [runtime_cc_info.compilation_context]
    )

Instead of adding the cpp_utils headers to private_hdrs, add the cpp_utils compilation context to cc_common.compile.

from emboss.

reventlov avatar reventlov commented on September 1, 2024

I'm happy to go with the compilation context fix, if that actually works. Hopefully that is the end of the problems, at least for now.

from emboss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.