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

Add /Applications/ to cxx_builtin_include_directories #7783

Closed
wants to merge 1 commit into from

Conversation

keith
Copy link
Member

@keith keith commented Mar 20, 2019

This makes sure that all paths that point inside the Applications
directory on macOS are considered cxx_builtin_include_directories. The
goal here is to make sure that paths in produced .d files are
correctly translated by bazel to local paths when the .d files are
shared with the remote cache to machines that have Xcode installed in
different locations.

Fixes #7772

This makes sure that all paths that point inside the Applications
directory on macOS are considered cxx_builtin_include_directories. The
goal here is to make sure that paths in produced `.d` files are
correctly translated by bazel to local paths when the `.d` files are
shared with the remote cache to machines that have Xcode installed in
different locations.
@keith
Copy link
Member Author

keith commented Mar 25, 2019

@hlopko can you review this?

@hlopko
Copy link
Member

hlopko commented Mar 26, 2019

Hi Keith (for the 4th time today :)

To have better picture, how does your .d file look like before this change and after it?

@keith
Copy link
Member Author

keith commented Mar 26, 2019

@hlopko 😄 thanks for reviewing all of these!

AFAIK this doesn't change the contents of the .d file, it just remaps it when bazel reads them to make sure that this developer specific path is treated as such and not expected to be stable across machines. From my conversation with @DavidGoldman about this it sounds like Google does something internally as well?

@keith
Copy link
Member Author

keith commented Mar 26, 2019

I've verified this in an e2e test for #7772 that this fixes it, I looked around a bit more and I believe it's because of logic like this:

Iterable<PathFragment> ignoreDirs =
cppConfiguration.isStrictSystemIncludes()
? getBuiltInIncludeDirectories()
: getValidationIgnoredDirs();
Set<Artifact> missing = Sets.newHashSet();
// Lazily initialize, so that compiles that properly declare all their files profit.
Set<PathFragment> declaredIncludeDirs = null;
for (Artifact header : undeclaredHeaders) {
if (FileSystemUtils.startsWithAny(header.getExecPath(), ignoreDirs)) {
continue;
}

That doesn't make the build fail because these headers are missing since this the paths to Xcode are under the ignored directory with this change.

@keith
Copy link
Member Author

keith commented Mar 28, 2019

@hlopko this one could use another look 🙏

@bazel-io bazel-io closed this in 8ba86a0 Mar 28, 2019
@keith keith deleted the ks/applications-include branch March 28, 2019 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants