Skip to content

Commit

Permalink
Make bazel-remote packages consumable as a module
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mostynb committed Mar 5, 2023
1 parent 0d96c8a commit d0d2a17
Show file tree
Hide file tree
Showing 64 changed files with 137 additions and 132 deletions.
4 changes: 2 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

gazelle(
name = "gazelle",
prefix = "github.com/buchgr/bazel-remote",
prefix = "github.com/buchgr/bazel-remote/v2",
)

gazelle(
Expand All @@ -21,7 +21,7 @@ gazelle(
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/buchgr/bazel-remote",
importpath = "github.com/buchgr/bazel-remote/v2",
visibility = ["//visibility:private"],
deps = [
"//cache/disk:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["cache.go"],
importpath = "github.com/buchgr/bazel-remote/cache",
importpath = "github.com/buchgr/bazel-remote/v2/cache",
visibility = ["//visibility:public"],
)
2 changes: 1 addition & 1 deletion cache/azblobproxy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
"auth_methods.go",
"azblobproxy.go",
],
importpath = "github.com/buchgr/bazel-remote/cache/azblobproxy",
importpath = "github.com/buchgr/bazel-remote/v2/cache/azblobproxy",
visibility = ["//visibility:public"],
deps = [
"//cache:go_default_library",
Expand Down
6 changes: 3 additions & 3 deletions cache/azblobproxy/azblobproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"path"
"time"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/utils/backendproxy"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/utils/backendproxy"

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
Expand Down
2 changes: 1 addition & 1 deletion cache/disk/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_library(
"metrics.go",
"options.go",
],
importpath = "github.com/buchgr/bazel-remote/cache/disk",
importpath = "github.com/buchgr/bazel-remote/v2/cache/disk",
visibility = ["//visibility:public"],
deps = [
"//cache:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cache/disk/casblob/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["casblob.go"],
importpath = "github.com/buchgr/bazel-remote/cache/disk/casblob",
importpath = "github.com/buchgr/bazel-remote/v2/cache/disk/casblob",
visibility = ["//visibility:public"],
deps = ["//cache/disk/zstdimpl:go_default_library"],
)
Expand Down
2 changes: 1 addition & 1 deletion cache/disk/casblob/casblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"log"
"os"

"github.com/buchgr/bazel-remote/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/v2/cache/disk/zstdimpl"
)

type CompressionType uint8
Expand Down
12 changes: 6 additions & 6 deletions cache/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import (
"sync"
"time"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/utils/tempfile"
"github.com/buchgr/bazel-remote/utils/validate"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/v2/utils/tempfile"
"github.com/buchgr/bazel-remote/v2/utils/validate"

"github.com/djherbis/atime"

pb "github.com/buchgr/bazel-remote/genproto/build/bazel/remote/execution/v2"
pb "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/remote/execution/v2"
"google.golang.org/protobuf/proto"

"github.com/prometheus/client_golang/prometheus"
Expand Down
12 changes: 6 additions & 6 deletions cache/disk/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
"testing"
"time"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/cache/httpproxy"
testutils "github.com/buchgr/bazel-remote/utils"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/v2/cache/httpproxy"
testutils "github.com/buchgr/bazel-remote/v2/utils"

pb "github.com/buchgr/bazel-remote/genproto/build/bazel/remote/execution/v2"
pb "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/remote/execution/v2"
"google.golang.org/protobuf/proto"

"github.com/prometheus/client_golang/prometheus"
Expand Down
4 changes: 2 additions & 2 deletions cache/disk/findmissing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"errors"
"sync"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/v2/cache"

pb "github.com/buchgr/bazel-remote/genproto/build/bazel/remote/execution/v2"
pb "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/remote/execution/v2"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
6 changes: 3 additions & 3 deletions cache/disk/findmissing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"sync"
"testing"

"github.com/buchgr/bazel-remote/cache"
testutils "github.com/buchgr/bazel-remote/utils"
"github.com/buchgr/bazel-remote/v2/cache"
testutils "github.com/buchgr/bazel-remote/v2/utils"
"google.golang.org/protobuf/proto"

pb "github.com/buchgr/bazel-remote/genproto/build/bazel/remote/execution/v2"
pb "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/remote/execution/v2"
)

func TestFilterNonNIl(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions cache/disk/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"sync"
"time"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/utils/validate"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/v2/utils/validate"

"github.com/djherbis/atime"

Expand Down
4 changes: 2 additions & 2 deletions cache/disk/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"io"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/v2/cache"

pb "github.com/buchgr/bazel-remote/genproto/build/bazel/remote/execution/v2"
pb "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/remote/execution/v2"

"github.com/prometheus/client_golang/prometheus"
)
Expand Down
6 changes: 3 additions & 3 deletions cache/disk/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"log"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/cache/disk/zstdimpl"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/cache/disk/zstdimpl"

"github.com/prometheus/client_golang/prometheus"
)
Expand Down
2 changes: 1 addition & 1 deletion cache/disk/zstdimpl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ go_library(
],
"//conditions:default": [],
}),
importpath = "github.com/buchgr/bazel-remote/cache/disk/zstdimpl",
importpath = "github.com/buchgr/bazel-remote/v2/cache/disk/zstdimpl",
visibility = ["//visibility:public"],
deps = [
"//utils/zstdpool:go_default_library",
Expand Down
6 changes: 4 additions & 2 deletions cache/disk/zstdimpl/gozstd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package zstdimpl

import (
"errors"
"github.com/buchgr/bazel-remote/utils/zstdpool"
"io"

"github.com/buchgr/bazel-remote/v2/utils/zstdpool"

"github.com/klauspost/compress/zstd"
syncpool "github.com/mostynb/zstdpool-syncpool"
"io"
)

var zstdFastestLevel = zstd.WithEncoderLevel(zstd.SpeedFastest)
Expand Down
2 changes: 1 addition & 1 deletion cache/gcsproxy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["gcsproxy.go"],
importpath = "github.com/buchgr/bazel-remote/cache/gcsproxy",
importpath = "github.com/buchgr/bazel-remote/v2/cache/gcsproxy",
visibility = ["//visibility:public"],
deps = [
"//cache:go_default_library",
Expand Down
4 changes: 2 additions & 2 deletions cache/gcsproxy/gcsproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net/url"
"os"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/httpproxy"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/httpproxy"

"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
Expand Down
2 changes: 1 addition & 1 deletion cache/httpproxy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["httpproxy.go"],
importpath = "github.com/buchgr/bazel-remote/cache/httpproxy",
importpath = "github.com/buchgr/bazel-remote/v2/cache/httpproxy",
visibility = ["//visibility:public"],
deps = [
"//cache:go_default_library",
Expand Down
6 changes: 3 additions & 3 deletions cache/httpproxy/httpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"strconv"
"strings"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/utils/backendproxy"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/utils/backendproxy"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
Expand Down
10 changes: 5 additions & 5 deletions cache/httpproxy/httpproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"testing"
"time"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/cache/disk/zstdimpl"
testutils "github.com/buchgr/bazel-remote/utils"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/cache/disk/zstdimpl"
testutils "github.com/buchgr/bazel-remote/v2/utils"
)

type testServer struct {
Expand Down
2 changes: 1 addition & 1 deletion cache/s3proxy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
"auth_methods.go",
"s3proxy.go",
],
importpath = "github.com/buchgr/bazel-remote/cache/s3proxy",
importpath = "github.com/buchgr/bazel-remote/v2/cache/s3proxy",
visibility = ["//visibility:public"],
deps = [
"//cache:go_default_library",
Expand Down
6 changes: 3 additions & 3 deletions cache/s3proxy/s3proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"log"
"path"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/disk/casblob"
"github.com/buchgr/bazel-remote/utils/backendproxy"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/disk/casblob"
"github.com/buchgr/bazel-remote/v2/utils/backendproxy"

"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
Expand Down
2 changes: 1 addition & 1 deletion cache/s3proxy/s3proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package s3proxy
import (
"testing"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/v2/cache"
)

func TestObjectKey(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_library(
"s3.go",
"tls.go",
],
importpath = "github.com/buchgr/bazel-remote/config",
importpath = "github.com/buchgr/bazel-remote/v2/config",
visibility = ["//visibility:public"],
deps = [
"//cache:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion config/azblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/buchgr/bazel-remote/cache/azblobproxy"

"github.com/buchgr/bazel-remote/v2/cache/azblobproxy"
)

type AzBlobStorageConfig struct {
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"strings"
"time"

"github.com/buchgr/bazel-remote/cache"
"github.com/buchgr/bazel-remote/cache/azblobproxy"
"github.com/buchgr/bazel-remote/cache/s3proxy"
"github.com/buchgr/bazel-remote/v2/cache"
"github.com/buchgr/bazel-remote/v2/cache/azblobproxy"
"github.com/buchgr/bazel-remote/v2/cache/s3proxy"

"github.com/urfave/cli/v2"
yaml "gopkg.in/yaml.v3"
Expand Down
8 changes: 4 additions & 4 deletions config/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"net/http"
"net/url"

"github.com/buchgr/bazel-remote/cache/azblobproxy"
"github.com/buchgr/bazel-remote/cache/gcsproxy"
"github.com/buchgr/bazel-remote/cache/httpproxy"
"github.com/buchgr/bazel-remote/cache/s3proxy"
"github.com/buchgr/bazel-remote/v2/cache/azblobproxy"
"github.com/buchgr/bazel-remote/v2/cache/gcsproxy"
"github.com/buchgr/bazel-remote/v2/cache/httpproxy"
"github.com/buchgr/bazel-remote/v2/cache/s3proxy"
)

func (c *Config) setProxy() error {
Expand Down
3 changes: 2 additions & 1 deletion config/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"fmt"
"log"

"github.com/buchgr/bazel-remote/cache/s3proxy"
"github.com/buchgr/bazel-remote/v2/cache/s3proxy"

"github.com/minio/minio-go/v7/pkg/credentials"
)

Expand Down
2 changes: 1 addition & 1 deletion genproto/build/bazel/remote/asset/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["remote_asset.pb.go"],
importpath = "github.com/buchgr/bazel-remote/genproto/build/bazel/remote/asset/v1",
importpath = "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/remote/asset/v1",
visibility = ["//visibility:public"],
deps = [
"//genproto/build/bazel/remote/execution/v2:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion genproto/build/bazel/remote/asset/v1/remote_asset.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion genproto/build/bazel/remote/execution/v2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["remote_execution.pb.go"],
importpath = "github.com/buchgr/bazel-remote/genproto/build/bazel/remote/execution/v2",
importpath = "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/remote/execution/v2",
visibility = ["//visibility:public"],
deps = [
"//genproto/build/bazel/semver:go_default_library",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion genproto/build/bazel/semver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["semver.pb.go"],
importpath = "github.com/buchgr/bazel-remote/genproto/build/bazel/semver",
importpath = "github.com/buchgr/bazel-remote/v2/genproto/build/bazel/semver",
visibility = ["//visibility:public"],
deps = ["@com_github_golang_protobuf//proto:go_default_library"],
)
Loading

0 comments on commit d0d2a17

Please sign in to comment.