-
Notifications
You must be signed in to change notification settings - Fork 1.4k
plugins: Pass correct dependency origin information to plugins #7506
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SwiftPM sends information about the origin of each package dependency in the plugin context, but the PluginContext passed to the plugin function incorrectly showed all origins as 'root'. This happened because the origin field was hard-coded to 'root' in the plugin-side deserialization function.
@swift-ci test |
euanh
added a commit
to euanh/swift-package-manager
that referenced
this pull request
Apr 29, 2024
Cherry pick of swiftlang#7506 SwiftPM sends information about the origin of each package dependency in the plugin context, but the PluginContext passed to the plugin function incorrectly showed all origins as 'root'. This happened because the origin field was hard-coded to 'root' in the plugin-side deserialization function.
MaxDesiatov
reviewed
Apr 29, 2024
@swift-ci test |
MaxDesiatov
approved these changes
Apr 29, 2024
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.
Thanks! 🙏
euanh
added a commit
to euanh/swift-package-manager
that referenced
this pull request
Apr 29, 2024
Cherry pick of swiftlang#7506 SwiftPM sends information about the origin of each package dependency in the plugin context, but the PluginContext passed to the plugin function incorrectly showed all origins as 'root'. This happened because the origin field was hard-coded to 'root' in the plugin-side deserialization function.
@swift-ci test windows |
MaxDesiatov
pushed a commit
that referenced
this pull request
Apr 30, 2024
…7511) Cherry pick of #7506 **Explanation**: SwiftPM sends information about the origin of each package dependency to the plugin process, but the `PluginContext` passed to the plugin function incorrectly shows all origins as `root`. **Scope**: Isolated to `PackagePlugin/PluginContextDeserializer.swift` **Risk**: Low, isolated to plugins. **Testing**: Existing end-to-end automated test was modified to cover the fix. **Issue**: rdar://127104161 **Reviewer**: @MaxDesiatov ### Modifications: The necessary information is included correctly in the serialized structure sent to the plugin by SwiftPM. The startup wrapper code in the plugin process correctly deserializes it but does not copy it into the final `PluginContext` struct which is passed to the plugin function; instead, `origin` is hard-coded to `.root`. This change copies the dependency information into the final context struct. ### Result: Plugins receive correct information about package dependencies - `local`, with a local path, or `repository` with a URL, version number and revision hash.
furby-tm
pushed a commit
to wabiverse/swift-package-manager
that referenced
this pull request
May 15, 2024
…lang#7506) ### Motivation: SwiftPM sends information about the origin of each package dependency to the plugin process, but the `PluginContext` passed to the plugin function incorrectly shows all origins as `root`. ### Modifications: The necessary information is included correctly in the serialized structure sent to the plugin by SwiftPM. The startup wrapper code in the plugin process correctly deserializes it but does not copy it into the final `PluginContext` struct which is passed to the plugin function; instead, `origin` is hard-coded to `.root`. This change copies the dependency information into the final context struct. ### Result: Plugins receive correct information about package dependencies - `local`, with a local path, or `repository` with a URL, version number and revision hash.
furby-tm
pushed a commit
to wabiverse/swift-package-manager
that referenced
this pull request
May 15, 2024
…lang#7506) ### Motivation: SwiftPM sends information about the origin of each package dependency to the plugin process, but the `PluginContext` passed to the plugin function incorrectly shows all origins as `root`. ### Modifications: The necessary information is included correctly in the serialized structure sent to the plugin by SwiftPM. The startup wrapper code in the plugin process correctly deserializes it but does not copy it into the final `PluginContext` struct which is passed to the plugin function; instead, `origin` is hard-coded to `.root`. This change copies the dependency information into the final context struct. ### Result: Plugins receive correct information about package dependencies - `local`, with a local path, or `repository` with a URL, version number and revision hash.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
SwiftPM sends information about the origin of each package dependency to the plugin process, but the
PluginContext
passed to the plugin function incorrectly shows all origins asroot
.Modifications:
The necessary information is included correctly in the serialized structure sent to the plugin by SwiftPM. The startup wrapper code in the plugin process correctly deserializes it but does not copy it into the final
PluginContext
struct which is passed to the plugin function; instead,origin
is hard-coded to.root
.This change copies the dependency information into the final context struct.
Result:
Plugins receive correct information about package dependencies -
local
, with a local path, orrepository
with a URL, version number and revision hash.