Skip to content
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

Add support for loaded module trace emission #278

Merged
merged 1 commit into from
Sep 27, 2020

Conversation

owenv
Copy link
Contributor

@owenv owenv commented Sep 27, 2020

Since the docs for this aren't open source, I'm not sure my test cases are all that great, but all the relevant integration tests are passing now and the implementation wasn't as complicated as I expected. The use of a "claimed" bit on Driver.loadedModuleTracePath is definitely a bit of a hack though.

Fixes:
Driver/loaded_module_trace.swift
Driver/loaded_module_trace_append.swift
Driver/loaded_module_trace_env.swift
Driver/loaded_module_trace_foundation.swift
Driver/loaded_module_trace_header.swift
Driver/loaded_module_trace_multifile.swift
Driver/loaded_module_trace_spi.swift

@owenv
Copy link
Contributor Author

owenv commented Sep 27, 2020

@swift-ci test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

One question about mutable state, but otherwise it's looking good. @varungandhi-apple might want to take a peek, but that can be post-merge review

/// Path to the loaded module trace file, and whether it has been claimed by
/// a frontend job. It's important to track this because only one frontend
/// job should be used for module trace emission.
var loadedModuleTracePath: (VirtualPath, claimed: Bool)?
Copy link
Member

Choose a reason for hiding this comment

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

Mutable state, hmmm. Is there some way we could ensure that only one fronted job gets assigned this task without having this but if mutable state? E.g., have planning treat the first batch as special?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing that info through compile planning adds a little bit of boilerplate, but yeah, it's probably best to avoid mutable state here.

@owenv
Copy link
Contributor Author

owenv commented Sep 27, 2020

@swift-ci test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Thank you!

@owenv owenv merged commit 8b2db00 into swiftlang:main Sep 27, 2020
@varungandhi-apple
Copy link
Contributor

Are the trace tests being run with the new driver as well? Or were they already being run and failing? I'm not sure how the testing is structured there, I don't see anything in this PR adding something which makes sure those tests are run.

@cltnschlosser
Copy link
Contributor

Are the trace tests being run with the new driver as well? Or were they already being run and failing? I'm not sure how the testing is structured there, I don't see anything in this PR adding something which makes sure those tests are run.

They aren’t run in CI, but we have a mechanism to run them. So they were failing before.

@owenv
Copy link
Contributor Author

owenv commented Sep 27, 2020

Yeah, IntegrationTests.swift is setup to run them if the path to a checkout of the main Swift repo is provided. As @cltnschlosser mentioned, none of the CI jobs are running these yet, so I just verified it locally

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.

None yet

4 participants