Skip to content

Prevent downgrading on old version in mirror#889

Open
ghyatzo wants to merge 5 commits intoJuliaLang:mainfrom
ghyatzo:patch-noselfdowngrade
Open

Prevent downgrading on old version in mirror#889
ghyatzo wants to merge 5 commits intoJuliaLang:mainfrom
ghyatzo:patch-noselfdowngrade

Conversation

@ghyatzo
Copy link
Contributor

@ghyatzo ghyatzo commented Apr 6, 2024

should fix #250

Copy link
Collaborator

@davidanthoff davidanthoff left a comment

Choose a reason for hiding this comment

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

I think this would also disable the ability to switch from a prerelease channel to the release channel, where we want a downgrade to happen. So I don't think we can merge this as is...

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Apr 15, 2024

I completely missed that possibility, sorry.
I tried to reason about it in terms of detecting a channel change, but as far as I could tell there is no way currently to do it.
Instead I opted for simplifying it, and just warn and ask the user for input when we detect a downgrade.

I have ready an incomplete patch for it, but there is another issue. What should be the default behaviour when the self update is run non interactlively. Should we default to not downgrade at all? Or install whatever it is found on the channel?

I'd be more towards ignoring any downgrades, to avoid surprises.

for now an example of interaction is the following:

$ juliaup self update
Checking for self-updates on channel: release
You are trying to install version: release-1.14.7, but the currently installed version is newer (or the same).
Do you want to continue? yes
Found new version 1.14.7 on channel release.
Updated Juliaup to version 1.14.7.

Other possible behaviour to consider: if the version is the same, just update normally.

EDIT: I'll push the changes made, with the caveat that they are still incomplete and need the non-interactive scenario to be addressed.

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Apr 16, 2024

I just opted for pushing a complete working version, so that if you agree it's ready. Namely:

  • stop all downgrades (even from different channels) when updating in non-interactive mode ( background process )
  • re-installing the same version proceed normally in all cases.

@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from f5f37f4 to c62d3e0 Compare April 16, 2024 10:47
@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from c62d3e0 to cfc4214 Compare May 15, 2024 15:32
@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from cfc4214 to 9bbaf96 Compare September 4, 2024 13:32
@DilumAluthge
Copy link
Member

This PR has not been updated in over one year.

@ghyatzo Are you still interested in working on this PR?

@ghyatzo
Copy link
Contributor Author

ghyatzo commented Feb 21, 2026

The PR was ready for review at the time. I can rebase this on master and see where it goes from there

@DilumAluthge
Copy link
Member

Yeah, that would be great. Once you've rebased, let me know, and I can try to find a reviewer.

…hing back from a preview version to the release version.
@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from 9bbaf96 to 915147e Compare February 25, 2026 20:39
@DilumAluthge
Copy link
Member

@IanButterworth or @davidanthoff - Could you re-review this, and see if the previously requested changes have been made?

fix: reinstalling same version is not counted as downgrading.
@ghyatzo ghyatzo force-pushed the patch-noselfdowngrade branch from 915147e to 559463a Compare February 25, 2026 21:14
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.

Warn if server version is less than installed version.

3 participants