hanwen / go-mtpfs

Mount MTP devices over FUSE
Other
680 stars 85 forks source link

Cannot build on Arch Linux #140

Closed joeydumont closed 4 years ago

joeydumont commented 5 years ago

I have issues importing the versioned packages: I tried to build with:

GOPATH="$srcdir" go get -v -x github.com/hanwen/go-mtpfs

and got

==> Starting build()...
github.com/hanwen/go-mtpfs (download)
cd .
git clone -- https://github.com/hanwen/go-mtpfs /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-mtpfs
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-mtpfs
git submodule update --init --recursive
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-mtpfs
git show-ref
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-mtpfs
git submodule update --init --recursive
github.com/hanwen/go-fuse (download)
cd .
git clone -- https://github.com/hanwen/go-fuse /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-fuse
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-fuse
git submodule update --init --recursive
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-fuse
git show-ref
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-fuse
git submodule update --init --recursive
package github.com/hanwen/go-fuse/v2/fs: cannot find package "github.com/hanwen/go-fuse/v2/fs" in any of:
    /usr/lib/go/src/github.com/hanwen/go-fuse/v2/fs (from $GOROOT)
    /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-fuse/v2/fs (from $GOPATH)
package github.com/hanwen/go-fuse/v2/fuse: cannot find package "github.com/hanwen/go-fuse/v2/fuse" in any of:
    /usr/lib/go/src/github.com/hanwen/go-fuse/v2/fuse (from $GOROOT)
    /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/go-fuse/v2/fuse (from $GOPATH)
github.com/hanwen/usb (download)
cd .
git clone -- https://github.com/hanwen/usb /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/usb
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/usb
git submodule update --init --recursive
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/usb
git show-ref
cd /home/valandil/build/go-mtpfs-git/src/src/github.com/hanwen/usb
git submodule update --init --recursive
==> ERROR: A failure occurred in build().
    Aborting...

I'm using go version go1.13.1 linux/amd64 and go-tools 1.13, if it helps.

I'm new to Go, so I'm not sure if I'm doing something wrong on my end...

hanwen commented 5 years ago

looks like you are not using modules for the build.

joeydumont commented 5 years ago

I was able to compile by running

  go mod init hanwen/go-mtpfs
  go get -v -x github.com/hanwen/go-mtpfs

Is go mod init something that I, the packager, should be running, or should it be generated by you, the maintainer, and put into version control?

Also, I had to unset GOPATH, as go.mod cannot be in the GOPATH.

jitcor commented 5 years ago

我能够通过运行进行编译

  go mod init hanwen/go-mtpfs
  go get -v -x github.com/hanwen/go-mtpfs

go mod init的东西,我的打包,应该是跑步,还是应该由你来产生,维护者,并投入版本控制?

另外,我必须取消设置GOPATH,因为go.mod不能位于GOPATH中。

cannot find package "github.com/hanwen/go-fuse/v2/fs" I have encountered the same error, have you solved it?

joeydumont commented 5 years ago

I solved it by using the commands I quoted. Here's my PKGBUILD for Arch Linux:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=go-mtpfs-git

hanwen commented 4 years ago

this should be fixed by

commit ac020cbe756b93be91ed0a6ff5c55a7a44a39d68 Author: Han-Wen Nienhuys hanwen@google.com Date: Thu Oct 24 08:57:47 2019 +0200

README.md: update for Go modules

commit 05f80d1b888f5a0ef34a87f18bdfd93e919f49ca Author: Han-Wen Nienhuys hanwen@google.com Date: Thu Oct 24 08:52:40 2019 +0200

Add go.mod and go.sum