Skip to content

Small fixes for windows#84

Merged
matthewmueller merged 1 commit intomatthewmueller:masterfrom
tryy3:master
Dec 19, 2017
Merged

Small fixes for windows#84
matthewmueller merged 1 commit intomatthewmueller:masterfrom
tryy3:master

Conversation

@tryy3
Copy link
Copy Markdown
Contributor

@tryy3 tryy3 commented Dec 19, 2017

Because windows uses a different filesystem, it's better to use the filepath package, I am sure there is more problems, but this fix will at least make joy work.

There is a few more windows related issues I have found.

  • The relative method https://github.com/matthewmueller/joy/blob/master/internal/mains/mains.go#L43 will not work when you have Go installed on a different disk then the file you are compiling on. In my case I have Golang installed on my D: drive and I was trying to compile a file in the tmp folder which is on my C: drive
    Related error is: error building code: error finding mains: unable to get relative path: Rel: can't make C:\Users\tryy3\AppData\Local\Temp\sandbox578858875\main.go relative to D:\Codes\Golang\src\github.com\tryy3\joyplayground\sandbox

  • The command "joy" is already an existing command on windows that opens the "Game controller" application, there is probably not much to do about this issue other than maybe an alias or a note on the README?

Because windows uses a different filesystem, it's better to use the filepath package, I am sure there is more problems, but this fix will at least make joy work.
@matthewmueller matthewmueller merged commit b6bb4e1 into matthewmueller:master Dec 19, 2017
@matthewmueller
Copy link
Copy Markdown
Owner

Ahh I was hoping to account for that by using the filepath.Separator, but I guess not. Thanks for the fixes!

The relative issue seems like it might be tough unless we rewrite/fork Go's default importer (https://golang.org/src/go/build/build.go#L1130)

It errors out if I try to give it absolute paths.

@tryy3
Copy link
Copy Markdown
Contributor Author

tryy3 commented Dec 19, 2017

Yeah I am not sure if the relative issue should be fixed either... becuase in most cases you are supposed to have your code in the $GOPATH, so I don't know how many people will encounter my problem.
For now I simply set a different tmp folder path, but if we make the streaming that you mentioned #73 (comment) here my issue will be resolved.

So the question regarding relative issue is, should we try to fix it or should all paths be relative and it's up to the user who use joy to make sure the paths can be relative?

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.

2 participants