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 go get github.com/buchgr/bazel-remote@v2.4.0 #635

Closed
dragonsinth opened this issue Feb 2, 2023 · 9 comments
Closed

cannot go get github.com/buchgr/bazel-remote@v2.4.0 #635

dragonsinth opened this issue Feb 2, 2023 · 9 comments

Comments

@dragonsinth
Copy link

Hi friends, great library! We're finding it very useful. However, we're sorta stuck on v1.3.3 because the directory layout doesn't follow the normal Go module version guidelines. Trying to pull a recent version fails:

> go get github.com/buchgr/bazel-remote@v2.4.0
go: github.com/buchgr/bazel-remote@v2.4.0: invalid version: module contains a go.mod file, so module path must match major version ("github.com/buchgr/bazel-remote/v2")

Thanks!
Scott

@mostynb
Copy link
Collaborator

mostynb commented Feb 2, 2023

Hi, bazel-remote isn't intended to be used as a library (though I have heard of people trying), and the "official" way to build it is with bazel, which "go get" doesn't support. Do you actually need to consume parts of bazel-remote as a library, or are you just trying to get a binary?

@dragonsinth
Copy link
Author

I'm actually trying to use it as a library, since it has a pretty nice clean interface. I'm bundling it into a service that also includes other sorts of network-accessible caches and proxies. (And in my case, it's easier to deploy as part of internal application framework, where I get things like logging and metrics and monitoring for free.)

@mostynb
Copy link
Collaborator

mostynb commented Feb 2, 2023

I'll need to do some research on go modules then (perhaps next week). I wonder if moving all the code except main.go into a v2/ directory with its own go.mod file would work...

@dragonsinth
Copy link
Author

It might be possible to just change the module declaration? Example I found: https://github.com/ClickHouse/clickhouse-go/blob/main/go.mod -- this package is imported as github.com/ClickHouse/clickhouse-go/v2 and works just fine.

Assuming there's no need to maintain 1.x releases going forward, this might be easiest.

@iangudger
Copy link

I'm running into this same issue. I want to build my own version of bazel-remote with a custom cache implementation.

mostynb added a commit to mostynb/bazel-remote that referenced this issue Mar 5, 2023
The new import path is:
github.com/buchgr/bazel-remote/v2

Warning: bazel-remote go packages do not follow semantic versioning rules,
since it is primarily intended to be consumed as a standalone executable.

I aim to maintain backwards compatibility for the standalone executable
(within each major release), but provide no guarantees on the stability of
the packages used internally.

Relates to buchgr#635.
@mostynb
Copy link
Collaborator

mostynb commented Mar 5, 2023

Sorry it took me a while to get around to this. Would something like this work? #646

(Note that I provide no guarantees on the stability or backwards compatibility of these packages.)

I would love to hear more about how you're using bazel-remote (or parts of it). Just curious- maybe it's something worth upstreaming?

@dragonsinth
Copy link
Author

dragonsinth commented Mar 6, 2023

Seems like that would work #646 (comment)

I'm putting together a caching proxy for a self-hosted CI that can handle multiple languages/tools, such as bazel, npm, go, python, etc. We sort of have our own "service rails" that make it easy to deploy self-built Go services.

mostynb added a commit to mostynb/bazel-remote that referenced this issue Mar 6, 2023
The new import path is:
github.com/buchgr/bazel-remote/v2

Warning: bazel-remote go packages do not follow semantic versioning rules,
since it is primarily intended to be consumed as a standalone executable.

I aim to maintain backwards compatibility for the standalone executable
(within each major release), but provide no guarantees on the stability of
the packages used internally.

Relates to buchgr#635.
@mostynb
Copy link
Collaborator

mostynb commented Mar 6, 2023

I made a 2.4.1 release with this change- does it work for you now?

@dragonsinth
Copy link
Author

Seems to work, thank you!!

> go get github.com/buchgr/bazel-remote/v2
go: downloading github.com/buchgr/bazel-remote/v2 v2.4.1

@mostynb mostynb closed this as completed Mar 6, 2023
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