vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood
2018-01-16 13:20:59 +00:00
parent 8e83fb6fb9
commit 7d3a17725d
4878 changed files with 1974213 additions and 201199 deletions
+19 -6
View File
@@ -3,27 +3,40 @@ version: '{build}'
clone_folder: C:\projects\go\src\github.com\billziss-gh\cgofuse
environment:
CPATH: C:\Program Files (x86)\WinFsp\inc\fuse
CPATH: C:\projects\winfsp\inc\fuse
GODEBUG: cgocheck=2
GOPATH: C:\projects\go
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
install:
- choco install winfsp -y
- choco install winfsp --version=1.0.17072 -y
- git clone -q https://github.com/billziss-gh/winfsp.git C:\projects\winfsp
- git -C C:\projects\winfsp checkout -q release/1.2
build_script:
- go install -v ./...
test_script:
- go test ./fuse
- git clone -q https://github.com/billziss-gh/winfsp.git C:\projects\winfsp
- git -C C:\projects\winfsp checkout -q v1.0
- call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
- devenv C:\projects\winfsp\build\VStudio\winfsp.sln /build "Release|x64"
# hard code fsreg parameters because appveyor does not like percents ("--VolumePrefix=%1 %2")
- C:\projects\winfsp\tools\fsreg.bat gomemfs "C:\projects\go\bin\memfs.exe" "--VolumePrefix=\gomemfs\share M:" "D:P(A;;RPWPLC;;;WD)"
- call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
- devenv C:\projects\winfsp\build\VStudio\winfsp.sln /build "Release|x64"
# test against WinFsp v1.0
- 'net use M: \\gomemfs\share'
- 'M: & cd'
- C:\projects\winfsp\build\VStudio\build\Release\winfsp-tests-x64.exe --external --resilient --share-prefix=\gomemfs\share -create_allocation_test -getfileinfo_name_test -setfileinfo_test -delete_access_test -setsecurity_test -reparse* -stream*
- 'C: & cd'
- 'net use M: /delete'
# test against WinFsp v1.2 DLL with chflags, setcrtime and setchgtime
# HACK: mixing DLL and FSD versions; do not try this at home
- copy C:\projects\winfsp\build\VStudio\build\Release\winfsp-x64.dll C:\projects\go\bin
- 'net use M: \\gomemfs\share'
- 'M: & cd'
- C:\projects\winfsp\build\VStudio\build\Release\winfsp-tests-x64.exe --external --resilient --share-prefix=\gomemfs\share -create_allocation_test -getfileinfo_name_test -delete_access_test -setsecurity_test -reparse* -stream*
- 'C: & cd'
- 'net use M: /delete'
+2
View File
@@ -20,6 +20,8 @@ before_install:
- git -C /tmp/t/secfs.test checkout -q a00c9165646f78ad53d3ec052860384a029683e5
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sed -e 's/^fs=.*$/fs="cgofuse"/' -i "" /tmp/t/secfs.test/fstest/fstest/tests/conf; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sed -e 's/^fs=.*$/fs="cgofuse"/' -i"" /tmp/t/secfs.test/fstest/fstest/tests/conf; fi
# the following test started failing on Travis Linux; disabling!
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv /tmp/t/secfs.test/fstest/fstest/tests/chown/{,.}00.t; fi
# the following test succeeds on my Mac but fails on Travis OSX; I have no clue why; disabling!
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mv /tmp/t/secfs.test/fstest/fstest/tests/rmdir/{,.}12.t; fi
- mv /tmp/t/secfs.test/fstest/fstest/tests/{,.}zzz_ResourceFork
+2 -2
View File
@@ -33,8 +33,8 @@ RUN \
# install WinFsp-FUSE
RUN \
wget -q -O winfsp.zip --no-check-certificate \
https://github.com/billziss-gh/winfsp/archive/v1.0.zip && \
7z e winfsp.zip 'winfsp-1.0/inc/fuse/*' -o/usr/local/include/winfsp
https://github.com/billziss-gh/winfsp/archive/release/1.2.zip && \
7z e winfsp.zip 'winfsp-release-1.2/inc/fuse/*' -o/usr/local/include/winfsp
ENV \
OSXCROSS_NO_INCLUDE_PATH_WARNINGS 1
+42 -1
View File
@@ -78,6 +78,7 @@ func newNode(dev uint64, ino uint64, mode uint32, uid uint32, gid uint32) *node_
Mtim: tmsp,
Ctim: tmsp,
Birthtim: tmsp,
Flags: 0,
},
nil,
nil,
@@ -228,8 +229,9 @@ func (self *Memfs) Utimens(path string, tmsp []fuse.Timespec) (errc int) {
if nil == node {
return -fuse.ENOENT
}
node.stat.Ctim = fuse.Now()
if nil == tmsp {
tmsp0 := fuse.Now()
tmsp0 := node.stat.Ctim
tmsa := [2]fuse.Timespec{tmsp0, tmsp0}
tmsp = tmsa[:]
}
@@ -420,6 +422,41 @@ func (self *Memfs) Listxattr(path string, fill func(name string) bool) (errc int
return 0
}
func (self *Memfs) Chflags(path string, flags uint32) (errc int) {
defer trace(path, flags)(&errc)
defer self.synchronize()()
_, _, node := self.lookupNode(path, nil)
if nil == node {
return -fuse.ENOENT
}
node.stat.Flags = flags
node.stat.Ctim = fuse.Now()
return 0
}
func (self *Memfs) Setcrtime(path string, tmsp fuse.Timespec) (errc int) {
defer trace(path, tmsp)(&errc)
defer self.synchronize()()
_, _, node := self.lookupNode(path, nil)
if nil == node {
return -fuse.ENOENT
}
node.stat.Birthtim = tmsp
node.stat.Ctim = fuse.Now()
return 0
}
func (self *Memfs) Setchgtime(path string, tmsp fuse.Timespec) (errc int) {
defer trace(path, tmsp)(&errc)
defer self.synchronize()()
_, _, node := self.lookupNode(path, nil)
if nil == node {
return -fuse.ENOENT
}
node.stat.Ctim = tmsp
return 0
}
func (self *Memfs) lookupNode(path string, ancestor *node_t) (prnt *node_t, name string, node *node_t) {
prnt = self.root
name = ""
@@ -537,6 +574,10 @@ func NewMemfs() *Memfs {
return &self
}
var _ fuse.FileSystemChflags = (*Memfs)(nil)
var _ fuse.FileSystemSetcrtime = (*Memfs)(nil)
var _ fuse.FileSystemSetchgtime = (*Memfs)(nil)
func main() {
memfs := NewMemfs()
host := fuse.NewFileSystemHost(memfs)
+41 -1
View File
@@ -147,6 +147,7 @@ import (
"time"
)
// Error codes reported by FUSE file systems.
const (
E2BIG = int(C.E2BIG)
EACCES = int(C.EACCES)
@@ -229,6 +230,7 @@ const (
EXDEV = int(C.EXDEV)
)
// Flags used in FileSystemInterface.Create and FileSystemInterface.Open.
const (
O_RDONLY = int(C.O_RDONLY)
O_WRONLY = int(C.O_WRONLY)
@@ -240,6 +242,7 @@ const (
O_ACCMODE = int(C.O_ACCMODE)
)
// File type and permission bits.
const (
S_IFMT = 0170000
S_IFBLK = 0060000
@@ -267,6 +270,15 @@ const (
S_ISVTX = 01000
)
// BSD file flags (Windows file attributes).
const (
UF_HIDDEN = 0x00008000
UF_READONLY = 0x00001000
UF_SYSTEM = 0x00000080
UF_ARCHIVE = 0x00000800
)
// Options that control Setxattr operation.
const (
XATTR_CREATE = int(C.XATTR_CREATE)
XATTR_REPLACE = int(C.XATTR_REPLACE)
@@ -377,8 +389,11 @@ type Stat_t struct {
// Number of blocks allocated for this object.
Blocks int64
// File creation (birth) timestamp. [OSX only]
// File creation (birth) timestamp. [OSX and Windows only]
Birthtim Timespec
// BSD flags (UF_*). [OSX and Windows only]
Flags uint32
}
/*
@@ -466,9 +481,11 @@ type FileSystemInterface interface {
Access(path string, mask uint32) int
// Create creates and opens a file.
// The flags are a combination of the fuse.O_* constants.
Create(path string, flags int, mode uint32) (int, uint64)
// Open opens a file.
// The flags are a combination of the fuse.O_* constants.
Open(path string, flags int) (int, uint64)
// Getattr gets file attributes.
@@ -523,6 +540,27 @@ type FileSystemInterface interface {
Listxattr(path string, fill func(name string) bool) int
}
// FileSystemChflags is the interface that wraps the Chflags method.
//
// Chflags changes the BSD file flags (Windows file attributes). [OSX and Windows only]
type FileSystemChflags interface {
Chflags(path string, flags uint32) int
}
// FileSystemSetcrtime is the interface that wraps the Setcrtime method.
//
// Setcrtime changes the file creation (birth) time. [OSX and Windows only]
type FileSystemSetcrtime interface {
Setcrtime(path string, tmsp Timespec) int
}
// FileSystemSetchgtime is the interface that wraps the Setchgtime method.
//
// Setchgtime changes the file change (ctime) time. [OSX and Windows only]
type FileSystemSetchgtime interface {
Setchgtime(path string, tmsp Timespec) int
}
// Error encapsulates a FUSE error code. In some rare circumstances it is useful
// to signal an error to the FUSE layer by boxing the error code using Error and
// calling panic(). The FUSE layer will recover and report the boxed error code
@@ -630,12 +668,14 @@ func (*FileSystemBase) Access(path string, mask uint32) int {
}
// Create creates and opens a file.
// The flags are a combination of the fuse.O_* constants.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Create(path string, flags int, mode uint32) (int, uint64) {
return -ENOSYS, ^uint64(0)
}
// Open opens a file.
// The flags are a combination of the fuse.O_* constants.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Open(path string, flags int) (int, uint64) {
return -ENOSYS, ^uint64(0)
+94 -5
View File
@@ -48,6 +48,7 @@ static PVOID cgofuse_init_winfsp(VOID);
static CRITICAL_SECTION cgofuse_lock;
static PVOID cgofuse_module = 0;
static BOOLEAN cgofuse_stat_ex = FALSE;
static inline PVOID cgofuse_init_fast(int hardfail)
{
@@ -243,6 +244,9 @@ extern int hostFtruncate(char *path, fuse_off_t off, struct fuse_file_info *fi);
extern int hostFgetattr(char *path, fuse_stat_t *stbuf, struct fuse_file_info *fi);
//extern int hostLock(char *path, struct fuse_file_info *fi, int cmd, struct fuse_flock *lock);
extern int hostUtimens(char *path, fuse_timespec_t tv[2]);
extern int hostSetchgtime(char *path, fuse_timespec_t *tv);
extern int hostSetcrtime(char *path, fuse_timespec_t *tv);
extern int hostChflags(char *path, uint32_t flags);
static inline void hostAsgnCconninfo(struct fuse_conn_info *conn,
bool capCaseInsensitive,
@@ -253,6 +257,10 @@ static inline void hostAsgnCconninfo(struct fuse_conn_info *conn,
FUSE_ENABLE_CASE_INSENSITIVE(conn);
#elif defined(__linux__)
#elif defined(_WIN32)
#if defined(FSP_FUSE_CAP_STAT_EX)
conn->want |= conn->capable & FSP_FUSE_CAP_STAT_EX;
cgofuse_stat_ex = 0 != (conn->want & FSP_FUSE_CAP_STAT_EX); // hack!
#endif
if (capCaseInsensitive)
conn->want |= conn->capable & FSP_FUSE_CAP_CASE_INSENSITIVE;
if (capReaddirPlus)
@@ -301,7 +309,8 @@ static inline void hostCstatFromFusestat(fuse_stat_t *stbuf,
int64_t ctimSec, int64_t ctimNsec,
int64_t blksize,
int64_t blocks,
int64_t birthtimSec, int64_t birthtimNsec)
int64_t birthtimSec, int64_t birthtimNsec,
uint32_t flags)
{
memset(stbuf, 0, sizeof *stbuf);
stbuf->st_dev = dev;
@@ -312,18 +321,46 @@ static inline void hostCstatFromFusestat(fuse_stat_t *stbuf,
stbuf->st_gid = gid;
stbuf->st_rdev = rdev;
stbuf->st_size = size;
stbuf->st_blksize = blksize;
stbuf->st_blocks = blocks;
#if defined(__APPLE__)
stbuf->st_atimespec.tv_sec = atimSec; stbuf->st_atimespec.tv_nsec = atimNsec;
stbuf->st_mtimespec.tv_sec = mtimSec; stbuf->st_mtimespec.tv_nsec = mtimNsec;
stbuf->st_ctimespec.tv_sec = ctimSec; stbuf->st_ctimespec.tv_nsec = ctimNsec;
stbuf->st_birthtimespec.tv_sec = birthtimSec; stbuf->st_birthtimespec.tv_nsec = birthtimNsec;
if (0 != birthtimSec)
{
stbuf->st_birthtimespec.tv_sec = birthtimSec;
stbuf->st_birthtimespec.tv_nsec = birthtimNsec;
}
else
{
stbuf->st_birthtimespec.tv_sec = ctimSec;
stbuf->st_birthtimespec.tv_nsec = ctimNsec;
}
stbuf->st_flags = flags;
#elif defined(_WIN32)
stbuf->st_atim.tv_sec = atimSec; stbuf->st_atim.tv_nsec = atimNsec;
stbuf->st_mtim.tv_sec = mtimSec; stbuf->st_mtim.tv_nsec = mtimNsec;
stbuf->st_ctim.tv_sec = ctimSec; stbuf->st_ctim.tv_nsec = ctimNsec;
if (0 != birthtimSec)
{
stbuf->st_birthtim.tv_sec = birthtimSec;
stbuf->st_birthtim.tv_nsec = birthtimNsec;
}
else
{
stbuf->st_birthtim.tv_sec = ctimSec;
stbuf->st_birthtim.tv_nsec = ctimNsec;
}
#if defined(FSP_FUSE_CAP_STAT_EX)
if (cgofuse_stat_ex)
((struct fuse_stat_ex *)stbuf)->st_flags = flags;
#endif
#else
stbuf->st_atim.tv_sec = atimSec; stbuf->st_atim.tv_nsec = atimNsec;
stbuf->st_mtim.tv_sec = mtimSec; stbuf->st_mtim.tv_nsec = mtimNsec;
stbuf->st_ctim.tv_sec = ctimSec; stbuf->st_ctim.tv_nsec = ctimNsec;
#endif
stbuf->st_blksize = blksize;
stbuf->st_blocks = blocks;
}
static inline int hostFilldir(fuse_fill_dir_t filler, void *buf,
@@ -449,6 +486,11 @@ static int hostMount(int argc, char *argv[], void *data)
.fgetattr = (int (*)())hostFgetattr,
//.lock = (int (*)())hostFlock,
.utimens = (int (*)())hostUtimens,
#if defined(__APPLE__) || (defined(_WIN32) && defined(FSP_FUSE_CAP_STAT_EX))
.setchgtime = (int (*)())hostSetchgtime,
.setcrtime = (int (*)())hostSetcrtime,
.chflags = (int (*)())hostChflags,
#endif
};
#if defined(__GNUC__)
#pragma GCC diagnostic pop
@@ -574,7 +616,8 @@ func copyCstatFromFusestat(dst *C.fuse_stat_t, src *Stat_t) {
C.int64_t(src.Ctim.Sec), C.int64_t(src.Ctim.Nsec),
C.int64_t(src.Blksize),
C.int64_t(src.Blocks),
C.int64_t(src.Birthtim.Sec), C.int64_t(src.Birthtim.Nsec))
C.int64_t(src.Birthtim.Sec), C.int64_t(src.Birthtim.Nsec),
C.uint32_t(src.Flags))
}
func copyFusetimespecFromCtimespec(dst *Timespec, src *C.fuse_timespec_t) {
@@ -1002,6 +1045,52 @@ func hostUtimens(path0 *C.char, tmsp0 *C.fuse_timespec_t) (errc0 C.int) {
}
}
//export hostSetchgtime
func hostSetchgtime(path0 *C.char, tmsp0 *C.fuse_timespec_t) (errc0 C.int) {
defer recoverAsErrno(&errc0)
fsop := hostHandleGet(C.fuse_get_context().private_data).fsop
intf, ok := fsop.(FileSystemSetchgtime)
if !ok {
// say we did it!
return 0
}
path := C.GoString(path0)
tmsp := Timespec{}
copyFusetimespecFromCtimespec(&tmsp, tmsp0)
errc := intf.Setchgtime(path, tmsp)
return C.int(errc)
}
//export hostSetcrtime
func hostSetcrtime(path0 *C.char, tmsp0 *C.fuse_timespec_t) (errc0 C.int) {
defer recoverAsErrno(&errc0)
fsop := hostHandleGet(C.fuse_get_context().private_data).fsop
intf, ok := fsop.(FileSystemSetcrtime)
if !ok {
// say we did it!
return 0
}
path := C.GoString(path0)
tmsp := Timespec{}
copyFusetimespecFromCtimespec(&tmsp, tmsp0)
errc := intf.Setcrtime(path, tmsp)
return C.int(errc)
}
//export hostChflags
func hostChflags(path0 *C.char, flags C.uint32_t) (errc0 C.int) {
defer recoverAsErrno(&errc0)
fsop := hostHandleGet(C.fuse_get_context().private_data).fsop
intf, ok := fsop.(FileSystemChflags)
if !ok {
// say we did it!
return 0
}
path := C.GoString(path0)
errc := intf.Chflags(path, uint32(flags))
return C.int(errc)
}
// NewFileSystemHost creates a file system host.
func NewFileSystemHost(fsop FileSystemInterface) *FileSystemHost {
host := &FileSystemHost{}