-
Notifications
You must be signed in to change notification settings - Fork 1.4k
refactor managed dependencies #3698
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
Conversation
needs #3696 first |
615bd43
to
f1c22db
Compare
@swift-ci please smoke test |
f1c22db
to
99d23a6
Compare
@swift-ci please smoke test |
99d23a6
to
53e43db
Compare
@swift-ci please smoke test |
Sources/Workspace/Workspace.swift
Outdated
} else { | ||
currentDependency = nil | ||
} | ||
let currentDependency = self.state.dependencies[packageRef.identity] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀 plz help make sure the logic here hasn't regressed
3386076
to
adb61b3
Compare
@swift-ci please smoke test |
@swift-ci please test package compatibility |
@abertelrud @neonichu @shahmishal I looked at the package compatibility test and Kitura 5.1 is now failing due to an improved validation that we introduced in #3687 (which is already merged, so not this PR)
the question is what the best strategy here, since the new validation find an issue with the existing code which used to "work" but was never valid and can lead to undefined behavior. should we remove the version of kitura from the compatibility suite until its fixed there, or do you have a better way? |
@swift-ci please test package compatibility |
Seems similar to a marking a unit test as failing for external reason, except at a whole-package level. Could we let them know about the problem, disable Kitura, and then reenable it when they have a version that fixes the problem? |
I relaxed the error to warning for now which means the test suite passes. once we escalate to an error again (next major release) we will see if they fixed it already or we need to ask them to do so |
adb61b3
to
0f377e0
Compare
@swift-ci please smoke test |
@swift-ci please test package compatibility |
@mattt this should be in a bit of a better shape now. can you test to see if it works for you? |
@swift-ci please smoke test |
4adf6f8
to
de10175
Compare
@swift-ci please smoke test |
@mattt did you add commits here that I mistakingly override? |
@swift-ci please test package compatibility |
I applied the typo fix suggestion from my original PR review earlier this morning ( $ curl https://github.com/apple/swift-package-manager/commit/4adf6f87568bbd8cc5c80bfa29bd75ea1a1adc0c.patch | git am |
@abertelrud @neonichu ptal so we can merge this |
return ManagedDependency( | ||
packageRef: packageRef, | ||
state: .local, | ||
// FIXME: This is just a fake entry, we should fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that for a later PR, or a FIXME for a future update of this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this FIXME was there before, so not a new thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think we should fix this, but it was not in scope for this PR
/// If the path is non-nil, the dependency is managed by a user and is | ||
/// located at the path. In other words, this dependency is being used | ||
/// for top of the tree style development. | ||
case edited(basedOn: ManagedDependency?, unmanagedPath: AbsolutePath?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it an error state for the basedOn
to be nil
here? Just asking for my understanding...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big picture, the whole "edited" feature needs to go away.
specifically, the basedOn can be nil in some situation unfortunately - tired to make it required but the logic still requires it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, I think once we have explicit overrides, we can get rid of edit mode and therefore the entirety of managed dependencies.
motivation: ManagedDependencies are based on location instead of on identity, refactor them to be based on identity as part of the transition to identity based logic changes: * transition ManagedDependencies underlying hashmap to be based on identity * update the ManagedDependencies edit state to include the "basedOn" property which is only relevant to that state * update calls ites to use package identity instead of location when reading/writing managed depedencies * refactor related call-sites to handle edited state more safely and correctly * add code comments to explain some of the more subtle business logic * adjust tests where needed
de10175
to
3e343ce
Compare
@swift-ci please smoke test |
@swift-ci please test package compatibility |
motivation: ManagedDependencies are based on location instead of on identity, refactor them to be based on identity as part of the transition to identity based logic
changes:
rdar://82954076