Skip to content

Add driver support to specify an overriding output path to record in the index data #516

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
Mar 6, 2021

Conversation

nathawes
Copy link

@nathawes nathawes commented Mar 2, 2021

The frontend supports this via new options -index-unit-output-path and -index-unit-output-path-filelist that mirror -o and -output-filelist. These are intended to allow sharing index data across builds in separate directories (so different -o values) that are otherwise equivalent as far as the index data is concerned (e.g. an ASAN build and a non-ASAN build) by supplying the same -index-unit-output-path for both.

This change updates the driver to add these new options to the frontend invocation 1) when a new "index-unit-output-path" entry is specified for one or more input files in the -output-file-map json or 2) when -index-file is specified (guaranteeing a single primary input) and a new -index-unit-output-path driver option is passed.

Equivalent change for the old driver here: swiftlang/swift#36272

Resolves rdar://problem/74816412

@nathawes
Copy link
Author

nathawes commented Mar 2, 2021

@swift-ci please test

@nathawes nathawes force-pushed the add-index-unit-output-path branch from 0bb1713 to 57c9789 Compare March 3, 2021 03:02
@nathawes
Copy link
Author

nathawes commented Mar 3, 2021

@swift-ci please test

@nathawes nathawes force-pushed the add-index-unit-output-path branch from 57c9789 to b990ca9 Compare March 4, 2021 07:47
@nathawes
Copy link
Author

nathawes commented Mar 4, 2021

@swift-ci please test

@nathawes nathawes changed the title [WIP] Add driver support for specifying the output path to record in the index data separately from -o [WIP] Add driver support to specify an overriding output path to record in the index data Mar 5, 2021
@nathawes nathawes force-pushed the add-index-unit-output-path branch from b990ca9 to 4652a29 Compare March 5, 2021 02:54
@nathawes
Copy link
Author

nathawes commented Mar 5, 2021

@swift-ci please test

@nathawes nathawes requested review from akyrtzi and artemcm March 5, 2021 02:55
@nathawes nathawes changed the title [WIP] Add driver support to specify an overriding output path to record in the index data Add driver support to specify an overriding output path to record in the index data Mar 5, 2021
@nathawes nathawes marked this pull request as ready for review March 5, 2021 05:05
Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

The way we generate options in swift-driver makes it preferable to first merge the options update in swift, and then automatically re-generate here from that and then merge.

But other than that this change looks good!

/// Output path to record in the indexing data store
///
/// This is only needed for use as a key in the output file map.
case indexUnitOutputPath
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I'm now realizing that indexData is the same pattern; but, everything else here is a file type, whereas indexData and indexUnitOutputPath are just directories.
It may be worth refactoring in the future to be a common directory FileType, with an enum associated value for the specific kind of directory. But it's alright in this PR.

…the index data

The frontend supports this via new options -index-unit-output-path and
-index-unit-output-path-filelist that mirror -o and -output-filelist. These are
intended to allow sharing index data across builds in separate directories (so
different -o values) that are otherwise equivalent as far as the index data is
concerned (e.g. an ASAN build and a non-ASAN build) by supplying the same
-index-unit-output-path for both.

This change updates the driver to add these new options to the frontend
invocation 1) when a new "index-unit-output-path" entry is specified for one
or more input files in the -output-file-map json or 2) if -index-file is
specified, when a new -index-unit-output-path driver option is passed.

Resolves rdar://problem/74816412
@nathawes nathawes force-pushed the add-index-unit-output-path branch from 4652a29 to 9da73a9 Compare March 6, 2021 12:33
@nathawes
Copy link
Author

nathawes commented Mar 6, 2021

@swift-ci test and merge

@nathawes
Copy link
Author

nathawes commented Mar 6, 2021

@swift-ci please test

@nathawes nathawes merged commit e7b468a into swiftlang:main Mar 6, 2021
@nathawes nathawes deleted the add-index-unit-output-path branch March 6, 2021 13:02
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