Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

mount: keep the xattr flag constants off freebsd (#10552)

Chris Lu4992ac1ca9d3
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 3bf43744f3..e7da65c350 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -75,8 +75,8 @@ jobs:
- name: Build
run: cd weed; go build -tags "elastic gocdk sqlite ydb tarantool tikv rclone" -v .
- build-windows:
- name: Build windows
+ build-cross:
+ name: Build cross-platform
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
@@ -85,10 +85,14 @@ jobs:
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- # weed/mount builds here but cannot mount yet. Without this the unix-only
- # syscall constants it needs creep back in unnoticed.
- - name: Build windows/amd64
- run: GOOS=windows GOARCH=amd64 go build ./weed/...
+ # Nothing else on a PR compiles these, so per-OS syscall constants creep
+ # back into shared files unnoticed and only a release build catches it.
+ - name: Cross-compile
+ run: |
+ for target in windows/amd64 windows/arm64 freebsd/amd64 darwin/arm64; do
+ echo "== $target"
+ GOOS=${target%/*} GOARCH=${target#*/} go build ./weed/...
+ done
test:
name: Test
diff --git a/weed/mount/syscall_shim_unix.go b/weed/mount/syscall_shim_unix.go
index acb5f1d774..d2f4bf4e8b 100644
--- a/weed/mount/syscall_shim_unix.go
+++ b/weed/mount/syscall_shim_unix.go
@@ -2,18 +2,11 @@
package mount
-import (
- "syscall"
-
- sys "golang.org/x/sys/unix"
-)
+import "syscall"
const (
f_RDLCK = syscall.F_RDLCK
f_WRLCK = syscall.F_WRLCK
f_UNLCK = syscall.F_UNLCK
o_ACCMODE = syscall.O_ACCMODE
-
- xattr_CREATE = sys.XATTR_CREATE
- xattr_REPLACE = sys.XATTR_REPLACE
)
diff --git a/weed/mount/weedfs_xattr_flags_unix.go b/weed/mount/weedfs_xattr_flags_unix.go
new file mode 100644
index 0000000000..f8187f6c74
--- /dev/null
+++ b/weed/mount/weedfs_xattr_flags_unix.go
@@ -0,0 +1,10 @@
+//go:build !windows && !freebsd
+
+package mount
+
+import sys "golang.org/x/sys/unix"
+
+const (
+ xattr_CREATE = sys.XATTR_CREATE
+ xattr_REPLACE = sys.XATTR_REPLACE
+)