Comments (8)
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.
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.
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.
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.
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.
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.
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.
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)
- Struct-level `[requires]` aren't enforced on field writes HOT 1
- C++ backend generates excessively large headers HOT 1
- `$next` isn't usable in setting virtual fields
- emboss fails to run on python 3.8
- Introduce keyword like $previous to clearly indicate overlapping fields HOT 4
- Provide support for private Aliases
- No way to place long boolean expressions on separate lines
- Update code to not have deprecated-copy warnings
- Build error in new version of Clang HOT 3
- Add .gni containing lists of files needed by GN HOT 5
- Missing inner array type dimensions errors do not include correct source locations HOT 3
- Bazel: cannot apply `tags` or `target_compatible_with` on `emboss_cc_library` rules
- Extraneous `<ostream>` in generated headers
- Use standard formatting and add automated checks for formatting
- Add automated typechecking
- Add automated checks for supported language versions/toolchains HOT 1
- Configure publish-to-bcr bot
- Emboss fails to run on Python 3.9 HOT 2
- Use bitfields when writing `bits` to avoid reading uninitialized memory
- Keep build_info.json up to date and in sync with bazel build HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emboss.