Skip to content

Conversation

@polac24
Copy link
Collaborator

@polac24 polac24 commented Jun 4, 2023

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

  • Add swift-frontent executables to the released .zip package
  • Add integration E2E tests
  • Include support for integrations (both standalone and CocoaPods)

^ All these missing parts will be added in Part IV (Draft)

```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}"
Copy link
Collaborator Author

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
aleksandergrzyb previously approved these changes Jun 6, 2023
Copy link
Contributor

@aleksandergrzyb aleksandergrzyb left a 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.
Copy link
Contributor

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.

Copy link
Collaborator Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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

@polac24 polac24 force-pushed the add-driver-sync branch from 9d484c9 to f4eed9e Compare June 6, 2023 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants