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

envoy windows build fails: fatal error C1083: Cannot open include file #12098

Closed
Charana123 opened this issue Jul 15, 2020 · 5 comments
Closed

Comments

@Charana123
Copy link

Charana123 commented Jul 15, 2020

After following steps to setup the build environment for windows, i've tried building my custom http and the example-filter (without modifications) and both run into the same build error when running bazel build //:envoy

ERROR: C:/tmp/6yiwbu4d/external/envoy/source/extensions/stat_sinks/metrics_service/BUILD:29:17: 
C++ compilation of rule '@envoy//source/extensions/stat_sinks/metrics_service:metrics_proto_descriptors_lib' failed (Exit 2)
external/envoy/source/extensions/stat_sinks/metrics_service/grpc_metrics_proto_descriptors.cc(1): 
fatal error C1083: Cannot open include file: 'extensions/stat_sinks/metrics_service/grpc_metrics_proto_descriptors.h': No such file or directory

The particular .cc/.h pair can change every build.
I then tried building envoy (without modification) and ran into the same issue.

ERROR: C:/users/piq_user/documents/envoy/source/extensions/resource_monitors/injected_resource/BUILD:12:1:
C++ compilation of rule '//source/extensions/resource_monitors/injected_resource:injected_resource_monitor' failed (Exit 2)
source/extensions/resource_monitors/injected_resource/injected_resource_monitor.cc(1):
fatal error C1083: Cannot open include file: 'extensions/resource_monitors/injected_resource/injected_resource_monitor.h': No such file or directory

But after adding startup --output_user_root=C:/tmp to the .bazelrc, as advised by bazels tips for windows, envoy built successfully. This makes me suspect this issue has something to do with windows maximum path limitations. The problem still persists for the example-filter and my custom filter. It doesn't seem to matter what versions of bazel or envoy i use (i've tried the latest for both).

@junr03
Copy link
Member

junr03 commented Jul 15, 2020

@wrowe @sunjayBhatia

@Charana123
Copy link
Author

Charana123 commented Jul 20, 2020

@wrowe @sunjayBhatia any ideas how to compile envoy on windows as a project dependency ?

@wrowe
Copy link
Contributor

wrowe commented Jul 21, 2020

after adding startup --output_user_root=C:/tmp to the .bazelrc, as advised by bazels tips for windows,

Perhaps we should amend the PORTING.md notes under development as PR #11721, to describe the error encountered (including the related long include paths error fixed in PR #10560) to describe this workaround, and guidance to avoid very long project paths (which occur most often in the source/extensions/... tree structure). Path overrides are already attributes of our suggested docker build container and presented by example with a very terse output_base suggested in ci/windows_ci_steps.sh

any ideas how to compile envoy on windows as a project dependency ?

Not sure what you mean here, how building envoy with bazel as a dependency on Windows would vary from Unix? Or whether it is supported at all? I don't know whether this is a possibility, given the monolithic assembly which is envoy-static, it may be worth asking more experienced bazel gurus at envoy, such as on the #bazel channel of the envoyproxy.slack.com group.

@sunjayBhatia
Copy link
Member

@Charana123 are you still having issues with this? Or any responses to the previous comment? Your instinct about max path lengths is correct and is mostly a Bazel issue (due to the deep filesystem tree it generates for builds) rather than an Envoy-specific one

@wrowe
Copy link
Contributor

wrowe commented Sep 2, 2020

I'll go on the presumption that the documentation revisions cover your frustration, sorry you were tripped up over this frustrating issue. If you have further problems with include files, I'm happy to reopen this ticket, for other questions please feel free to open a new ticket specific to the specific issue. Thanks for participating!

@wrowe wrowe closed this as completed Sep 2, 2020
mattklein123 pushed a commit that referenced this issue Sep 2, 2020
- No longer limited to building envoy-static
- Explain the c:\c -> c:\ symlink and TMPDIR more clearly
- Explain output_base path limitations
  #12098
- General wordsmithing

Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
Co-authored-by: Sunjay Bhatia <sunjayb@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants