New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not symlink system protobuf headers but only the required .proto files #43153
Do not symlink system protobuf headers but only the required .proto files #43153
Conversation
Symlinking the system headers has proven to be problematic as newer versions of protobuf add or remove headers which makes having a static array of header files hard to impossible. Turns out the headers don't need to be symlinked at all but only the .proto files used as inputs need to be present.
"google/protobuf/wrappers.proto", | ||
] | ||
|
||
genrule( | ||
name = "link_headers", | ||
outs = HEADERS, | ||
name = "link_proto_files", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule is no longer used now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is ok. I'm not fully sure but as it declares the outs
the rules using the proto files will run this implicitly. Or do I misunderstand that? I'll rerun the build to verify just to make sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My tests on 2 different systems using this succeeded, so my assessment seems to be correct.
Symlinking the system headers has proven to be problematic as newer versions of protobuf add or remove headers which makes having a static array of header files hard to impossible. Turns out the headers don't need to be symlinked at all but only the .proto files used as inputs need to be present.
Example: In #34792 @cbalint13 removed the
port_def.inc
"header". But the workspace.bzl requests protobuf 3.8.0 (tensorflow/tensorflow/workspace.bzl
Line 423 in 610a78b
This leads to build failures due to this missing (although I think if all would be working well it would just take the header from the system if
$INCLUDEDIR
is in the compilers header search path).This partially resolves/helps #37861