sheret icon indicating copy to clipboard operation
sheret copied to clipboard

Sources won't compile (linux)

Open rstaub77 opened this issue 5 years ago • 10 comments

Hi, I tried to compile from sources (latest)

cd build
go build -ldflags="-s -w" ../src/sheret.go

All I got is

../src/sheret.go:20:3: cannot find package "github.com/pkg/browser" in any of:
(list of local go dependencies cache)

So there seem to be a missing dependance after all. I tried to remove the dep from the include list, but the so-called "browser" package is effectively in use, and another error arises. Any idea?

rstaub77 avatar May 19 '20 09:05 rstaub77

Hi, I had the same problem, it's because sheret depends on it, you have to download them.

Here, I got your back, do as following:

  1. Do go get github.com/ethanpil/sheret/src.
  2. Go to the $GOPATH/src/github.com/ethanpil/sheret/src.
  3. Download libraries with go get (optional?).
  4. Compile go build -ldflags="-s -w" -o sheret sheret.go

marekfilip avatar Jun 04 '20 09:06 marekfilip

Thanks for your answer. It's a little pity though, as the readme says "There are no dependencies.". I suspect it is more a packaging issue.

rstaub77 avatar Jun 04 '20 17:06 rstaub77

Good call. Since I added the open browser flag, there is now a dependency on the Browser package for cross platform browser open. I will investigate alternative. Is the zero dependency a real issue for you? Why?

ethanpil avatar Jul 03 '20 20:07 ethanpil

Hi, The zero dependency is not such an issue, except that documentation advertises it. One of the quality of Go is its portability, and as no release executable is provided for Linux, I tried to compile the sources myself to get a monolithic executable to work on my servers. Usually a simple "go build" in the source directory is enough to get the compilation done. In this specific case, it crashes, and I don't know Go this well to know for sure what is going wrong. I think a little update of the documentation and a proper paragraph about compiling the project would be enough.

rstaub77 avatar Jul 04 '20 10:07 rstaub77

same issue on macos big sur: sheret.go:20:3: no required module provides package github.com/pkg/browser: go.mod file not found in current directory or any parent directory; see 'go help modules' how to fix the issue?

pixelblender avatar Apr 03 '21 18:04 pixelblender

Thanks for letting me know. I will take a look when I have some time. May just be easier to sunset the Browser feature.

ethanpil avatar Apr 09 '21 17:04 ethanpil

Is it fixed yet?

saukrs avatar Dec 05 '22 16:12 saukrs

I think I will remove the Browser functionality and package dependency and release a new version. Also happy to accept a PR for this.

ethanpil avatar Dec 05 '22 21:12 ethanpil

Hi @elmkni thanks for the updates. If you submit a PR I will merge it and release a new version.

ethanpil avatar Jul 06 '23 18:07 ethanpil

Hi Ethan,

I've changed the dependencies from "github.com/pkg/browser" to "github.com/icza/gox/osx" because it is much smaller and has no sub-dependency itself! I also added the missing licenses for Go and Gox (they are actually compulsory) and edited 'release.bat' accordingly. I also bumped the version from '1.2' to '1.22' to reflect the changes I made! I've also added the go-1.20.5 compiled sheret binary v1.22 executable and release archive!

You may now merge my pull-request!

With best regards,

Elmar

elmkni avatar Jul 08 '23 13:07 elmkni