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

go install github.com/doronbehar/pistol@latest doesn't fetch the latest version? #112

Open
salenius opened this issue Jul 24, 2024 · 7 comments

Comments

@salenius
Copy link

salenius commented Jul 24, 2024

I can't install pistol on my Linux Mint computer. It has the following specs:

`Operating System: Linux Mint 21.3

Kernel: Linux 5.15.0-113-generic

Architecture: x86-64

Hardware Vendor: Apple Inc.

Hardware Model: iMac16,2

I have Golang and libmagic installed.

> go version
go version go1.22.5 linux/amd64

> whereis libmagic
libmagic: /usr/share/man/man3/libmagic.3.gz

Then when I'm trying to use command go install github.com/doronbehar/pistol/cmd/pistol@latest I get the following output

# github.com/doronbehar/pistol/internal_writers
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:33:22: undefined: archiver.NewZip
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:36:22: undefined: archiver.NewRar
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:39:22: undefined: archiver.NewTar
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:44:23: undefined: archiver.NewTarXz
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:50:23: undefined: archiver.NewTarBz2
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:56:23: undefined: archiver.NewTarGz
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:62:23: undefined: archiver.NewTarLz4
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:68:23: undefined: archiver.NewTarSz
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:73:23: undefined: archiver.NewTarZstd
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:85:34: undefined: archiver.Walker
go/pkg/mod/github.com/doronbehar/[email protected]/internal_writers/archives.go:85:34: too many errors

Any ideas is there something that I'm missing?

@doronbehar
Copy link
Owner

Linux on a Mac hardware? Nice. Do you have the magic.h header installed there? Try the file-devel package:

https://packages.fedoraproject.org/pkgs/file/file-devel/

@salenius
Copy link
Author

Thanks for the quick answer! Yeah, had this setup for just about a month now. :) I checked, I checked that I have the following files using your link as a reference:

usr/include/magic.h
lib/x86_64-linux-gnu/libmagic.so
lib/x86_64-linux-gnu/pkgconfig/libmagic.pc

file-devel doesn't seem to exist in repositories apt uses. Fedora version you linked is probably not the right one for my distro.

@doronbehar
Copy link
Owner

Does setting the following helps?

CGO_LDFLAGS="-L/lib/x86_64-linux-gnu"

Before running go install github.com/doronbehar/pistol/cmd/pistol@latest.

@salenius
Copy link
Author

I added that to my .profile. Unfortunately it doesn't help even after I rebooted my computer.

@doronbehar
Copy link
Owner

What happens when you git clone the repository, and run make, or go build?

@salenius
Copy link
Author

salenius commented Jul 25, 2024

I got it set up using cloning and then using ´make´ and it worked! Although pistol is not currently rendering the images in my terminal, but just showing textual information about the image. This latter thing is probably it's whole separate issue though.

EDIT: It seems you don't support image preview with rendering, so I guess this issue can be closed down. Thanks for the help!

PS. Great avatar, Snufkin is my favorite Moomin character :)

@doronbehar
Copy link
Owner

doronbehar commented Jul 25, 2024

Great I'm glad you have pistol working for you now. I won't close this issue as I think there is an issue with go install github.com/doronbehar/pistol/cmd/pistol@latest. I tried to reproduce this issue with:

env GOPATH=/tmp/go go install github.com/doronbehar/pistol/cmd/pistol@latest

And I encountered a different error:

go: downloading github.com/doronbehar/pistol v0.4.4
go: downloading github.com/doronbehar/magicmime v0.1.1-0.20211127135329-3de4ff29dc49
go: downloading github.com/adrg/xdg v0.4.0
go: downloading github.com/alexflint/go-arg v1.5.0
go: downloading github.com/alessio/shellescape v1.4.2
go: downloading github.com/sirupsen/logrus v1.9.3
go: downloading github.com/alecthomas/chroma/v2 v2.14.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/mholt/archiver/v4 v4.0.0-alpha.8
go: downloading github.com/nwaples/rardecode v1.1.3
go: downloading golang.org/x/sys v0.21.0
go: downloading github.com/alexflint/go-scalar v1.2.0
go: downloading github.com/dlclark/regexp2 v1.11.0
go: downloading github.com/klauspost/compress v1.17.9
go: downloading github.com/golang/snappy v0.0.4
go: downloading github.com/bodgit/sevenzip v1.3.0
go: downloading github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5
go: downloading github.com/andybalholm/brotli v1.1.0
go: downloading github.com/klauspost/pgzip v1.2.6
go: downloading github.com/nwaples/rardecode/v2 v2.0.0-beta.2
go: downloading github.com/pierrec/lz4/v4 v4.1.21
go: downloading github.com/therootcompany/xz v1.0.1
go: downloading github.com/ulikunitz/xz v0.5.12
go: downloading golang.org/x/text v0.3.8
go: downloading github.com/bodgit/plumbing v1.2.0
go: downloading github.com/bodgit/windows v1.0.0
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading go4.org v0.0.0-20200411211856-f5505b9728dd
go: downloading github.com/connesc/cipherio v0.2.1
go: downloading github.com/hashicorp/errwrap v1.0.0
github.com/doronbehar/magicmime: build constraints exclude all Go files in /tmp/pkg/mod/github.com/doronbehar/[email protected]

What worries me is that @latest doesn't fetch v0.5, but v0.4.4 - I'm pretty sure that is related to the issue - there were a few changes in the API of the libraries between 0.4.4 and 0.5 that are related to the errors you experienced.

I just bumped a new version (0.5.2) - perhaps that will be detected as @latest in a few hours.

What ever you'll decide to do, you can always fetch a static build of pistol (along with a manpage) via the release's assets:

https://github.com/doronbehar/pistol/releases

@doronbehar doronbehar changed the title Problem installing pistol on Linux Mint go install github.com/doronbehar/pistol@latest doesn't fetch the latest version? Jul 25, 2024
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

2 participants