From 85aa5e67f250d80ce441b63afecd474f7f59e047 Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Mon, 12 Apr 2021 20:16:00 -0700 Subject: [PATCH] build: added freebsd build (untested) with FUSE mounting disabled (#964) * build: added freebsd build (untested) with mounting disabled until go-fuse has it * renamed freebsd package names to include 'experimental' --- .goreleaser.yml | 2 ++ internal/mount/mount_fuse.go | 2 +- internal/mount/mount_posix_webdav_helper.go | 2 +- internal/mount/mount_unsupported.go | 16 ++++++++++++++++ ...s_output_linux.go => local_fs_output_unix.go} | 2 ++ 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 internal/mount/mount_unsupported.go rename snapshot/restore/{local_fs_output_linux.go => local_fs_output_unix.go} (95%) diff --git a/.goreleaser.yml b/.goreleaser.yml index fb042d87e..9669bfa9b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,6 +8,7 @@ builds: - CGO_ENABLED=0 goos: - linux + - freebsd goarch: - amd64 - arm @@ -24,6 +25,7 @@ archives: darwin: macOS linux: linux windows: windows + freebsd: freebsd-experimental amd64: x64 name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}" wrap_in_directory: true diff --git a/internal/mount/mount_fuse.go b/internal/mount/mount_fuse.go index a69e7eb00..839c54389 100644 --- a/internal/mount/mount_fuse.go +++ b/internal/mount/mount_fuse.go @@ -1,4 +1,4 @@ -// +build !windows +// +build !windows,!freebsd package mount diff --git a/internal/mount/mount_posix_webdav_helper.go b/internal/mount/mount_posix_webdav_helper.go index 9af9c05d3..9d4ac777f 100644 --- a/internal/mount/mount_posix_webdav_helper.go +++ b/internal/mount/mount_posix_webdav_helper.go @@ -1,4 +1,4 @@ -// +build !windows +// +build !windows,!freebsd package mount diff --git a/internal/mount/mount_unsupported.go b/internal/mount/mount_unsupported.go new file mode 100644 index 000000000..6374e5d94 --- /dev/null +++ b/internal/mount/mount_unsupported.go @@ -0,0 +1,16 @@ +// +build freebsd + +package mount + +import ( + "context" + + "github.com/pkg/errors" + + "github.com/kopia/kopia/fs" +) + +// Directory returns an error due to mounting being unsupported on current operating system. +func Directory(ctx context.Context, entry fs.Directory, mountPoint string, mountOptions Options) (Controller, error) { + return nil, errors.Errorf("mounting is not supported") +} diff --git a/snapshot/restore/local_fs_output_linux.go b/snapshot/restore/local_fs_output_unix.go similarity index 95% rename from snapshot/restore/local_fs_output_linux.go rename to snapshot/restore/local_fs_output_unix.go index f745c6018..9c4da7e01 100644 --- a/snapshot/restore/local_fs_output_linux.go +++ b/snapshot/restore/local_fs_output_unix.go @@ -1,3 +1,5 @@ +// +build linux freebsd + package restore import (