cue icon indicating copy to clipboard operation
cue copied to clipboard

cmd/cue: panic: NewRequirements called with unsorted roots

Open rustamabd2 opened this issue 1 year ago • 0 comments

What version of CUE are you using (cue version)?

$ cue version
cue version v0.0.0-20241011140209-4e8e027f5b5f

go version go1.23.2
      -buildmode exe
       -compiler gc
  DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
             vcs git
    vcs.revision 4e8e027f5b5f05a7f656b152ac305ebcee3d9e50
        vcs.time 2024-10-11T14:02:09Z
    vcs.modified false
cue.lang.version v0.11.0

Does this issue reproduce with the latest stable release?

Yes, also in v0.10.0.

What did you do?

$ mkdir test
$ cd test
$ cue mod get github.com/cue-tmp/jsonschema-pub/exp1/[email protected]
$ cue mod get github.com/cue-tmp/jsonschema-pub/exp1/[email protected]

What did you expect to see?

I expected cue mod get commands to succeed.

What did you see instead?

panic: NewRequirements called with unsorted roots: [github.com/cue-tmp/jsonschema-pub/exp1/[email protected] github.com/cue-tmp/jsonschema-pub/exp1/[email protected]]

goroutine 1 [running]:
cuelang.org/go/internal/mod/modrequirements.NewRequirements({0xc000048f81, 0x1d}, {0x7ff620ee7118, 0xc0000cbaa0}, {0xc00048fe40, 0x2, 0x2}, 0xc000468450)
        /home/user/cue/cue/internal/mod/modrequirements/requirements.go:96 +0x488
cuelang.org/go/internal/mod/modload.UpdateVersions({0xf8e5b8, 0xc0002c42a0}, {0xf850a0?, 0xc0002b8370?}, {0xf7ca98?, 0x0?}, {0xf8d8f0, 0xc0000cbaa0}, {0xc0002b81c0, 0x1, ...})
        /home/user/cue/cue/internal/mod/modload/update.go:76 +0x9b1
cuelang.org/go/cmd/cue/cmd.runModGet(0xe1b517?, {0xc0002b81c0, 0x1, 0x1})
        /home/user/cue/cue/cmd/cue/cmd/modget.go:79 +0x117
cuelang.org/go/cmd/cue/cmd.newModCmd.newModGetCmd.mkRunE.func5(0xc0002be200?, {0xc0002b81c0, 0x1, 0x1})
        /home/user/cue/cue/cmd/cue/cmd/root.go:136 +0x2c2
github.com/spf13/cobra.(*Command).execute(0xc0002b1208, {0xc0002b8190, 0x1, 0x1})
        /home/user/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc00028a308)
        /home/user/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/user/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
cuelang.org/go/cmd/cue/cmd.(*Command).Run(0xc00028cdb0, {0x1575260?, 0xd34d00?})
        /home/user/cue/cue/cmd/cue/cmd/root.go:368 +0x1f
cuelang.org/go/cmd/cue/cmd.Main()
        /home/user/cue/cue/cmd/cue/cmd/root.go:276 +0x95
main.main()
        /home/user/cue/cue/cmd/cue/main.go:24 +0x13

rustamabd2 avatar Oct 11 '24 15:10 rustamabd2