Skip to content

Comments

fix(align-deps): handle capabilities resolving to the same package#1950

Merged
tido64 merged 2 commits intomicrosoft:mainfrom
tido64:tido/align-deps/fix-capability-query
Oct 23, 2022
Merged

fix(align-deps): handle capabilities resolving to the same package#1950
tido64 merged 2 commits intomicrosoft:mainfrom
tido64:tido/align-deps/fix-capability-query

Conversation

@tido64
Copy link
Member

@tido64 tido64 commented Oct 21, 2022

Description

Handle capabilities resolving to the same package. This can happen when users provide presets with additional capabilities that resolve to packages that are also managed by the built-in preset, but on an entirely different version.

Test plan

Tested in an internal repo. Tests were added.

@tido64 tido64 added the feature: align-deps This is related to align-deps label Oct 21, 2022
@tido64 tido64 mentioned this pull request Oct 21, 2022
24 tasks
Comment on lines +67 to +69
// vs core-microsoft). We will only look at the first capability to avoid
// unexpected behaviour, e.g. due to extensions declaring an older version
// of a package that is also declared in the built-in preset.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this kind of conflict something that should be surfaced earlier, and lead to failure? e.g. When you parse requirements and detect an unsatisfiable conflict, you would fail with "The requirements specified conflict with each other, and can never be met. ...details here...".

Copy link
Contributor

Choose a reason for hiding this comment

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

Otherwise, you start making choices for the user that are hard (not obvious) to debug.

Copy link
Member Author

Choose a reason for hiding this comment

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

This scenario is outlined in the README: https://github.com/microsoft/rnx-kit/tree/main/packages/align-deps#requirements

I think this is the most reasonable way to handle the conflict given current constraints. But we should probably look into verifying presets and notify users.

Copy link
Contributor

@afoxman afoxman left a comment

Choose a reason for hiding this comment

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

Marking as approved, but we need to decide how answer the comment I left. I'd prefer determinism and explicit messaging everywhere since dependencies issue are hard to understand and diagnose.

@tido64 tido64 merged commit f48573e into microsoft:main Oct 23, 2022
@tido64 tido64 deleted the tido/align-deps/fix-capability-query branch October 23, 2022 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: align-deps This is related to align-deps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants