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

clang module cache not being reused in darwin sandbox #1873

Closed
mikelikespie opened this issue Oct 4, 2016 · 4 comments
Closed

clang module cache not being reused in darwin sandbox #1873

mikelikespie opened this issue Oct 4, 2016 · 4 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) type: feature request z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple

Comments

@mikelikespie
Copy link
Contributor

I noticed compiling to be significantly slower on versions of macOS where sandboxing is enabled (seems to not be enabled on macOS yet). The behavior described in getCompileRuleCopts() comments don't seem to be behaving.

If I understand how the sandboxing works, it sym/hardlinks all the input files to a temp directory. If the directory specified for the module cache is in the genfiles dir, it seems like each file it compiles will get an empty directory as input. This causes it to reparse imported modules each time.

@damienmg
Copy link
Contributor

damienmg commented Oct 6, 2016

/cc @philwo for the general sandboxing things
/cc @hermione521 for the OS X sandbox but I think it is not specific to OSX
and pulling @klimek and @lberki for explaining how C++ clang module works

@r4nt
Copy link
Contributor

r4nt commented Oct 6, 2016

Generally, the clang module cache feature is at odds with sandboxing (it creates a shared global module cache in /tmp, so it assume non-hermetic compilation), so the slow down is fully expected; you're essentially doing quadratic work here (recompile all transitive modules on every compile step).
You can imagine the clang module cache as it's own little C++ build system.

For C++ modules builds, we are using explicit module builds, and we are modeling the module outputs (pcm files) within bazel. For Obj-C this has (as far as I undersatnd) yet to be done; I guess the main work will be to actually figure out how to pass framework modules to the build correctly when implicit module builds are disabled.

@damienmg
Copy link
Contributor

damienmg commented Oct 6, 2016

Ok so reassigning to Objc for Objc / C++ interop /cc @calpeyser

@aragos aragos added the P2 We'll consider working on this in future. (Assignee optional) label Dec 7, 2016
@aragos aragos added this to the 0.6 milestone Dec 7, 2016
@meisterT meisterT removed this from the 0.6 milestone May 11, 2020
@meisterT meisterT added z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple and removed category: rules > ObjC / iOS / J2ObjC labels May 11, 2020
@jmmv
Copy link
Contributor

jmmv commented May 14, 2020

Will make a dup of #7527 which has more information.

@jmmv jmmv closed this as completed May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: feature request z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple
Projects
None yet
Development

No branches or pull requests

7 participants