Skip to content

Briefly describe all of the formats in SupplementaryOutputPaths.h. #18187

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 1 commit into from
Jul 25, 2018

Conversation

jrose-apple
Copy link
Contributor

Prompted by #18090. Note that the docs for ModuleInterfaceOutputPath are still a little sparse because I'm going to add a "see also" link very soon. That new swift::emitModuleInterface will have the link to the forum post.

@jrose-apple jrose-apple requested a review from davidungar July 24, 2018 20:27
/// This is a JSON-based format that is used by the migrator, but is not
/// really vetted for anything else.
///
/// \sa swift::writeEditsInJson
std::string FixItsOutputPath;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nkcsgexi This format could use some documentation somewhere, even if includes a disclaimer about using it for anything else!

/// This is a JSON-based format that encodes which modules have been loaded.
/// It's based on the same file-based information as the Make-style
/// dependencies.
///
/// It is currently only used with WMO, but could be generalized.
std::string LoadedModuleTracePath;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@huonw This format could use documentation somewhere, even if we want to say "the details are subject to change because Apple uses it for things".

Copy link
Contributor

Choose a reason for hiding this comment

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

When I read "currently only used with WMO", I wonder what it's used for with WMO, and why not with other modes? (Don't know the best place to explain, though.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Does somewhere include here? If so:

The file is appended to, and consists of line-delimited JSON objects, where each line is of the form { "name": NAME, "target": TARGET, "swiftmodules": [PATH, PATH, ...] }, representing the (real-path) PATHs to each .swiftmodule that was loaded while building module NAME for target TARGET. This format is subject to arbitrary change.

Also, I think the "only used with WMO" comment is now wrong. It is only used with the first frontend invocation, but it works for incremental and WMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can include that.

///
/// Only makes sense when the compiler has whole-module knowledge.
///
/// \sa swift::writeTBDFile
std::string TBDPath;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll poke the Clang folks to see if there's any documentation I can link to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

…apparently there isn't today. Oh well.

Copy link
Contributor

Choose a reason for hiding this comment

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

I want to say (may not be accurate) "consumed by the driver to optimize linking" or whatever the accurate version is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"which clients can link against without having an actual dynamic library binary" doesn't cover that? (It's consumed by the linker.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I had read the conversation and somehow didn't see that. In my ignorance, I'm left wondering how a client can link against something without a library binary? But that's not needed here. So, would the TBD file be used by "ld"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the Apple linker ld/ld64 has support for these text-based stubs, and, as Jordan says, it can consume them for linking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Whether or not that's supported is an implementation detail of a particular linker, though. I'm pretty sure Apple's ld64 and maybe LLVM's lld are the only ones.

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Contributor

@davidungar davidungar 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! I mentioned a couple of things, but not critical at all.

@jrose-apple jrose-apple force-pushed the supplementary-information branch from be476de to a0a1435 Compare July 25, 2018 02:41
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple jrose-apple merged commit e3ccde3 into swiftlang:master Jul 25, 2018
@jrose-apple jrose-apple deleted the supplementary-information branch July 25, 2018 15:42
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.

3 participants