Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with building the repo on Windows #11

Open
romanzagorowski opened this issue Dec 8, 2024 · 0 comments · May be fixed by #12
Open

Issues with building the repo on Windows #11

romanzagorowski opened this issue Dec 8, 2024 · 0 comments · May be fixed by #12

Comments

@romanzagorowski
Copy link

go version go1.23.4 windows/amd64

Steps to reproduce the issues (and workarounds):

Clone the repo:

C:\github>git clone git@github.com:mooreatv/AHDBapp.git
Cloning into 'AHDBapp'...
remote: Enumerating objects: 150, done.
remote: Total 150 (delta 0), reused 0 (delta 0), pack-reused 150 (from 1)
Receiving objects: 100% (150/150), 44.09 KiB | 125.00 KiB/s, done.
Resolving deltas: 100% (91/91), done.

In the repo folder issue build command:

C:\github\AHDBapp>go build .
go: cannot find main module, but found .git/config in C:\github\AHDBapp
        to create a module there, run:
        go mod init

Go complains about main module. Just do what it suggests:

C:\github\AHDBapp>go mod init
go: creating new go.mod: module github.com/mooreatv/AHDBapp
go: to add module requirements and sums:
        go mod tidy

Go asks to add module requirements and sums. Again obey go's suggestion:

C:\github\AHDBapp>go mod tidy
go: finding module for package github.com/go-sql-driver/mysql
go: finding module for package fortio.org/fortio/log
go: found fortio.org/fortio/log in fortio.org/fortio v1.68.0
go: found github.com/go-sql-driver/mysql in github.com/go-sql-driver/mysql v1.8.1

Try to build the repo:

C:\github\AHDBapp>go build .
# github.com/mooreatv/AHDBapp/lua2json
lua2json\lua2json.go:85:6: undefined: log.Infof
lua2json\lua2json.go:105:7: undefined: log.Debugf
lua2json\lua2json.go:109:7: undefined: log.Debugf
lua2json\lua2json.go:122:7: undefined: log.Debugf
lua2json\lua2json.go:152:7: undefined: log.Errf
lua2json\lua2json.go:154:6: undefined: log.Infof

The problem is that "fortio.org/fortio/log" is deprecated: package has moved to [fortio.org/log].

Edit the './lua2json/lua2json.go' file and replace a line:

"fortio.org/fortio/log"
with:

"fortio.org/log"

Again update requirements and sums:

C:\github\AHDBapp>go mod tidy
go: finding module for package github.com/go-sql-driver/mysql
go: finding module for package fortio.org/fortio/log
go: found fortio.org/fortio/log in fortio.org/fortio v1.68.0
go: found github.com/go-sql-driver/mysql in github.com/go-sql-driver/mysql v1.8.1

Repeat the build command:

C:\github\AHDBapp>go build .
# github.com/mooreatv/AHDBapp
.\ahdb.go:83:7: undefined: log.Critf
.\ahdb.go:111:6: undefined: log.LogVf
.\ahdb.go:120:8: undefined: log.Errf
.\ahdb.go:126:7: undefined: log.Debugf
.\ahdb.go:133:8: undefined: log.Debugf
.\ahdb.go:137:9: undefined: log.Debugf
.\ahdb.go:143:11: undefined: log.Fatalf
.\ahdb.go:149:6: undefined: log.Infof
.\ahdb.go:151:7: undefined: log.Errf
.\ahdb.go:163:8: undefined: log.Fatalf
.\ahdb.go:163:8: too many errors

This is the same problem like above: "fortio.org/fortio/log" is deprecated: package has moved to [fortio.org/log].
But this time in ahdb.go file.

Edit the './ahdb.go' file and replace a line:

"fortio.org/fortio/log"
with:

"fortio.org/log"

Repeat the build command again:

C:\github\AHDBapp>go build .

This time the build command succeeds and AHDBapp.exe is created:

C:\github\AHDBapp>dir *.exe

08.12.2024  12:52         8 059 392 AHDBapp.exe

Unfortunately executing the command:

C:\github\AHDBapp>AHDBapp.exe < "c:\Program Files (x86)\World of Warcraft\_classic_era_\WTF\Account\1170059271#1\SavedVariables\AuctionDB.lua"
12:56:19.083 r1 [INF] ahdb.go:327> AHDB parser started (reading from stdin)...
12:56:19.093 r7 [INF] lua2json.go:85> Using buffer size 16777216
12:56:19.101 r1 [FTL] ahdb.go:342> Unable to unmarshal json result: &json.SyntaxError{msg:"invalid character '\"' after object key", Offset:5}
panic: aborting...

goroutine 1 [running]:
fortio.org/log.Fatalf({0x10df33f?, 0x1073060?}, {0xc000139f10?, 0x0?, 0x24285b1aba8?})
        C:/Users/Roman/go/pkg/mod/fortio.org/log@v1.17.1/logger.go:554 +0x65
main.main()
        C:/github/AHDBapp/ahdb.go:342 +0x272

leads to the problem described in #10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant