openzfsonwindows / openzfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
475 stars 18 forks source link

Can't use ZFS volume for Golang GOPATH (Access is denied) #246

Open d-uzlov opened 1 year ago

d-uzlov commented 1 year ago

System information

PS C:\Windows\system32> zfs version
zfswin-2.2.0rc1
zfs-kmod-zfswin-2.2.0rc1

PS C:\Windows\system32> [System.Environment]::OSVersion

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.19045.0 Microsoft Windows NT 10.0.19045.0

Describe the problem you're observing

I tried to move my GOPATH directory to ZFS volume. When I tried to install the required compiler tools, half of them installed, but half got "Access is denied" error.

The file L:\go\pkg\sumdb\sum.golang.org\latest from the error is created, it contains some lines, I'm able to open and view it without issues. go probably tries to open the file with some special parameters which ZFS doesn't handle as expected.

Describe how to reproduce the problem

Install golang: https://go.dev/doc/install

L: is my ZFS mount, E: is an NTFS drive. Both drives didn't contain /go directory before this test.

ZFS drive:

PS C:\Users\danil> go version
go version go1.20.3 windows/amd64
PS C:\Users\danil> [Environment]::SetEnvironmentVariable('GOPATH', "L:\go")
PS C:\Users\danil> go install -v github.com/go-delve/delve/cmd/dlv@latest
go: github.com/go-delve/delve/cmd/dlv@latest: github.com/go-delve/delve@v1.21.0 requires
        github.com/spf13/cobra@v1.1.3: verifying go.mod: github.com/spf13/cobra@v1.1.3/go.mod: open L:\go\pkg\sumdb\sum.golang.org\latest: Access is denied.

NTFS drive:

```powershell PS C:\Users\danil> [Environment]::SetEnvironmentVariable('GOPATH', "E:\go") PS C:\Users\danil> go install -v github.com/go-delve/delve/cmd/dlv@latest go: downloading github.com/go-delve/delve v1.21.0 go: downloading github.com/sirupsen/logrus v1.6.0 go: downloading github.com/mattn/go-isatty v0.0.3 go: downloading github.com/spf13/cobra v1.1.3 go: downloading gopkg.in/yaml.v2 v2.4.0 go: downloading github.com/cosiner/argv v0.1.0 go: downloading github.com/derekparker/trie v0.0.0-20221213183930-4c74548207f4 go: downloading github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d go: downloading github.com/mattn/go-colorable v0.0.9 go: downloading github.com/google/go-dap v0.9.1 go: downloading github.com/hashicorp/golang-lru v0.5.4 go: downloading golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 go: downloading go.starlark.net v0.0.0-20220816155156-cfacd8902214 go: downloading golang.org/x/sys v0.0.0-20220908164124-27713097b956 go: downloading github.com/cilium/ebpf v0.7.0 go: downloading github.com/mattn/go-runewidth v0.0.13 go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3 go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0 go: downloading github.com/spf13/pflag v1.0.5 go: downloading github.com/inconshreveable/mousetrap v1.0.0 go: downloading github.com/rivo/uniseg v0.2.0 go: downloading github.com/russross/blackfriday/v2 v2.0.1 go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0 github.com/go-delve/delve/pkg/proc/macutil golang.org/x/sys/internal/unsafeheader github.com/rivo/uniseg github.com/shurcooL/sanitized_anchor_name github.com/hashicorp/golang-lru/simplelru github.com/derekparker/trie github.com/go-delve/delve/pkg/dwarf/leb128 github.com/konsorten/go-windows-terminal-sequences github.com/mattn/go-isatty github.com/go-delve/delve/pkg/dwarf/regnum github.com/go-delve/delve/pkg/dwarf github.com/cilium/ebpf/internal/unix github.com/go-delve/delve/pkg/proc/debuginfod github.com/go-delve/delve/pkg/elfwriter github.com/go-delve/delve/pkg/astutil github.com/go-delve/delve/pkg/version github.com/sirupsen/logrus golang.org/x/arch/arm64/arm64asm golang.org/x/arch/x86/x86asm github.com/cosiner/argv gopkg.in/yaml.v2 github.com/go-delve/delve/pkg/dwarf/op github.com/go-delve/delve/pkg/dwarf/frame github.com/go-delve/delve/pkg/dwarf/line github.com/go-delve/delve/pkg/terminal/colorize github.com/cilium/ebpf/asm github.com/cilium/ebpf/internal golang.org/x/sys/windows github.com/mattn/go-runewidth go.starlark.net/internal/spell go.starlark.net/syntax github.com/go-delve/delve/pkg/dwarf/godwarf github.com/mattn/go-colorable github.com/go-delve/delve/service/internal/sameuser github.com/google/go-dap github.com/go-delve/delve/pkg/logflags github.com/go-delve/liner github.com/inconshreveable/mousetrap github.com/cilium/ebpf/internal/btf github.com/spf13/pflag github.com/russross/blackfriday/v2 go.starlark.net/resolve github.com/go-delve/delve/pkg/goversion github.com/go-delve/delve/pkg/dwarf/loclist github.com/go-delve/delve/pkg/dwarf/reader go.starlark.net/internal/compile github.com/cilium/ebpf github.com/cpuguy83/go-md2man/v2/md2man go.starlark.net/starlark github.com/spf13/cobra github.com/spf13/cobra/doc github.com/go-delve/delve/pkg/proc/internal/ebpf github.com/go-delve/delve/pkg/proc go.starlark.net/starlarkstruct go.starlark.net/lib/time github.com/go-delve/delve/pkg/proc/winutil github.com/go-delve/delve/pkg/proc/amd64util github.com/go-delve/delve/service/api github.com/go-delve/delve/pkg/proc/core/minidump github.com/go-delve/delve/pkg/proc/linutil github.com/go-delve/delve/pkg/proc/native github.com/go-delve/delve/pkg/config github.com/go-delve/delve/pkg/locspec github.com/go-delve/delve/pkg/proc/core github.com/go-delve/delve/pkg/gobuild github.com/go-delve/delve/pkg/proc/gdbserial github.com/go-delve/delve/service/debugger github.com/go-delve/delve/service github.com/go-delve/delve/service/rpc1 github.com/go-delve/delve/service/rpc2 github.com/go-delve/delve/service/dap github.com/go-delve/delve/pkg/terminal/starbind github.com/go-delve/delve/service/rpccommon github.com/go-delve/delve/pkg/terminal github.com/go-delve/delve/cmd/dlv/cmds github.com/go-delve/delve/cmd/dlv PS C:\Users\danil> ```
lundman commented 1 year ago

Yes, similarly, you can't git clone on ZFS. rsync it over and use it no problem, but the initial thing you can not do

Clearly there is issues with the Security Descriptor we assign - but this is a Windows area I am unfamiliar with, so I'll have to read up on it. We follow the example of winbtrfs, and presumably it works for them.

lundman commented 1 year ago

git clone no longer give access denied but.. doesn't work for some other bug. This could be retested to see how far it gets now

parthibx24 commented 1 year ago

Same thing happens if I install games through Riot Client :/. Games installed through steam are working fine. Is there any known workaround for this? @lundman