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

Dependency version cleanup #411

Merged
merged 3 commits into from
Mar 5, 2024
Merged

Conversation

hendrikvanantwerpen
Copy link
Collaborator

@hendrikvanantwerpen hendrikvanantwerpen commented Mar 5, 2024

Tweak the dependencies to prevent install problems such as those reported in #407.

The main change is to ensure that all tree-sitter have the same minor version, which prevents the Cargo resolver picking multiple versions for different crates.

The underlying problem is that there seems to be no way to teel Cargo that two transitive dependencies of the same crate should be the same version. However, if types from that crate are part of the API, things break if values are passed from one to the other. So far, the only solution I've found is to ensure that if the minor versions are the same, the resolver will only pick one patch version, thus ensuring the same version is used everywhere. (For non-zero major versions it might be enough if the major version is the same?)

Main changes:

  • Change tree-sitter dependency versions to ensure they all use the same minor version.
  • Use cargo hack to test all feature combinations.
  • Introduced cli feature for tree-sitter-stack-graphs-java so the CLI is not included by default anymore.
  • Bump versions of lsp-positions and tree-sitter-stack-graphs.

@hendrikvanantwerpen hendrikvanantwerpen self-assigned this Mar 5, 2024
@hendrikvanantwerpen hendrikvanantwerpen marked this pull request as ready for review March 5, 2024 18:32
@hendrikvanantwerpen hendrikvanantwerpen requested a review from a team as a code owner March 5, 2024 18:32
Comment on lines -77 to +78
tree-sitter = ">= 0.19"
tree-sitter = "0.20" # keep the same minor version as the tree-sitter dependency
# of tree-sitter-graph to prevent install problems
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unfortunate, since it should all work with 0.19 as well. But it looks like several of the grammars have moved away from inclusive version constraints, so I guess this is the way 🤷 Maybe we can revert back to the inclusive constraint once tree-sitter/tree-sitter#3069 lands.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think this still worked, since tree-sitter-graph has a hard minimum of [email protected].

@hendrikvanantwerpen hendrikvanantwerpen merged commit a8e4fa0 into main Mar 5, 2024
8 checks passed
@hendrikvanantwerpen hendrikvanantwerpen deleted the dependency-version-cleanup branch March 5, 2024 19:23
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.

2 participants