yglukhov / nimx

GUI library
MIT License
1.09k stars 75 forks source link

`nake` on OSX does not work. #373

Closed treeform closed 4 years ago

treeform commented 5 years ago
nake 
No task specified, running default task defined by nakefile.
/Users/andre.vonhouck/.nimble/pkgs/nake-1.9.3/nake.nim(93) moduleHook
/Users/andre.vonhouck/.nimble/pkgs/nake-1.9.3/nakelib.nim(252) runTask
/p/nimx/nimx/naketools.nim(940) :anonymous
/p/nimx/nimx/naketools.nim(293) newBuilder
/p/nimx/nimx/naketools.nim(257) newBuilder
/Users/andre.vonhouck/.nimble/pkgs/plists-0.1.0/plists.nim(80) loadPlist
/Users/andre.vonhouck/.choosenim/toolchains/nim-#devel/lib/pure/xmlparser.nim(146) loadXml
/Users/andre.vonhouck/.choosenim/toolchains/nim-#devel/lib/pure/xmlparser.nim(138) loadXml
Error: unhandled exception: Unable to read file: /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX.sdk/SDKSettings.plist [IOError]
  * MacOS Majave Version 10.14.6
  * XCode Version 10.3 (10G8)
  * Nim Compiler Version 0.20.99 [MacOSX: amd64]
geohuz commented 4 years ago

I have done some change to make it work: in nimx/naketools.nim, find and change the correct macOSSDKPath:

b.macOSSDKPath = macosxDevRoot & "/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"

and the SDKSettings.plist has to be xml format, use the following command to convert it:

sudo plutil -convert xml1 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/SDKSettings.plist
nixfreak commented 4 years ago

Fri Nov 01: nimx | sw_vers ProductName: Mac OS X ProductVersion: 10.15.1 BuildVersion: 19B88

I made the following changes also, but still get same error. b.macOSSDKPath = macosxDevRoot & "/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"

sudo plutil -convert xml1 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/SDKSettings.plist nake Compiling nakefile... No task specified, running default task defined by nakefile. /Users/nix/.nimble/pkgs/nake-1.9.3/nake.nim(93) moduleHook /Users/nix/.nimble/pkgs/nake-1.9.3/nakelib.nim(252) runTask /Users/nix/.env/nim/nimx/nimx/nimx/naketools.nim(940) :anonymous /Users/nix/.env/nim/nimx/nimx/nimx/naketools.nim(293) newBuilder /Users/nix/.env/nim/nimx/nimx/nimx/naketools.nim(257) newBuilder /Users/nix/.nimble/pkgs/plists-0.1.0/plists.nim(80) loadPlist /Users/nix/.choosenim/toolchains/nim-#devel/lib/pure/xmlparser.nim(146) loadXml /Users/nix/.choosenim/toolchains/nim-#devel/lib/pure/xmlparser.nim(138) loadXml Error: unhandled exception: Unable to read file: /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX.sdk/SDKSettings.plist [IOError]

The only think that nake does is compile js correctly.

