From 7e0f275c18a53802ee3d02920c892536eb101c09 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Wed, 26 Nov 2025 16:15:05 -0800 Subject: [PATCH 1/2] automatically update the nix vendor hash this make task is run in pre-push hooks, so this should reduce CI churn because of out-of-sync nix vendor hashes --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7d5aa0895..0e459989b 100644 --- a/Makefile +++ b/Makefile @@ -30,9 +30,23 @@ pkgs/npm/README.md src/README.md: README.md .PHONY: test-nix test-nix: ifneq (,$(shell which nix)) - nix run .#defang-cli --extra-experimental-features flakes --extra-experimental-features nix-command + +$(MAKE) nix-run; \ + if [ $$? -ne 0 ]; then \ + $(MAKE) update-nix-vendor-hash; \ + fi endif +.PHONY: update-nix-vendor-hash +update-nix-vendor-hash: + sed -i.bak -E 's|(vendorHash = "sha256-)[A-Za-z0-9+/=]+(")|\10AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\2|' pkgs/defang/cli.nix + $(MAKE) nix-run 2>&1 | grep -o 'sha256-[A-Za-z0-9+/=]\+' | tail -n1 | xargs -I {} sed -i.bak -E 's|(vendorHash = ")[^"]+(")|vendorHash = "{}"|' pkgs/defang/cli.nix + rm pkgs/defang/cli.nix.bak + git add pkgs/defang/cli.nix + +.PHONY: nix-run +nix-run: + nix run .#defang-cli --extra-experimental-features flakes --extra-experimental-features nix-command + .PHONY: clean distclean clean distclean: $(MAKE) -C src $@ From fa8ea2278fb93924e18e9cfd0f18ddba5ef71e67 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Mon, 15 Dec 2025 12:51:28 -0800 Subject: [PATCH 2/2] Update Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lio李歐 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 0e459989b..e69ca3019 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,8 @@ update-nix-vendor-hash: $(MAKE) nix-run 2>&1 | grep -o 'sha256-[A-Za-z0-9+/=]\+' | tail -n1 | xargs -I {} sed -i.bak -E 's|(vendorHash = ")[^"]+(")|vendorHash = "{}"|' pkgs/defang/cli.nix rm pkgs/defang/cli.nix.bak git add pkgs/defang/cli.nix + @echo cli.nix vendorHash has been updated; commit and push + @false .PHONY: nix-run nix-run: