lheijst / weewx-rtldavis

weewx driver that captures data from software-defined radio using the rtldavis software.
GNU General Public License v3.0
14 stars 5 forks source link

GO get Depreciated #18

Open gary-hammer opened 1 year ago

gary-hammer commented 1 year ago

I'm attempting an install on a non-Pi machine using ubuntu. I find the GO version that is in the repository is newer than on the Pi. GOVERSION="go1.18.1" GOPATH="/home/weewx" GOMODCACHE="/home/weewx/pkg/mod"

I get an error when I get to the go get portion of the install. This works: go install github.com/lheijst/rtldavis@latest But then, all goes downhill. Here is the path created by that command: /home/weewx/pkg/mod/github.com/lheijst/rtldavis@v0.0.0-20200605114342-b95d5d734e46

So, cd to there and try to continue along git submodule init fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Ok, let's try git init then continue. This results in this hint: Using 'master' as the name for the initial branch.

Alright, master it is. Now these commands work, or at least don't error out. git submodule init git submodule update

Now, to install go install -v .

Results in: go: cannot find main module, but found .git/config in /home/weewx/pkg/mod/github.com/lheijst/rtldavis@v0.0.0-20200605114342-b95d5d734e46 to create a module there, run: go mod init

Let's take their suggestion:

go mod init

go: cannot determine module path for source directory /home/weewx/pkg/mod/github.com/lheijst/rtldavis@v0.0.0-20200605114342-b95d5d734e46 (outside GOPATH, module path must be specified)

Example usage: 'go mod init example.com/m' to initialize a v0 or v1 module 'go mod init example.com/m/v2' to initialize a v2 module

Not possible (for me) to continue the install on newer GO version.

https://go.dev/doc/go-get-install-deprecation 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install example.com/cmd@latest' For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'.

gary-hammer commented 1 year ago

I have solved the install using the following. No idea why the two 'first commit' were needed, you can try with only one.

go mod init github.com/lheijst/rtldavis/m go get github.com/jpoirier/gortlsdr go get github.com/lheijst/rtldavis/protocol go mod init git config user.email "example@example.com" git config user.name "Example User" git commit -m "first commit" git add crc/ git add dsp/ git add protocol/ git commit -m "first commit" go install -v .