Skip to content

Commit

Permalink
Stop using cmp (#3232)
Browse files Browse the repository at this point in the history
* Stop using cmp for subrepos

* Version
  • Loading branch information
peterebden authored Aug 20, 2024
1 parent 9625bae commit 9a4b7fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.10.2
17.10.3
2 changes: 0 additions & 2 deletions src/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions src/core/subrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 9a4b7fc

Please sign in to comment.