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

Cannot build on Arch Linux #140

Closed
joeydumont opened this issue Oct 8, 2019 · 5 comments
Closed

Cannot build on Arch Linux #140

joeydumont opened this issue Oct 8, 2019 · 5 comments

Comments

@joeydumont
Copy link

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
Copy link
Owner

hanwen commented Oct 16, 2019

looks like you are not using modules for the build.

@joeydumont
Copy link
Author

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
Copy link

jitcor commented Oct 21, 2019

我能够通过运行进行编译

  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
Copy link
Author

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
Copy link
Owner

hanwen commented Jan 4, 2020

this should be fixed by

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

README.md: update for Go modules

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

Add go.mod and go.sum

@hanwen hanwen closed this as completed Jan 4, 2020
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

No branches or pull requests

3 participants