Skip to content

Put the output of the (Linux) autolink step in the same place as the .o files #359

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 3 commits into from
Nov 12, 2020

Conversation

davidungar
Copy link
Contributor

@davidungar davidungar commented Nov 12, 2020

Following the legacy driver, put the output of the autolink step in the same place as the .o files, instead of in a temp directory. That way, we could possibly omit this step in the future in an incremental build.

rdar://70961296

@davidungar
Copy link
Contributor Author

@swift-ci please test

let plannedJobs = try! driver.planBuild()
let autolinkExtractJob = plannedJobs
.filter { $0.kind == .autolinkExtract }
.first!
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny nit: Can you use try XCTUnwrap(...) instead? Just so that if this ends up nil, it fails the test rather than crashing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Great catch, didn't think about XCTUnwrap.

@davidungar
Copy link
Contributor Author

@swift-ci please test

@davidungar davidungar merged commit b6f7956 into swiftlang:main Nov 12, 2020
Comment on lines +565 to +566
.filter { $0.kind == .autolinkExtract }
.first)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is test code so it doesn't really matter, but I like when people point things like this out to me.

You can use first(where:) https://developer.apple.com/documentation/swift/array/1848165-first to avoid iterating the whole array in cases like this, instead of doing filter then first.

@davidungar davidungar deleted the incremental-11-6-autolink branch January 29, 2021 17:33
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