Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't go build on windows #2168

Closed
jiyilanzhou opened this issue Jun 29, 2020 · 3 comments
Closed

can't go build on windows #2168

jiyilanzhou opened this issue Jun 29, 2020 · 3 comments

Comments

@jiyilanzhou
Copy link
Contributor

Describe the bug
when i build this project in my windows computor, build failed with undefined: syscall.Statfs_t

To Reproduce
Steps to reproduce the behavior:

  1. Run '...'
  2. See error
D:\goSpace\pkg\mod\github.com\filecoin-project\sector-storage@v0.0.0-20200625154333-98ef8e4ef246\stores\interface.go:41:11: undefined: syscall.Statfs_t
D:\goSpace\pkg\mod\github.com\filecoin-project\sector-storage@v0.0.0-20200625154333-98ef8e4ef246\stores\interface.go:42:12: undefined: syscall.Statfs
# pkg-config --cflags  -- D:/goSpace/src/github.com/filecoin-project/lotus/extern/filecoin-ffi/generated/../filcrypto.pc D:/goSpace/src/github.com/filecoin-project/lotus/extern/filecoin-ffi/generated/../filcrypto.pc D:/goSpace/src/github.com/filecoin-project/lotus/extern/filecoin-ffi/generated/../filcrypto.pc D:/goSpace/src/github.com/filecoin-project/lotus/extern/filecoin-ffi/generated/../filcrypto.pc D:/goSpace/src/github.com/filecoin-project/lotus/extern/filecoin-ffi/generated/../filcrypto.pc
pkg-config: exit status 3221225781

Expected behavior
build success

Screenshots
If applicable, add screenshots to help explain your problem.

Version (run lotus --version):

Additional context
Add any other context about the problem here.

@RobQuistNL
Copy link
Contributor

RobQuistNL commented Jun 29, 2020

On windows the syscall.statfs (fetching the free diskspace) should probably be replaced with something like this;

h := syscall.MustLoadDLL("kernel32.dll")
c := h.MustFindProc("GetDiskFreeSpaceExW")

var freeBytes int64

_, _, err := c.Call(uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(wd))),
    uintptr(unsafe.Pointer(&freeBytes)), nil, nil)

Windows is not officially supported so it might take while for this to be fixed - and there will probably be many more errors when compiling on windows.

@Kubuxu
Copy link
Contributor

Kubuxu commented Jun 29, 2020

The bigger problem will be the lack of filecoin-ffi for Windows.

@magik6k
Copy link
Contributor

magik6k commented Jun 29, 2020

Duplicate of #2133

@magik6k magik6k marked this as a duplicate of #2133 Jun 29, 2020
@magik6k magik6k closed this as completed Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants