From 4c50dd4ced1d1c10285ae3339d66e8e7fd76ebac Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 10 Apr 2021 12:08:30 +0800 Subject: [PATCH 1/2] Update nix --- docs/releases.md | 2 +- nix/default.nix | 24 ++++++++++++++---------- nix/sources.json | 6 +++--- shell.nix | 2 ++ 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/docs/releases.md b/docs/releases.md index ee8590cef2..d25ddec1ed 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -10,7 +10,7 @@ when added to the path. ## Minimal checklist -* [ ] generate the list of pull requests finished since the last release using the [haskell script](https://github.com/haskell/haskell-language-server/blob/master/GenChangelogs.hs) in the project root. +* [ ] generate the list of pull requests finished since the last release using the [haskell script](https://github.com/haskell/haskell-language-server/blob/master/GenChangelogs.hs) in the project root. Nix users should run command `genChangelogs` (a wrapper of the script) in nix-shell instead. * [ ] add that list to the actual [Changelog](https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md) with a description of the release. * [ ] bump up versions of changed packages. All are optional but [haskell-language-server itself](https://github.com/haskell/haskell-language-server/blob/master/haskell-language-server.cabal). * [ ] create the tag and make an initial prerelease to trigger the ci workflow (see details below) diff --git a/nix/default.nix b/nix/default.nix index 713cf9607f..8d49c43645 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -48,16 +48,20 @@ let inherit gitignoreSource; inherit ourSources; - # tracy-0.7.6 is broken on macOS - tracy = pkgs.tracy.overrideAttrs (_old: rec { - version = "0.7.5"; - src = pkgs.fetchFromGitHub { - owner = "wolfpld"; - repo = "tracy"; - rev = "v${version}"; - sha256 = "0qfb30k6a8vi8vn65vv927wd9nynwwvc9crbmi7a55kp20hzg06r"; - }; - }); + genChangelogs = with pkgs; + let myGHC = haskellPackages.ghcWithPackages (p: with p; [ github ]); + in runCommand "genChangelogs" { + passAsFile = [ "text" ]; + preferLocalBuild = true; + allowSubstitutes = false; + buildInputs = [ git myGHC ]; + } '' + dest=$out/bin/genChangelogs + mkdir -p $out/bin + echo "#!${runtimeShell}" >> $dest + echo "${myGHC}/bin/runghc ${../GenChangelogs.hs}" >> $dest + chmod +x $dest + ''; ourHaskell = pkgs.haskell // { packages = pkgs.haskell.packages // { diff --git a/nix/sources.json b/nix/sources.json index 210fcffde3..710303ae97 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -29,10 +29,10 @@ "homepage": "https://github.com/NixOS/nixpkgs", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c5147860e23ed75ce9d40298c66b416c00be1167", - "sha256": "104mw4rfbzyrfkxq468dlk38drrjx92dgyvkazgci67a6cx3n6nx", + "rev": "6fc2b7ecc2a167ce6a6902d5417daf1fa5cac777", + "sha256": "0bcf8yr8scgk7kdjhbrvv7l1d1yv8fnb1d7k3vgnd9qrjnl2fbcf", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/c5147860e23ed75ce9d40298c66b416c00be1167.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/6fc2b7ecc2a167ce6a6902d5417daf1fa5cac777.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/shell.nix b/shell.nix index ef8b0a039d..2993eb0d86 100644 --- a/shell.nix +++ b/shell.nix @@ -37,6 +37,8 @@ haskellPackagesForProject.shellFor { capstone tracy + genChangelogs + haskellPackages.cabal-install haskellPackages.hlint haskellPackages.ormolu From 35db90d6a3e059ceca8bc6bc5c3f2f76ab4b6a98 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 10 Apr 2021 16:12:37 +0800 Subject: [PATCH 2/2] genChangelogs -> gen-hls-changelogs --- docs/releases.md | 3 ++- nix/default.nix | 6 +++--- shell.nix | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/releases.md b/docs/releases.md index d25ddec1ed..5378986d2c 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -10,7 +10,8 @@ when added to the path. ## Minimal checklist -* [ ] generate the list of pull requests finished since the last release using the [haskell script](https://github.com/haskell/haskell-language-server/blob/master/GenChangelogs.hs) in the project root. Nix users should run command `genChangelogs` (a wrapper of the script) in nix-shell instead. +* [ ] generate the list of pull requests finished since the last release using the [haskell script](https://github.com/haskell/haskell-language-server/blob/master/GenChangelogs.hs) in the project root. + Nix users should run command `gen-hls-changelogs` (a wrapper of the script) in nix-shell instead. * [ ] add that list to the actual [Changelog](https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md) with a description of the release. * [ ] bump up versions of changed packages. All are optional but [haskell-language-server itself](https://github.com/haskell/haskell-language-server/blob/master/haskell-language-server.cabal). * [ ] create the tag and make an initial prerelease to trigger the ci workflow (see details below) diff --git a/nix/default.nix b/nix/default.nix index 8d49c43645..251f6efead 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -48,15 +48,15 @@ let inherit gitignoreSource; inherit ourSources; - genChangelogs = with pkgs; + gen-hls-changelogs = with pkgs; let myGHC = haskellPackages.ghcWithPackages (p: with p; [ github ]); - in runCommand "genChangelogs" { + in runCommand "gen-hls-changelogs" { passAsFile = [ "text" ]; preferLocalBuild = true; allowSubstitutes = false; buildInputs = [ git myGHC ]; } '' - dest=$out/bin/genChangelogs + dest=$out/bin/gen-hls-changelogs mkdir -p $out/bin echo "#!${runtimeShell}" >> $dest echo "${myGHC}/bin/runghc ${../GenChangelogs.hs}" >> $dest diff --git a/shell.nix b/shell.nix index 2993eb0d86..0ef0ad57fa 100644 --- a/shell.nix +++ b/shell.nix @@ -37,7 +37,7 @@ haskellPackagesForProject.shellFor { capstone tracy - genChangelogs + gen-hls-changelogs haskellPackages.cabal-install haskellPackages.hlint