Open
Description
Describe the Feature
@tido64 noted in facebook/react-native-website#3027 (comment) (a pull request that implies using ccache is great) that if you enable static analysis in your Xcode project, ccache is incompatible because of some pathing issues inside Xcode tooling
Possible Implementations
- inspect pbxproj files for static analysis flags
- somehow discover if ccache is in use on the system for the Xcode build?
- inspect pbxproj?
- check Podfile for CLANG/CLANG++ etc settings in post_install?
- check environment variables - somehow as they are setup for build - to see if CLANG is defined && CCACHE_DISABLE is not?
Related Issues
Linked above
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
mikehardy commentedon Mar 30, 2022
I looked through the react-native-macos CI definition files but they are pretty modular and I was unable to find the specific pbxproj settings to examine, so for that part at least I suppose checking the diff of the pbxproj file before and after toggling them on (and seeing the failure if ccache is in use - to make sure this happens!) is the way to determine them.
And if we can't determine ccache is in use at all, we could at least emit an info line perhaps saying "static analysis will not work in combination with compiler caches, ensure compiler caches are disabled" or similar
tido64 commentedon Mar 30, 2022
Compiler flags are in separate
.xcconfig
files. You can find the ones for iOS and macOS here:In CocoaPods/Ruby, you can get the resolved build settings using xcodeproj (example). I don't know if there's an equivalent in JS.
I'm not sure how you can reliably detect whether Ccache is in use. You'd have to invoke xcodebuild and see which compiler it is using, and scan the binary for
ccache
references?mikehardy commentedon Mar 30, 2022
Thanks so much for those pointers! One of the main Flutter advantages at the moment is "developer tooling", that's pretty vague but people always talk about how great it is. I think a large part of that is their doctor checks and bug reporting infrastructure so I'm queuing up a large set of hopefully-improvements inspired by that ecosystem and how well their doctor + bug report stuff works. So knowing more about how to perform these inspections is really helpful
Anyway - I am also not sure at all how to figure out the xcodebuild settings since you can just set environment variables on the command line as well, thus my thought on simply being informative / giving soft advice in known-incompatible cases
github-actions commentedon Nov 26, 2022
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
tido64 commentedon Nov 28, 2022
@mikehardy: Should we close this? Prefabs will be enabled as of 0.71 so I don't know how relevant this will be for 99% of use cases.
mikehardy commentedon Nov 28, 2022
While I understand the Pareto Principle is critical to employ in much software development, I think the hope for the doctor scripts is that they are not just 80% good but that they are excellent / world-class, implying that they are 99.999% or similar. Which also implies that if there's a known incompatibility in certain combinations and it is detectable, it should be done.
But open source being what it is, maybe that's just one more stale cycle then if it is still just hanging out, the issue goes to 🛌
adamTrz commentedon Nov 28, 2022
Hey @mikehardy @tido64 , thanks for responding to the issue and turning it back life 🙂
Any wat we can help here?
mikehardy commentedon Nov 28, 2022
I think a successful implementation will resolve via some exploration the questions in the comment above #1576 (comment)
1- obtain and resolve Xcode settings to see if static analysis is enabled
2- determine if ccache is in use
For 1, it may be that doctor has an enhanced mode that allows for some otherwise-optional download+installs and xcodeproj is used to analyze settings?
For 2, it may be a good start to do a
which clang
and compare it to InstalledDir ofclang --version
for difference (see below) or perhaps checkwhich clang
, check whether it is a symbolic link, check if dereferenced symbolic link goes to ccache?github-actions commentedon Feb 27, 2023
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
tido64 commentedon Feb 28, 2023
We can probably use
readlink
to detect Ccache:Also, is there a tag we can add to prevent the bot from tagging this as stale?