mitranim / gow

Missing watch mode for Go commands. Watch Go files and execute a command like "go run" or "go test"
The Unlicense
747 stars 29 forks source link

gow requires to have Xcode pre-installed? #15

Open aslom opened 3 years ago

aslom commented 3 years ago

Add to instllation as requirement? https://github.com/mitranim/gow#installation

go get -u github.com/mitranim/gow
# github.com/mitranim/gow
/usr/local/Cellar/go/1.16/libexec/pkg/tool/darwin_amd64/link: /usr/local/Cellar/go/1.16/libexec/pkg/tool/darwin_amd64/link: running strip failed: signal: abort trap
dyld: Library not loaded: @rpath/libcodedirectory.dylib
  Referenced from: /Library/Developer/CommandLineTools/usr/bin/strip
  Reason: image not found
$  ls -l /usr/local/lib/libcodedirectory.dylib
ls: /usr/local/lib/libcodedirectory.dylib: No such file or directory
mitranim commented 3 years ago

Not sure if required... Both dependencies (github.com/rjeczalik/notify and golang.org/x/sys/unix) use C in Darwin builds, but MacOS should ship with the required tools installed (?). Unfortunately I'm not sufficiently familiar with C-based tools to tell what's happening here, or which dependency is causing this.

gow uses only a handful of constants from golang.org/x/sys/unix. If this is the cause, we could copy the constants to gow and remove the dependency. Perhaps, if you have spare time, you could do that and see if it builds? Apologies for offloading, but I'd have to seriously mess with my system to test this.

aslom commented 3 years ago

I have installed latest Xcode and linked dylib and gow instllation succeeded:

$ ln -s /Applications/Xcode.app/Contents//Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libcodedirectory.dylib /usr/local/lib/libcodedirectory.dylib
$ ls -l /usr/local/lib/libcodedirectory.dylib
lrwxr-xr-x  1 aslom  staff  110 Mar 24 10:34 /usr/local/lib/libcodedirectory.dylib -> /Applications/Xcode.app/Contents//Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libcodedirectory.dylib
$  go get -u github.com/mitranim/gow
$  gow version
go version go1.16 darwin/amd64
aslom commented 3 years ago

My ask was only to document what are requirements in case somebody else runs into the same problem hopefully that helps.

I do not know anything about golang.org/x/sys/unix or how to test it :( I expect C-based tools may be complex and frustrating to get tests 😱 😨

mitranim commented 3 years ago

Good to know. I might debug this properly when setting up the next machine (in months / years). For now, I'll probably try to drop one dependency as described above, and also document it as you suggested. Thanks for the notification. 🙂