From 9a4b7fc43e05ed348efc63020848e0a3a8e2e0c4 Mon Sep 17 00:00:00 2001 From: Peter Ebden Date: Tue, 20 Aug 2024 18:00:13 +0100 Subject: [PATCH] Stop using cmp (#3232) * Stop using cmp for subrepos * Version --- ChangeLog | 4 ++++ VERSION | 2 +- src/core/BUILD | 2 -- src/core/subrepo.go | 6 ++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4be7e9efb8..5f5799bb5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Version 17.10.3 +--------------- + * Further improve internal comparison of subrepo structures + Version 17.10.2 --------------- * Revert change to filename auto-completion from 17.10.0 (#3229) diff --git a/VERSION b/VERSION index 8eaf1554c7..76df87fc29 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.10.2 +17.10.3 diff --git a/src/core/BUILD b/src/core/BUILD index 40a3bce6b6..0b0b133ccb 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -21,8 +21,6 @@ go_library( "///third_party/go/github.com_thought-machine_go-flags//:go-flags", "///third_party/go/github.com_zeebo_blake3//:blake3", "///third_party/go/golang.org_x_sync//errgroup", - "///third_party/go/github.com_google_go-cmp//cmp", - "///third_party/go/github.com_google_go-cmp//cmp/cmpopts", "//src/cli", "//src/cli/logging", "//src/cmap", diff --git a/src/core/subrepo.go b/src/core/subrepo.go index 7da17bb056..8947e2088d 100644 --- a/src/core/subrepo.go +++ b/src/core/subrepo.go @@ -8,9 +8,6 @@ import ( "strings" "sync" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/thought-machine/please/src/cli" "github.com/thought-machine/please/src/fs" ) @@ -73,7 +70,8 @@ func (s *Subrepo) IsRemoteSubrepo() bool { // Equal returns true if this subrepo is equivalent to another, or false if it is not. func (s *Subrepo) Equal(other *Subrepo) bool { - return cmp.Equal(s, other, cmpopts.IgnoreFields(Subrepo{}, "fs", "fsSync")) + return s.Name == other.Name && s.Root == other.Root && s.PackageRoot == other.PackageRoot && + s.Target == other.Target && s.State == other.State && s.Arch == other.Arch && s.IsCrossCompile == other.IsCrossCompile } // SubrepoForArch creates a new subrepo for the given architecture.