Skip to content

Support hermetic index store data via path remappings #4207 #4267

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
May 16, 2022

Conversation

DavidGoldman
Copy link

  • When indexing, -fdebug-prefix-map will be used to remap
    paths so the computed index data will be hermetic. This
    includes the unit files' names as well as all paths embedded
    in the unit files.

  • When reading, a reverse mapping can be used e.g. via
    indexstore_store_create_with_options to automatically
    remap the hermetic index data to the correct local paths.

Same as #4207 but against stable/20211024 instead of apple:next

@bnbarham
Copy link

Same comment as the previous PR, ie. it'd be nice to extract the map into its own type. Otherwise LGTM.

I've started the tests on the swift branch, though it will need to be updated as well as there's a conflict now.

@DavidGoldman
Copy link
Author

PTAL

Copy link

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

Thanks for adding that :). I still need to go through the tests properly, not sure if I'll have time tomorrow but... hopefully 🤞

@DavidGoldman
Copy link
Author

@swift-ci please test

@DavidGoldman
Copy link
Author

How is this looking - can we test this here or does it need to be on the Swift PR?

@bnbarham
Copy link

bnbarham commented May 6, 2022

Can test here as well, Swift PR would just test more is all. Could you clean up the commits in a rebase and then I'll run the tests?

EDIT: Actually, this changes API that Swift uses - so we should make sure it's passing before we merge. And also merge both close to each other to avoid spurious failures.

@DavidGoldman
Copy link
Author

Yeah will do, I'm just having issues building swift at all now, need to figure out why it's broken even without my changes

- When indexing, `-fdebug-prefix-map` will be used to remap
  paths so the computed index data will be hermetic. This
  includes the unit files' names as well as all paths embedded
  in the unit files.

- When reading, a reverse mapping can be used e.g. via
  `indexstore_store_create_with_options` to automatically
  remap the hermetic index data to the correct local paths.
@DavidGoldman
Copy link
Author

Squashed and rebased here

@bnbarham
Copy link

swiftlang/swift#42394

@swift-ci please test

@bnbarham
Copy link

swiftlang/swift#42394

@swift-ci please test

@bnbarham
Copy link

swiftlang/swift#42394

@swift-ci please test

Copy link

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks David!

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