topgrade icon indicating copy to clipboard operation
topgrade copied to clipboard

Add new step: GNU Guix

Open JamesClarke7283 opened this issue 1 year ago • 3 comments

Adds support for GNU Guix package manager.

Closes #979 Needs better error handling/messages. But it functions when ive tested it & if the step fails, the program continues as normal. No custom error messages, happen yet, at the moment error output is just the default from the package manager. see the prior mentioned issue for more details.

I have run the checks, on check that failed, was cargo clippy. because of a unneeded return statement, i will fix that warning later. Sorry if my code is not great, i have no experience with rust, until now. Feedback on what to improve would be much appreciated.

Standards checklist:

  • [x] The PR title is descriptive.
  • [x] The code compiles (cargo build)
  • [x] The code passes rustfmt (cargo fmt)
  • [x] The code passes clippy (cargo clippy)
  • [x] The code passes tests (cargo test)
  • [x] Optional: I have tested the code myself
    • [x] I also tested that Topgrade skips the step where needed

Features

  • [x] Update guix (both the database, and the guix binary itself)
  • [x] Upgrade guix packages

JamesClarke7283 avatar Jul 28 '22 12:07 JamesClarke7283

Cargo Clippy gives no warnings caused by my changes (checked upstream master and was consistent with that), and I removed the custom Error/Messages handling item, from the requirements.

Had help from Leo Spratt (@enchant94) who knows a lot more about rust specific best practices.

JamesClarke7283 avatar Aug 20 '22 12:08 JamesClarke7283

Please remove the swp file that was accidentally added to the commit.

strangelittlemonkey avatar Aug 20 '22 19:08 strangelittlemonkey

Please remove the swp file that was accidentally added to the commit.

Thanks for letting me know, do let me know if anything needs to be improved, I had no experience with programming in Rust before this, so I made the decision to not add the extra messages as a feature, initially.

Do you think it would be worthwhile to add a printout when guix is not found, saying what command to run to install the GNU Guix package manager?

If so, Would the method to install GNU Guix stated here, be too long? https://guix.gnu.org/manual/en/html_node/Binary-Installation.html#example

JamesClarke7283 avatar Aug 20 '22 20:08 JamesClarke7283

Does anything else need doing for this to be ready for merge?

JamesClarke7283 avatar Oct 02 '22 15:10 JamesClarke7283

Merged at new fork because of inactivity by maintainer. Link: https://github.com/DottoDev/topgrade/pull/1

s34m avatar Oct 10 '22 18:10 s34m