Skip to content

refactor workspace initializers #3664

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
Aug 16, 2021

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Aug 14, 2021

motivation: nicer API to work with

changes:

  • deprecate previous initializer
  • introduce new initializer with minimal signatures, and clearly defined argument names and API docs
  • make DependencyMirrors thread safe
  • adjust call sites

motivation: nicer API to work with

changes:
* deprecate previous initializer
* introduce new initializer with minimal signatures, and clearly defined argument names and API docs
* make DependencyMirrors thread safe
* adjust call sites
@tomerd
Copy link
Contributor Author

tomerd commented Aug 14, 2021

@abertelrud @neonichu looking for feedback on this approach. the idea is to clean up the workspace initializers even further as part of tightening the public API. this will help us also make forward on the pending configuration work. key changes are in Workspace, the rest is adjustments to those changes

@tomerd
Copy link
Contributor Author

tomerd commented Aug 14, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Aug 14, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Aug 14, 2021

<unknown>:0: error: module file '/home/buildnode/jenkins/workspace/swift-package-manager-Linux-smoke-test/branch-main/build/buildbot_incremental/foundation-linux-x86_64/module-cache/311V2OL35L4I3/SwiftShims-3849312O4BV1I.pcm' is out of date and needs to be rebuilt: signature mismatch
22:26:54 <unknown>:0: note: imported by module 'SwiftOverlayShims' in '/home/buildnode/jenkins/workspace/swift-package-manager-Linux-smoke-test/branch-main/build/buildbot_incremental/foundation-linux-x86_64/module-cache/311V2OL35L4I3/SwiftOverlayShims-3849312O4BV1I.pcm'
22:26:54 
/home/buildnode/jenkins/workspace/swift-package-manager-Linux-smoke-test/branch-main/swift-corelibs-foundation/Sources/Foundation/Data.swift:25:8: error: missing required module 'SwiftOverlayShims'
22:26:54 import Glibc

@swift-ci please smoke test linux

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Aug 14, 2021
@tomerd tomerd self-assigned this Aug 14, 2021
private let isPrefetchingEnabled: Bool
private let prefetchingEnabled: Bool

/// Skip updating containers while fetching them.
private let updateEnabled: Bool
Copy link
Contributor

Choose a reason for hiding this comment

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

The API design guidelines recommend the old names. https://swift.org/documentation/api-design-guidelines/#boolean-assertions

I think the new names can be mis-interpreted as properties that return a new DependencyMirrors with prefetching or update enabled, without reading the documentation.

@tomerd tomerd force-pushed the refactor/workspace-initializers branch from 56f6939 to 67a0d37 Compare August 16, 2021 18:03
@tomerd
Copy link
Contributor Author

tomerd commented Aug 16, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Aug 16, 2021

Ci failure due to changes in swift driver. cc @artemcm

@artemcm
Copy link
Contributor

artemcm commented Aug 16, 2021

Ci failure due to changes in swift driver. cc @artemcm

Should be fixed with swiftlang/swift-driver#797.
Sorry for the trouble.

@artemcm
Copy link
Contributor

artemcm commented Aug 16, 2021

@swift-ci please smoke test

Copy link
Contributor

@abertelrud abertelrud left a comment

Choose a reason for hiding this comment

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

@abertelrud @neonichu looking for feedback on this approach. the idea is to clean up the workspace initializers even further as part of tightening the public API. this will help us also make forward on the pending configuration work. key changes are in Workspace, the rest is adjustments to those changes

This looks like great cleanup.

@elsh elsh merged commit 4633b26 into swiftlang:main Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants