Clinet / clinet

A general purpose bot for chat services being rewritten for the modern era
https://joshuadoes.com/projects/clinet
MIT License
45 stars 6 forks source link

Building still requires manually switching DiscordGo branch #7

Closed MikeModder closed 6 years ago

MikeModder commented 6 years ago

I ran go get github.com/JoshuaDoes/clinet and it ran tine until it got to the building section, which failed with the below error. Should a notice be added to the README or did something break on my end?

Build output:


$ govvv build
# _/data/data/com.termux/files/home/clinet
./cmd-info.go:124:38: member.JoinedAt.Parse undefined (type string has no field or method Parse)
./events.go:356:33: joinedAt.Parse undefined (type string has no field or method Parse)
./events.go:400:33: joinedAt.Parse undefined (type string has no field or method Parse)
./main.go:278:10: session.UpdateListeningStatus undefined (type *discordgo.Session has no field or method UpdateListeningStatus)
go tool: exit status 2```  
JoshuaDoes commented 6 years ago

A notice will not be added for the time being. If you check commit 4c08560, you'll see that the new Go module system is temporarily disabled for the Clinet project until I can fix some issues regarding it on my host test machine.

This will be resolved soon as I only just now have the time to fix it. I'll close this issue once I push the commit fixing it.

JoshuaDoes commented 6 years ago

So it appears I still can't get that issue fixed. Can you try running go mod init in the JoshuaDoes/clinet repo directory with all dependencies updated and see if you get any issues?

MikeModder commented 6 years ago

I ran go get github.com/JoshuaDoes/clinet and got the exptected errors about DiscordGo. Below is the output of go mod init followed by go get. I'm unsure exactly what's going on as I ended up with an essentially empty go.mod (containing only module github.com/JoshuaDoes/clinet), however go get seemingly gets most of the dependencies right.

mike@[host]:~/go/src/github.com/JoshuaDoes/clinet$ GO111MODULE=on go mod init
go: creating new go.mod: module github.com/JoshuaDoes/clinet
mike@[host]:~/go/src/github.com/JoshuaDoes/clinet$ GO111MODULE=on go get
go: finding github.com/koffeinsource/go-imgur v0.1.0
go: finding github.com/JoshuaDoes/go-wolfram latest
go: finding github.com/kortschak/zalgo latest
go: finding github.com/JoshuaDoes/duckduckgolang latest
go: finding github.com/JoshuaDoes/urbandictionary latest
go: finding github.com/mitchellh/go-ps latest
go: finding gopkg.in/jdkato/prose.v2 latest
go: finding google.golang.org/api/googleapi/transport latest
go: finding google.golang.org/api/youtube/v3 latest
go: finding golang.org/x/text/unicode/norm latest
go: downloading github.com/JoshuaDoes/duckduckgolang v0.0.0-20180207042607-60cbd040f6f4
go: downloading github.com/kortschak/zalgo v0.0.0-20141105224154-8c91a4a457cf
go: downloading github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936
go: downloading github.com/JoshuaDoes/urbandictionary v0.0.0-20180802142829-e5f649d88711
go: downloading github.com/koffeinsource/go-imgur v0.1.0
go: downloading github.com/JoshuaDoes/go-wolfram v0.0.0-20180208100144-916d49d41b7f
go: finding golang.org/x/text/transform latest
go: finding github.com/jonas747/dca latest
go: finding github.com/JoshuaDoes/goeip latest
go: finding github.com/koffeinsource/go-klogger v0.1.0
go: finding github.com/robfig/cron latest
go: finding github.com/google/go-github/github latest
go: downloading github.com/JoshuaDoes/goeip v0.0.0-20180918002602-8db6ede8249b
go: downloading github.com/koffeinsource/go-klogger v0.1.0
go: downloading github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967
go: downloading github.com/jonas747/dca v0.0.0-20180225204759-bf5d11669cdb
go: finding github.com/dustin/go-humanize v1.0.0
go: finding github.com/channelmeter/iso8601duration latest
go: finding github.com/JoshuaDoes/goprobe latest
go: downloading github.com/channelmeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61
go: downloading github.com/dustin/go-humanize v1.0.0
go: downloading github.com/JoshuaDoes/goprobe v0.0.0-20180803053841-dfdb75b62b9f
go: finding github.com/rylio/ytdl v0.5.1
go: finding golang.org/x/text/unicode latest
go: finding golang.org/x/text v0.3.0
go: finding github.com/robertkrimen/otto latest
go: finding github.com/fatih/structs v1.1.0
go: finding github.com/JoshuaDoes/go-cve latest
go: downloading github.com/rylio/ytdl v0.5.1
go: downloading github.com/fatih/structs v1.1.0
go: downloading github.com/JoshuaDoes/go-cve v0.0.0-20180802130150-ddfd9d0080df
go: downloading github.com/robertkrimen/otto v0.0.0-20180617131154-15f95af6e78d
go: finding github.com/JoshuaDoes/spotigo latest
go: downloading golang.org/x/text v0.3.0
go: finding github.com/bwmarrin/discordgo v0.18.0
go: downloading github.com/JoshuaDoes/spotigo v0.0.0-20181022030848-85421fc009f6
go: finding github.com/google/go-github v17.0.0+incompatible
go: downloading github.com/google/go-github v17.0.0+incompatible
go: finding github.com/nishanths/go-xkcd latest
go: downloading github.com/bwmarrin/discordgo v0.18.0
go: finding 4d63.com/tz latest
go: downloading github.com/nishanths/go-xkcd v0.0.0-20160531092901-9497d909de39
go: finding google.golang.org/api/youtube latest
go: finding google.golang.org/api/googleapi latest
go: finding github.com/olebedev/when latest
go: finding google.golang.org/api latest
go: downloading google.golang.org/api v0.0.0-20181030195507-c4edf6535eee
go: downloading 4d63.com/tz v0.0.0-20180303073054-73a1e3d39b09
go: finding github.com/disintegration/gift v1.2.0
go: finding gopkg.in/src-d/go-git.v4 v4.7.1
go: downloading github.com/olebedev/when v0.0.0-20171024044931-53693fbb59a8
go: finding github.com/minotar/minecraft latest
go: downloading gopkg.in/jdkato/prose.v2 v2.0.0-20180825173540-767a23049b9e
go: finding github.com/JoshuaDoes/go-soundcloud latest
go: downloading github.com/disintegration/gift v1.2.0
go: finding github.com/go-playground/colors v1.1.1
go: downloading github.com/minotar/minecraft v0.0.0-20180803122715-72fe240cdd0e
go: finding github.com/PuerkitoBio/goquery v1.4.1
go: finding github.com/Syfaro/minepong latest
go: downloading github.com/JoshuaDoes/go-soundcloud v0.0.0-20180304005454-9d4c26f4bf5a
go: downloading github.com/go-playground/colors v1.1.1
go: downloading gopkg.in/src-d/go-git.v4 v4.7.1
go: downloading github.com/Syfaro/minepong v0.0.0-20171114202836-f73aadc7bef0
go: downloading github.com/PuerkitoBio/goquery v1.4.1
go: finding github.com/src-d/gcfg v1.3.0
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/mitchellh/go-homedir v1.0.0
go: finding github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239
go: finding github.com/jessevdk/go-flags v1.4.0
go: finding golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: finding golang.org/x/net v0.0.0-20180921000356-2f5d2388922f
go: finding github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: finding github.com/pkg/errors v0.8.0
go: finding github.com/gliderlabs/ssh v0.1.1
go: finding github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e
go: finding github.com/emirpasic/gods v1.9.0
go: finding github.com/xanzy/ssh-agent v0.2.0
go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding github.com/davecgh/go-spew v1.1.1
go: finding gopkg.in/src-d/go-git-fixtures.v3 v3.1.1
go: finding gopkg.in/src-d/go-billy.v4 v4.2.1
go: finding golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: finding github.com/google/go-cmp v0.2.0
go: finding github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: finding github.com/pelletier/go-buffruneio v0.2.0
go: finding github.com/stretchr/testify v1.2.2
go: finding gopkg.in/warnings.v0 v0.1.2
go: finding github.com/sergi/go-diff v1.0.0
go: finding github.com/kr/pretty v0.1.0
go: finding golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9
go: finding github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7
go: finding google.golang.org/appengine v1.2.0
go: finding github.com/kr/text v0.1.0
go: finding golang.org/x/net v0.0.0-20180724234803-3673e40ba225
go: finding github.com/golang/protobuf v1.2.0
go: finding github.com/kr/pty v1.1.1
go: downloading golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: downloading google.golang.org/appengine v1.2.0
go: downloading golang.org/x/net v0.0.0-20180921000356-2f5d2388922f
go: downloading gopkg.in/src-d/go-billy.v4 v4.2.1
go: finding github.com/deckarep/golang-set v1.7.1
go: finding github.com/gorilla/websocket v1.4.0
go: finding gopkg.in/neurosnap/sentences.v1 v1.0.6
go: finding github.com/google/go-querystring/query latest
go: finding github.com/mingrammer/commonregex v1.0.0
go: finding gonum.org/v1/gonum/mat latest
go: downloading github.com/deckarep/golang-set v1.7.1
go: downloading github.com/gorilla/websocket v1.4.0
go: finding github.com/google/go-querystring v1.0.0
go: downloading github.com/google/go-querystring v1.0.0
go: downloading github.com/golang/protobuf v1.2.0
go: downloading github.com/mingrammer/commonregex v1.0.0
go: finding github.com/montanaflynn/stats latest
go: downloading github.com/mitchellh/go-homedir v1.0.0
go: finding github.com/andybalholm/cascadia v1.0.0
go: downloading github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808
go: downloading github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
go: finding gonum.org/v1/gonum latest
go: downloading gonum.org/v1/gonum v0.0.0-20181029232933-400065bf7646
go: downloading github.com/andybalholm/cascadia v1.0.0
go: finding github.com/AlekSi/pointer v1.0.0
go: downloading gopkg.in/neurosnap/sentences.v1 v1.0.6
go: downloading github.com/pkg/errors v0.8.0
go: downloading github.com/AlekSi/pointer v1.0.0
go: downloading github.com/emirpasic/gods v1.9.0
go: downloading github.com/sergi/go-diff v1.0.0
go: downloading github.com/xanzy/ssh-agent v0.2.0
go: finding github.com/jonas747/ogg latest
go: finding github.com/Sirupsen/logrus v1.1.1
go: downloading github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e
go: downloading github.com/pelletier/go-buffruneio v0.2.0
go: downloading github.com/src-d/gcfg v1.3.0
go: downloading github.com/jonas747/ogg v0.0.0-20161220051205-b4f6f4cf3757
go: downloading gopkg.in/warnings.v0 v0.1.2
go: finding gopkg.in/sourcemap.v1 v1.0.5
go: downloading github.com/Sirupsen/logrus v1.1.1
go: downloading gopkg.in/sourcemap.v1 v1.0.5
go: github.com/Sirupsen/logrus@v1.1.1: parsing go.mod: unexpected module path "github.com/sirupsen/logrus"
go: error loading module requirements

Running go get github.com/sirupsen/logrus gives the same unexptected module path error.

Edit: Trying to build shows that discordgo still isn't automatically switched to the appropiate branch.


# github.com/JoshuaDoes/clinet
./cmd-info.go:181:39: member.JoinedAt.Parse undefined (type string has no field or method Parse)
./events.go:359:33: joinedAt.Parse undefined (type string has no field or method Parse)
./events.go:403:33: joinedAt.Parse undefined (type string has no field or method Parse)
./main.go:297:10: session.UpdateListeningStatus undefined (type *discordgo.Session has no field or method UpdateListeningStatus)```
JoshuaDoes commented 6 years ago

The automatic branch switch will not occur until a fixed go module list can be created. For the time being, you have the same error that I get when attempting to create the go module list and thus I don't believe I will be able to add go modules support to fix this issue until it gets resolved.

JoshuaDoes commented 6 years ago

I've finally figured out the best way to fix it, after all this time.

As it turns out, Sirupsen/logrus is imported by multiple packages, none of which I can maintain myself, rather than sirupsen/logrus. Roughly a year and a half ago, Sirupsen renamed his GitHub account to sirupsen and dozens of packages never fixed this - mostly because, until now, case-sensitive module checking was not a thing.

The fix in commit 1c8338e was far simpler than I realized, as I've been scratching at my head for months now for one simple line:

replace github.com/Sirupsen/logrus v1.2.0 => github.com/sirupsen/logrus v1.2.0

All this time and that's all it took. I'm happy to say I can put this issue to rest, regardless of whether or not the affected packages fix it on their end. And with this, the re-introduction of modules support in the commit above fixes the initial issue of requiring the manual switch to the DiscordGo branch develop.

MikeModder commented 6 years ago

Hallelujah! 🎉