NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.27k stars 14.25k forks source link

vimPlugins.blink-cmp: add updateScript #358078

Open redxtech opened 6 hours ago

redxtech commented 6 hours ago

Description of changes

I have added a script to assist with the update process, grabbing the latest release of blink.cmp, pulling in the up-to-date Cargo.lock file, and making sure the outputHashes for the git-source frizbee crate is up to date.

Things done


Add a :+1: reaction to pull requests you find important.

GaetanLepage commented 5 hours ago

Thank you for this contribution. You can get rid of

cargoLock = {
      lockFile = ./Cargo.lock;
      outputHashes = {
        "frizbee-0.1.0" = "sha256-eYth+xOIqwGPkH39OxNCMA9zE+5CTNpsuX8Ue/mySIA=";
      };
    };

and replace it with

useFetchCargoVendor = true;
cargoHash = "";
redxtech commented 5 hours ago

@GaetanLepage thanks, this is good to know!

is there a way I can use nix-prefetch-url to calculate this cargoHash in the update script as well?

Semi-related: I'm also building this in a flake (the upstream repo), and when I replace the cargoLock with your suggestion, it has different behaviour from here in nixpkgs. Do you know why that might be? I don't believe it's because of fenix, because I get the same issue when using in-tree rustPlatform.

GaetanLepage commented 5 hours ago

is there a way I can use nix-prefetch-url to calculate this cargoHash in the update script as well?

Have a look at the nix-update project maybe. It should be able to work similarly.

Semi-related: I'm also building this in a flake (the upstream repo), and when I replace the cargoLock with your suggestion, it has different behaviour from here in nixpkgs. Do you know why that might be? I don't believe it's because of fenix, because I get the same issue when using in-tree rustPlatform.

This fetcher has been added recently, do you have a recent enough nixpkgs revision ?

redxtech commented 37 minutes ago

Have a look at the nix-update project maybe. It should be able to work similarly.

I've looked at this before, and while very useful, it requires a URL to be in the src attribute. Since it's the upstream repo, the src attribute is set to ./., so nix-update doesn't know what to do with it, and I'll have to manually re-build to get the proper cargoHash value.

This fetcher has been added recently, do you have a recent enough nixpkgs revision ?

That was it! It must have been very recent, because I updated nixpkgs to latest just last week!