-
Notifications
You must be signed in to change notification settings - Fork 52
[SwiftDriver] Part III - Introduce synchronization between swift-frontend invocations #210
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
Conversation
| ```shell | ||
| ditto "${SCRIPT_INPUT_FILE_0}" "${SCRIPT_OUTPUT_FILE_0}" | ||
| [ -f "${SCRIPT_INPUT_FILE_1}" ] && ditto "${SCRIPT_INPUT_FILE_1}" "${SCRIPT_OUTPUT_FILE_1}" || rm "${SCRIPT_OUTPUT_FILE_1}" | ||
| [ -f "${SCRIPT_INPUT_FILE_1}" ] && ditto "${SCRIPT_INPUT_FILE_1}" "${SCRIPT_OUTPUT_FILE_1}" || rm -f "${SCRIPT_OUTPUT_FILE_1}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sidefix: found that if a first build has a cache miss, this snippet fails with an error that $SCRIPT_OUTPUT_FILE_1 doesn't exist. In such cases, we can safely no-op (so forcing rm)
aleksandergrzyb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
| ## Architectural designs | ||
| Follow the [Architectural designs](docs/design/ArchitecturalDesigns.md) document that describes and documents XCRemoteCache designs and implementation details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Minor - the graphs are hard to read for dark mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for spotting that! Fixed it.
| /// the critical section, the code realizes that remote cache cannot be used | ||
| /// (in practice - a new file has been added) | ||
| /// None of compilation process (so with '-c' args) can continue until the entire emit-module logic finishes | ||
| /// Because it is expected to happen no that often and emit-module is usually quite fast, this makes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// Because it is expected to happen no that often and emit-module is usually quite fast, this makes the | |
| /// Because it is expected to happen not that often and emit-module is usually quite fast, this makes the |
This is the main PR of the Swift driver integration: synchronizes all swift-frontend invocations so emit-module (which is responsible to make the last check if the cached artifact can be used) is blocking
swift-frontent -c(compilation) invocations.Context
Because the design and implementation might not be obvious(relies on the swift driver integration in Xcode), they are documented in the markdown file (part of this PR), available to review here.
Previous PRs (#209 and #208)
Next steps
swift-frontentexecutables to the released .zip package^ All these missing parts will be added in Part IV (Draft)