I can use nimx just fine though and cross compile to windows w/o using SDL2 (cause static linking isn't working form reason)

Thanks for a great framework -nix

geohuz commented 4 years ago

You have to locate the SDKSettings.plist file, maybe it's not in the directory

nixfreak commented 4 years ago

Yeah still having issues with this

yglukhov commented 4 years ago

It should be fixed in the plists dependency. Please update it.

nixfreak commented 4 years ago

I have done some change to make it work: in nimx/naketools.nim, find and change the correct macOSSDKPath:

b.macOSSDKPath = macosxDevRoot & "/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"

and the SDKSettings.plist has to be xml format, use the following command to convert it:

sudo plutil -convert xml1 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/SDKSettings.plist

Should I still add this ?

yglukhov commented 4 years ago

No, with the updated plists (and probably darwin) dependency it should just work

nixfreak commented 4 years ago

nake |tee  nake.error                                                                                                          [12:12:30]
/.nimble/pkgs/nake-1.9.3/nake.nim(93) moduleHook
/.nimble/pkgs/nake-1.9.3/nakelib.nim(252) runTask
/.env/nim/nimx/nimx/naketools.nim(931) :anonymous
/.env/nim/nimx/nimx/naketools.nim(282) newBuilder
env/nim/nimx/nimx/naketools.nim(246) newBuilder
/.nimble/pkgs/plists-0.1.0/plists.nim(80) loadPlist
/build/Nim/lib/pure/xmlparser.nim(146) loadXml
/build/Nim/lib/pure/xmlparser.nim(138) loadXml
Error: unhandled exception: Unable to read file: /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX.sdk/SDKSettings.plist [IOError]
No task specified, running default task defined by nakefile.
nixfreak commented 4 years ago

Can I help with anything ? -- test something ?

yglukhov commented 4 years ago

Forgot to mention. After updating plists and darwin you also have to delete nakefile (exe).

nixfreak commented 4 years ago

I'm sorry nakefile exe ? on Osx ?


 sudo plutil -convert xml1 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/SDKSettings.plist

aaronm:nimx/ (master*) $ rm -v nakefile                                                                                                                [14:05:15]
nakefile
aaronm:nimx/ (master*) $ nake                                                                                                                          [14:05:24]
Compiling nakefile...
No task specified, running default task defined by nakefile.
.nimble/pkgs/nake-1.9.3/nake.nim(93) moduleHook
/.nimble/pkgs/nake-1.9.3/nakelib.nim(252) runTask
/.env/nim/nimx/nimx/naketools.nim(931) :anonymous
/.env/nim/nimx/nimx/naketools.nim(282) newBuilder
/.env/nim/nimx/nimx/naketools.nim(246) newBuilder
/.nimble/pkgs/plists-0.1.0/plists.nim(80) loadPlist
/build/Nim/lib/pure/xmlparser.nim(146) loadXml
/build/Nim/lib/pure/xmlparser.nim(138) loadXml
Error: unhandled exception: Unable to read file: /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX.sdk/SDKSettings.plist [IOError]
yglukhov commented 4 years ago

Right, i meant the executable nakefile. Apparently you haven't updated the plists dependency. Proof: there's no loadXml on line 80 as your error suggests: https://github.com/yglukhov/plists/blob/master/plists.nim#L80. Do the following:

rm -r ~/.nimble/pkgs/plists-* ~/.nimble/pkgs/darwin-*
cd NIMX_DIR
nimble install -dy
rm nakefile
nixfreak commented 4 years ago

nake                                                                                                                          [15:53:19]
Compiling nakefile...
No task specified, running default task defined by nakefile.
/Users/aaronm/.nimble/pkgs/nake-1.9.3/nake.nim(93) moduleHook
/Users/aaronm/.nimble/pkgs/nake-1.9.3/nakelib.nim(252) runTask
/Users/aaronm/.env/nim/nimx/nimx/naketools.nim(931) :anonymous
/Users/aaronm/.env/nim/nimx/nimx/naketools.nim(282) newBuilder
/Users/aaronm/.env/nim/nimx/nimx/naketools.nim(248) newBuilder
/Users/aaronm/build/Nim/lib/pure/json.nim(464) []
/Users/aaronm/build/Nim/lib/system/assertions.nim(27) failedAssertImpl
/Users/aaronm/build/Nim/lib/system/assertions.nim(20) raiseAssert
/Users/aaronm/build/Nim/lib/system/fatal.nim(55) sysFatal
Error: unhandled exception: /Users/aaronm/build/Nim/lib/pure/json.nim(464, 9) `not isNil(node)`  [AssertionError]
yglukhov commented 4 years ago

Please show me the output of:

xcode-select --print-path
ls -l /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX.sdk/SDKSettings.plist
nixfreak commented 4 years ago

''' xcode-select --print-path [15:54:13] /Applications/Xcode.app/Contents/Developer

ls -l /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX.sdk/SDKSettings.plist [16:02:39]

ls: /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX.sdk/SDKSettings.plist: No such file or directory

yglukhov commented 4 years ago

Can you also run xcrun --show-sdk-path please?

nixfreak commented 4 years ago

$ xcrun --show-sdk-path [16:16:06]

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

yglukhov commented 4 years ago

And xcrun --show-sdk-version

nixfreak commented 4 years ago

xcrun --show-sdk-version [16:16:08] 10.15

yglukhov commented 4 years ago

Can you try this patch please? https://github.com/yglukhov/nimx/pull/399

nixfreak commented 4 years ago

I will look at it more later on tonight

I appreciate the help

/Users/aaronm/.nimble/pkgs/ttf-0.2.11/ttf.nim(934, 19) Error: type mismatch: got but expected one of: proc <(x, y: int): bool first type mismatch at position: 2 missing parameter: y proc <(x, y: int64): bool first type mismatch at position: 2 missing parameter: y 19 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them

expression: <numTables

drk-mtr commented 4 years ago

I was getting what I thought was a similar error, but I was wrong:

Error: unhandled exception: /Users/tl/.nimble/pkgs/nimx-0.1/nimx/naketools.nim(413, 26) `isValid(result)` /usr/local/Cellar/sdl2/2.0.10/lib [AssertionError]

In fact, all I needed to do was a brew install sdl2. I had mistakenly thought this was already installed since it appeared it was installed as part of the script when installing nimx. So it appears the latest paths fixed has worked i.e. my SDK paths are the same as nixfreak and all works well.

Big thanks for sharing the library - only my second day with nim but very impressed so far!

nixfreak commented 4 years ago

I was getting what I thought was a similar error, but I was wrong:

Error: unhandled exception: /Users/tl/.nimble/pkgs/nimx-0.1/nimx/naketools.nim(413, 26) `isValid(result)` /usr/local/Cellar/sdl2/2.0.10/lib [AssertionError]

In fact, all I needed to do was a brew install sdl2. I had mistakenly thought this was already installed since it appeared it was installed as part of the script when installing nimx. So it appears the latest paths fixed has worked i.e. my SDK paths are the same as nixfreak and all works well.

Big thanks for sharing the library - only my second day with nim but very impressed so far!

Are you able to successfully make (nake) nim files using OSx? 10.15?

nixfreak commented 4 years ago

I'm going to blow away nim and all libs and start fresh, if you want you can close this ticket. right now I'm rebuilding choosenim , after that I will try nimx again. Thanks again for all your help.

drk-mtr commented 4 years ago

Yes I was able to for a couple of hours yesterday. I had the 10.12 SDK installed too though, so I can't guarantee that I was using the 10.15 SDK that is also present. Since then I managed to break everything and now can't even get a previously working sdl2 example running, tried completely reinstalling everything but to no avail, so I don't think I'm in a position to help unfortunately ha.

yglukhov commented 4 years ago

So this seems to be resolved.