Skip to content

Conversation

@mxcl
Copy link
Member

@mxcl mxcl commented Mar 14, 2025

Really we need to record what constraint the user requested when installing as well as what packages were explicitly installed in order to do a better job here.

Currently we assume any ^x that is newer counts as outdated provided it is not a package that is a dependency with a tighter constraint range.

This also ties into how we handle multiple installs, which currently we do, eg. you can have openssl^1 and openssl^3 both installed though this works by luck rather than by design. If you have both then we need to state that both ^1 and ^3 are outdated, this naive implementation will actually error currently for this case.

This implementation also misses new major versions which you will commonly want to upgrade to, eg. a git^3 is released, because we don’t want to tell the user eg. openssl^1 is outdated when it fact it is a dependency. This can probably be fixed without a data store but I didn't do it yet.

Really we need to record what constraint the user requested when installing as well as what packages were explicitly installed in order to do a better job here.

Currently we assume any ^x that is newer counts as outdated provided it is not a package that is a dependency with a tighter constraint range.

This also ties into how we handle multiple installs, which currently we do, eg. you can have openssl^1 and openssl^3 both installed though this works by luck rather than by design. If you have both then we need to state that both ^1 and ^3 are outdated, this naive implementation will actually error currently for this case.
@mxcl mxcl requested a review from jhheider March 14, 2025 17:45
Copy link
Contributor

@jhheider jhheider left a comment

Choose a reason for hiding this comment

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

yeah, this is tough. it's possible it might not be knowable with the filesystem as source-of-truth, but, of course, adding a data store for pkgm increases complexity.

@mxcl
Copy link
Member Author

mxcl commented Mar 14, 2025

Added above:

This implementation also misses new major versions which you will commonly want to upgrade to, eg. a git^3 is released, because we don’t want to tell the user eg. openssl^1 is outdated when in fact it is a dependency. This can probably be fixed without a data store but I didn't do it yet.

@mxcl mxcl merged commit 13050ad into main Mar 14, 2025
3 checks passed
@mxcl mxcl deleted the outdated branch March 14, 2025 18:07
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.

3 participants