Skip to content
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

Improve the selection of plugin binaries #5407

Closed
wants to merge 1 commit into from

Conversation

crodas
Copy link
Contributor

@crodas crodas commented Dec 18, 2023

Description

Fixes #5402

If several plugin names are found in $PATH, prior to this commit the first binary to be found is being used.

This PR enhances the process by adding some heuristics. The algorithm works as follows:

  1. Check if a binary exists in the same directory as the current forc binary.
  2. Otherwise find all occurrences of the forc-plugin in the $PATH. Sort them by their version.
  3. Use the newest (greater version) binary that is found. If no version can be parsed it is assumed to be the oldest available.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@crodas crodas requested a review from a team December 18, 2023 21:23
@crodas crodas self-assigned this Dec 18, 2023
@crodas crodas marked this pull request as ready for review December 18, 2023 21:23
Fixes #5402

If several plugin names are found in $PATH, prior to this commit the
first binary to be found is being used.

This PR enhances the process by adding some heuristics. The algorithm
works as follows:

   1. Check if a binary exists in the same directory as the current forc
      binary.
   2. Otherwise find all occurrences of the forc-plugin in the $PATH.
      Sort them by their version.
   3. Use the newest (greater version) binary that is found. If no
      version can be parsed it is assumed to be the oldest available.
@crodas crodas force-pushed the better-selection-of-plugin-bin branch from 66cbf45 to 04055ef Compare December 18, 2023 21:37
@crodas
Copy link
Contributor Author

crodas commented Dec 18, 2023

This will be fixed in #5395. Basically, #5395 will show a warning when multiple binaries are found in $PATH (fuelup should manage multiple versions)

@crodas crodas closed this Dec 18, 2023
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.

Improve the way plugins are selected
1 participant