Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ jobs:
run: make build binaries
working-directory: src/github.com/containerd/continuity

- name: Cross-compile
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
GOOS=freebsd make build binaries
working-directory: src/github.com/containerd/continuity

- name: Linux Tests
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand All @@ -95,3 +88,36 @@ jobs:
shell: bash
run: make test-compile
working-directory: src/github.com/containerd/continuity

cross:
name: Cross-compile
runs-on: ubuntu-18.04
timeout-minutes: 10
needs: [project]

strategy:
matrix:
goos: [freebsd, openbsd, netbsd, darwin, solaris]

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15

- name: Setup Go binary path
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH

- name: Check out code
uses: actions/checkout@v2
with:
path: src/github.com/containerd/continuity

- name: Cross-compile ${{matrix.goos}}
shell: bash
run: |
GOOS=${{matrix.goos}} make build binaries
working-directory: src/github.com/containerd/continuity
4 changes: 2 additions & 2 deletions commands/mount_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build windows || solaris
// +build windows solaris
//go:build windows || solaris || openbsd || netbsd
// +build windows solaris openbsd netbsd

/*
Copyright The containerd Authors.
Expand Down
3 changes: 0 additions & 3 deletions continuityfs/provider.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build linux || darwin || freebsd
// +build linux darwin freebsd

/*
Copyright The containerd Authors.

Expand Down
4 changes: 2 additions & 2 deletions devices/devices_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin || freebsd || solaris
// +build linux darwin freebsd solaris
//go:build !windows
// +build !windows

/*
Copyright The containerd Authors.
Expand Down
4 changes: 2 additions & 2 deletions devices/mknod_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin || solaris
// +build linux darwin solaris
//go:build !(freebsd || windows)
// +build !freebsd,!windows

/*
Copyright The containerd Authors.
Expand Down
4 changes: 2 additions & 2 deletions driver/driver_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin || freebsd || solaris
// +build linux darwin freebsd solaris
//go:build !windows
// +build !windows

/*
Copyright The containerd Authors.
Expand Down
4 changes: 2 additions & 2 deletions driver/lchmod_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build darwin || freebsd || solaris
// +build darwin freebsd solaris
//go:build darwin || freebsd || netbsd || openbsd || solaris
// +build darwin freebsd netbsd openbsd solaris

/*
Copyright The containerd Authors.
Expand Down
7 changes: 0 additions & 7 deletions fs/copy_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,3 @@ func copyDevice(dst string, fi os.FileInfo) error {
}
return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev))
}

func utimesNano(name string, atime, mtime syscall.Timespec) error {
at := unix.NsecToTimespec(atime.Nano())
mt := unix.NsecToTimespec(mtime.Nano())
utimes := [2]unix.Timespec{at, mt}
return unix.UtimesNanoAt(unix.AT_FDCWD, name, utimes[0:], unix.AT_SYMLINK_NOFOLLOW)
}
9 changes: 2 additions & 7 deletions fs/copy_openbsdsolaris.go → fs/copy_device_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build openbsd || solaris
// +build openbsd solaris
//go:build openbsd || solaris || netbsd
// +build openbsd solaris netbsd

/*
Copyright The containerd Authors.
Expand Down Expand Up @@ -34,8 +34,3 @@ func copyDevice(dst string, fi os.FileInfo) error {
}
return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev))
}

func utimesNano(name string, atime, mtime syscall.Timespec) error {
timespec := []syscall.Timespec{atime, mtime}
return syscall.UtimesNano(name, timespec)
}
7 changes: 0 additions & 7 deletions fs/copy_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,3 @@ func copyDevice(dst string, fi os.FileInfo) error {
}
return unix.Mknod(dst, uint32(fi.Mode()), st.Rdev)
}

func utimesNano(name string, atime, mtime syscall.Timespec) error {
at := unix.NsecToTimespec(atime.Nano())
mt := unix.NsecToTimespec(mtime.Nano())
utimes := [2]unix.Timespec{at, mt}
return unix.UtimesNanoAt(unix.AT_FDCWD, name, utimes[0:], unix.AT_SYMLINK_NOFOLLOW)
}
4 changes: 2 additions & 2 deletions fs/copy_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build darwin || freebsd || openbsd || solaris
// +build darwin freebsd openbsd solaris
//go:build darwin || freebsd || openbsd || netbsd || solaris
// +build darwin freebsd openbsd netbsd solaris

/*
Copyright The containerd Authors.
Expand Down
4 changes: 2 additions & 2 deletions fs/stat_linuxopenbsd.go → fs/stat_atim.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || openbsd
// +build linux openbsd
//go:build linux || openbsd || solaris
// +build linux openbsd solaris

/*
Copyright The containerd Authors.
Expand Down
33 changes: 33 additions & 0 deletions fs/utimesnanoat.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//go:build !(windows || linux)
// +build !windows,!linux

/*
Copyright The containerd Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package fs

import (
"syscall"

"golang.org/x/sys/unix"
)

func utimesNano(name string, atime, mtime syscall.Timespec) error {
at := unix.NsecToTimespec(atime.Nano())
mt := unix.NsecToTimespec(mtime.Nano())
utimes := [2]unix.Timespec{at, mt}
return unix.UtimesNanoAt(unix.AT_FDCWD, name, utimes[0:], unix.AT_SYMLINK_NOFOLLOW)
}
4 changes: 2 additions & 2 deletions hardlinks_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin || freebsd || solaris
// +build linux darwin freebsd solaris
//go:build !windows
// +build !windows

/*
Copyright The containerd Authors.
Expand Down
4 changes: 2 additions & 2 deletions resource_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin || freebsd || solaris
// +build linux darwin freebsd solaris
//go:build !windows
// +build !windows

/*
Copyright The containerd Authors.
Expand Down
4 changes: 2 additions & 2 deletions sysx/nodata_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build darwin || freebsd || openbsd
// +build darwin freebsd openbsd
//go:build !(linux || solaris || windows)
// +build !linux,!solaris,!windows

/*
Copyright The containerd Authors.
Expand Down