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

Fix build on Windows. #1705

Closed
wants to merge 1 commit into from

Conversation

klauspost
Copy link
Contributor

Do not attempt to build fuse on Windows. This allows building ipfs without "nofuse" flag.

Error without this PR:

c:\GoPath\src\github.com\ipfs\go-ipfs\cmd\ipfs>go build
# github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\error_std.go:27: undefined: errNoXattr
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\fuse.go:1092: undefined: attr
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\fuse_kernel.go:152: undefined: syscall.O_ACCMODE
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\fuse_kernel.go:378: undefined: attr

License: MIT
Signed-off-by: Klaus Post [email protected]

Do not attempt to build fuse on Windows. This allows building ipfs without "nofuse" flag.

Error without this PR:

c:\GoPath\src\github.com\ipfs\go-ipfs\cmd\ipfs>go build
# github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\error_std.go:27: undefined: errNoXattr
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\fuse.go:1092: undefined: attr
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\fuse_kernel.go:152: undefined: syscall.O_ACCMODE
c:\gopath\src\github.com\ipfs\go-ipfs\Godeps\_workspace\src\bazil.org\fuse\fuse_kernel.go:378: undefined: attr

License: MIT
Signed-off-by: Klaus Post <[email protected]>
@jbenet jbenet added the backlog label Sep 15, 2015
@whyrusleeping
Copy link
Member

LGTM, makes it easier for windows users to go get

@rht
Copy link
Contributor

rht commented Sep 15, 2015

LGTM

@jbenet
Copy link
Member

jbenet commented Sep 15, 2015

there's lots of places the nofuse flag appears:

core/commands/incfusever/incfusever.go:// +build !nofuse
core/commands/mount_darwin.go:// +build !nofuse
core/commands/mount_nofuse.go:// +build nofuse
core/commands/mount_unix.go:// +build !nofuse
docs/windows.md:go build -tags nofuse ./cmd/ipfs
fuse/ipns/ipns_test.go:// +build !nofuse
fuse/ipns/ipns_unix.go:// +build !nofuse
fuse/ipns/link_unix.go:// +build !nofuse
fuse/ipns/mount_unix.go:// +build !nofuse
fuse/mount/fuse.go:// +build !nofuse
fuse/readonly/ipfs_test.go:// +build !nofuse
fuse/readonly/mount_unix.go:// +build !nofuse
fuse/readonly/readonly_unix.go:// +build !nofuse

is it ok as is, or will this be confusing? do we need to fix it everywhere? @whyrusleeping ?

@chriscool
Copy link
Contributor

Isn't it possible to say somehow that windows implies nofuse?

@jbenet jbenet removed the backlog label Sep 20, 2015
@whyrusleeping whyrusleeping reopened this Sep 20, 2015
@jbenet jbenet added the status/in-progress In progress label Sep 20, 2015
@whyrusleeping
Copy link
Member

@gatesvp could you check that this works for you too?

@gatesvp
Copy link
Contributor

gatesvp commented Sep 22, 2015

Still a problem. I think we have to kill the symlink all together?

In Windows the symlink actually just comes down as a file whose contents are the name of the linked folder. I can manually fix the problem by deleting the symlink file and renaming the correct folder (looks like name is a hash). However, doing so means that I can't really commit this folder back to the git repository, so I also have to add git-ignore the files after I do this rename hoop jumping. And I'm not clear how I can check in any changes after that process because all of the folders will be wrong.

BTW, I actually tried to use the Windows mklink tool, which is kind of equivalent to the symlink. While the tool did work correctly, the Go compiler was throwing the same error. For whatever reason the Go compiler is not following the link?

I just went through the whole cycle over that last 20 minutes and that's where it stands.

I will try to repro / report the Go compiler issue as that's definitely a blocker for making any type of symlink substitution/git-hook to actually work. But mklink is an admin-only tool, so even I can make some type of git-hook work, this will likely wreck our go get install process for Windows users.

@gatesvp
Copy link
Contributor

gatesvp commented Sep 22, 2015

Might be the solution here. Will have to give it a shot later:
http://stackoverflow.com/a/16754068/261188

@whyrusleeping
Copy link
Member

symlinks have been slain, we should rebase this PR, make sure to re-test on a real windows machine and then merge this.

@whyrusleeping
Copy link
Member

@klauspost could you rebase this on top of master so we can polish and merge it?

@whyrusleeping
Copy link
Member

merged in #1999

@jbenet jbenet removed the status/in-progress In progress label Nov 23, 2015
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

Successfully merging this pull request may close these issues.

6 participants