Skip to content
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

Merged

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Sep 11, 2020

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 (

# 310ba5ee72661c081129eb878c1bbcec936b20f0 is based on 3.8.0 with a fix for protobuf.bzl.
, now 3.9.2: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/workspace.bzl#L628) which has it: https://github.com/protocolbuffers/protobuf/blob/v3.8.0/src/google/protobuf/port_def.inc
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

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-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Sep 11, 2020
@gbaned gbaned self-assigned this Sep 11, 2020
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Sep 11, 2020
"google/protobuf/wrappers.proto",
]

genrule(
name = "link_headers",
outs = HEADERS,
name = "link_proto_files",
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Sep 15, 2020
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Sep 15, 2020
@rthadur rthadur added kokoro:force-run Tests on submitted change and removed kokoro:force-run Tests on submitted change labels Sep 15, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Sep 15, 2020
@tensorflow-copybara tensorflow-copybara merged commit 24e7386 into tensorflow:master Sep 16, 2020
PR Queue automation moved this from Approved by Reviewer to Merged Sep 16, 2020
@Flamefire Flamefire deleted the fix-system-protobuf-headers branch September 16, 2020 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

7 participants