Skip to content

[ParseableInterface] Pass prebuilt cache path down to sub-invocations #21513

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

Merged
merged 6 commits into from
Jan 9, 2019

Conversation

jrose-apple
Copy link
Contributor

Otherwise, the top-level compilation gets the benefit of the prebuilt cache path, but the sub-invocations for swiftinterfaces that do need to be compiled do not.

Also, don't serialize deps for explicit builds. If the frontend is invoked with -build-module-from-parseable-interface, we might be trying to persist and distribute the swiftmodule that gets built. In that case, any dependencies we list might not be relevant.

This probably isn't really the final answer here; what we want is some way to say which dependencies are relevant, and how they're related to how the swiftmodule that gets used. Most likely the right answer here is to limit this to dependencies within the SDK or something.

Builds on top of #21398 and #21512 because that's how I built them. Fixes the issue I spotted late in #21398.

When trying to load a swiftinterface, search this directory before
doing all the work of building a swiftmodule.
Makes this code easier to read. No functionality change.
The previous 'openModuleFiles' interface in SerializedModuleLoaderBase
still assumed that swiftmodule files and swiftdoc files would be found
next to each other, but that's not true anymore with
swiftinterfaces-built-to-modules. Give up on this assumption (and on
the minor optimization of passing down a scratch buffer) and split out
the interface into the customization point
'findModuleFilesInDirectory' and the implementation 'openModuleFiles'.
The latter now takes two full paths: one for the swiftmodule, one for
the swiftdoc.
This is a little trickier than it sounds because we have 'friend'
access into the FrontendInputsAndOutputs structure, which means all
the helpers need to be declared in the header file. But it makes the
two use sites simpler, and does slightly less work in the cache hit
path.
Otherwise, the top-level compilation gets the benefit of the prebuilt
cache path, but the sub-invocations for swiftinterfaces that /do/
need to be compiled do not.
If the frontend is invoked with
-build-module-from-parseable-interface, we might be trying to persist
and distribute the swiftmodule that gets built. In that case, any
dependencies we list might not be relevant.

This probably isn't really the final answer here; what we want is some
way to say /which/ dependencies are relevant, and how they're related
to how the swiftmodule that gets used. Most likely the right answer
here is to limit this to dependencies within the SDK or something.
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

Review ping

Copy link
Contributor

@nathawes nathawes left a comment

Choose a reason for hiding this comment

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

Sorry it took so long – looks good to me!

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