git-lfs / git-lfs

Git extension for versioning large files
https://git-lfs.com
Other
12.84k stars 2.02k forks source link

util_darwin.go: Direct syscalls are no longer supported in Go v1.12+ #4245

Closed stanhu closed 4 years ago

stanhu commented 4 years ago

Describe the issue

https://github.com/git-lfs/git-lfs/pull/3745 added clone file support for macOS, but trying to compile util_darwin.go against a recent version of golang/sys library fails with:

util_darwin.go:127:3: undefined: unix.SYS_CLONEFILEAT

https://github.com/golang/sys/commit/6fcdbc0bbc04dcd9e7dc145879ceaf9bf1c6ff03 dropped support for making direct syscalls.

As mentioned in https://golang.org/doc/go1.12:

libSystem is now used when making syscalls on Darwin, ensuring forward-compatibility with future versions of macOS and iOS. The switch to libSystem triggered additional App Store checks for private API usage. Since it is considered private, syscall.Getdirentries now always fails with ENOSYS on iOS. Additionally, syscall.Setrlimit reports invalid argument in places where it historically succeeded. These consequences are not specific to Go and users should expect behavioral parity with libSystem's implementation going forward.

Example conversion: https://github.com/golang/sys/commit/45d26eb94bf33c7922ce3a86c8e5428d9d5193b1

/cc: @kazuki-ma

bk2204 commented 4 years ago

Hey,

Thanks for the report. We'll try to monitor the issue you linked here and see if the changes get merged upstream; if not, we'll probably just drop support for de-duplication on macOS. We don't really want to create our own trampolines.

chrisd8088 commented 4 years ago

Out of interest, has this been resolved by #4251?

bk2204 commented 4 years ago

I believe it has. I'll close the issue.