Giter Site home page Giter Site logo

Nake Build Error about godot-nim HOT 14 OPEN

raelite avatar raelite commented on September 27, 2024
Nake Build Error

from godot-nim.

Comments (14)

Asarmir avatar Asarmir commented on September 27, 2024 1

Thank you. That seems to have worked. ChooseNim did a 32 bit install and so after correcting that. Plus all the suggestion it worked. I did get a small error that import fpscounter, import mainpanel weren't used. But it said it was still successful. Commenting them out also made it successful with no error msg. $src\stub.nim

from godot-nim.

dsrw avatar dsrw commented on September 27, 2024

This is happening because godot can't write the api.json file, which is required to generate the nim binding. This might be an issue with the current working directory, or something related to file permissions.

Try editing nakefile.nim to print out the full path of the api.json file, and verify that it's writable. Before this line: https://github.com/pragmagic/godot-nim-stub/blob/master/nakefile.nim#L21 add something like echo "api file: ", getCurrentDir()/jsonFile, then verify that the filename looks reasonable and that you can write to it. Ensure your path doesn't have any spaces or non-ascii characters. There could be an issue with the way the path is passed to godot.

If none of this helps, please post more info about your environment (os, location of project, location of godot) and I'll try to help you sort things out.

from godot-nim.

raelite avatar raelite commented on September 27, 2024

Well this was kinda hard and I gave up, since I am a beginner in such stuff~
Yes Path is a problem because it has spaces in it. So I packed everthing to another user and public etc.. nothing of this both things worked~ rn everything is in C:\Users\Public

Windows, Godot is in C:\Users\Public\Godot

from godot-nim.

dsrw avatar dsrw commented on September 27, 2024

I don't specifically know that spaces in the path are a problem, it's just the sort of thing that can cause trouble.

Your error is because Godot can't write the json.api file, so to move forward, you're going to need to know the file name that's being passed, so you can figure out why it can't be written. The path could be wrong. The directory could be read-only.

Assuming you're using godot-nim-stub, you should edit nakefile.nim to print out the path.

Change:

  if not fileExists(jsonFile) or
     godotBin.getLastModificationTime() > jsonFile.getLastModificationTime():
    direShell(godotBin, "--gdnative-generate-json-api", getCurrentDir()/jsonFile)

To:

  if not fileExists(jsonFile) or
     godotBin.getLastModificationTime() > jsonFile.getLastModificationTime():
    # print path to api.json:
    echo "api file: ", getCurrentDir()/jsonFile
    direShell(godotBin, "--gdnative-generate-json-api", getCurrentDir()/jsonFile)

Then look at what path it prints out and see if it makes sense. Verify that you can write to the file. I'm not a windows user, but assuming the path it printed out was C:\Users\Public\godot-nim-stub\src\godotapi\api.json you should be able to run something like notepad C:\Users\Public\godot-nim-stub\src\godotapi\api.json to verify that it can be written.

If all of that looks good, you could try launching your command prompt using "Run as administrator". There could be something up with file permissions.

from godot-nim.

tonogram avatar tonogram commented on September 27, 2024

Please try gnu and let me know if the issue persists.

from godot-nim.

Asarmir avatar Asarmir commented on September 27, 2024

I also had a issue with nake build. I enter your code:
if not fileExists(jsonFile) or
godotBin.getLastModificationTime() > jsonFile.getLastModificationTime():
# print path to api.json:
echo "api file: ", getCurrentDir()/jsonFile
direShell(godotBin, "--gdnative-generate-json-api", getCurrentDir()/jsonFile)

and I got the result:

C:\Users\randa\Documents\Code\godot-nim-stub>nake build
Compiling nakefile...
Hint: used config file 'C:\Users\randa.choosenim\toolchains\nim-1.6.0\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\randa.choosenim\toolchains\nim-1.6.0\config\config.nims' [Conf]
Hint: used config file 'C:\Users\randa\Documents\Code\godot-nim-stub\nakefile.nim.cfg' [Conf]
..........................................................................................................
C:\Users\randa\Documents\Code\godot-nim-stub\nakefile.nim(4, 12) Warning: import os.nim instead; ospaths is deprecated [Deprecated]
....................................
C:\Users\randa\Documents\Code\godot-nim-stub\nakefile.nim(57, 36) Error: undeclared identifier: 'jsonFile'
candidates (edit distance, scope distance); see '--spellSuggest':
(4, 3): 'nakefile' [module declared in C:\Users\randa\Documents\Code\godot-nim-stub\nakefile.nim(1, 2)]
(4, 4): 'copyFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(1814, 6)]
(4, 4): 'copyFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(1814, 6)]
(4, 4): 'endOfFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system\io.nim(543, 6)]
(4, 4): 'isNil' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system.nim(1595, 8)]
(4, 4): 'isNil' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system.nim(1602, 8)]
(4, 4): 'isNil' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system.nim(1606, 6)]
(4, 4): 'isNil' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system.nim(1608, 6)]
(4, 4): 'isNil' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system.nim(1609, 6)]
(4, 4): 'isNil' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system.nim(1610, 6)]
(4, 4): 'isNil' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system.nim(1611, 6)]
(4, 4): 'moveFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(2015, 6)]
(4, 4): 'moveFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(2015, 6)]
(4, 4): 'pcFile' [enumField declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(2243, 5)]
(4, 4): 'pcFile' [enumField declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(2243, 5)]
(4, 4): 'readFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system\io.nim(840, 6)]
(4, 4): 'sameFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(1555, 6)]
(4, 4): 'sameFile' [proc declared in C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\pure\os.nim(1555, 6)]

This is with windows 10, C:\Users\randa\Documents\Code\godot-nim-stub,
godot 3.2.exe located on desktop and nim 1.6

from godot-nim.

dsrw avatar dsrw commented on September 27, 2024

It looks like you added the code block to the end of the file, which isn’t going to work. You should be adding echo "api file: ", getCurrentDir()/jsonFile before the call to direShell. This isn’t going to fix anything, it’s just printing the path to api file it’s trying to generate so we can try to figure out why it can’t be written.

You could be having an entirely different issue though. Is your build also failing when Godot is trying to write api.json?

from godot-nim.

Asarmir avatar Asarmir commented on September 27, 2024

from godot-nim.

Asarmir avatar Asarmir commented on September 27, 2024

C:\Users\randa\Documents\Code\godot-nim-stub>nake build
jsonFIle: ----> C:\Users\randa\Documents\Code\godot-nim-stub\src\godotapi\api.json
Verifying dependencies for [email protected]
Info: Dependency on godot@>= 0.7.21 & < 0.8.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on compiler@>= 0.17.3 already satisfied
Verifying dependencies for [email protected]
Compiling ..\src\stub (from package stub) using c backend
stack trace: (most recent call last)
C:\Users\randa\Documents\Code\godot-nim-stub\src\config.nims(40, 11)
C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system\assertions.nim(38, 26) failedAssertImpl
C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system\assertions.nim(28, 11) raiseAssert
C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system\fatal.nim(53, 5) sysFatal
C:\Users\randa.choosenim\toolchains\nim-1.6.0\lib\system\fatal.nim(53, 5) Error: unhandled exception: C:\Users\randa\Documents\Code\godot-nim-stub\src\config.nims(40, 9) sizeof(int) == 8 [AssertionDefect]
Tip: 5 messages have been suppressed, use --verbose to show them.
Error: Execution failed with exit code 1
... Command: C:\Users\randa.nimble\bin\nim.exe c --noNimblePath -d:NimblePkgVersion=0.1.0 --path:C:\Users\randa.nimble\pkgs\godot-0.7.28 --path:C:\Users\randa.nimble\pkgs\compiler-1.6.0 --hints:off -o:.._dlls\nim_32.dll ..\src\stub

This is what I get. After I reCloned and added the new code.

const targetDir = "src"/"godotapi"
createDir(targetDir)
const jsonFile = targetDir/"api.json"
echo "jsonFIle: ----> ",getCurrentDir()/jsonFile
if not fileExists(jsonFile) or
godotBin.getLastModificationTime() > jsonFile.getLastModificationTime():
# print path to api.json:
echo "api file: ", getCurrentDir()/jsonFile
direShell(godotBin, "--gdnative-generate-json-api", getCurrentDir()/jsonFile)
if not fileExists(jsonFile):
echo "Failed to generate api.json"
quit(-1)

genApi(targetDir, jsonFile)

After rereading everything it seems like it's messing up writing the .dll in the _dll folder.

from godot-nim.

raelite avatar raelite commented on September 27, 2024

so, im sorry the last days where thought..
well the cmd still says some errors occured and closed the cmd somehow~?

Ill set up an new user Account and try it there :/

nvm seems like I did something wrong..
ERROR: save_file: Condition "!file" is true. Returned: ERR_FILE_CANT_WRITE
At: modules/gdnative/nativescript/api_generator.cpp:47
ERROR: init: Failed to generate C API

At: modules/gdnative/nativescript/nativescript.cpp:1083
Failed to generate api.json

thats the output seems it really cant somehow acces..

and with admin right:
api file: C:\Users\Rage Quit\Documents\nim\godot-nim-stub\src\godotapi\api.json
Godot Engine v3.2.2.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: NVIDIA GeForce GTX 960/PCIe/SSE2

Failed to generate api.json

yes I can run notepad C:\Users\Rage Quit\Documents\nim\godot-nim-stub\src\godotapi\api.json even without admin right~

from godot-nim.

raelite avatar raelite commented on September 27, 2024

so i tried it again with my double username account to acces a acc with a normal username, didnt worked, tried it on the account itself kinda worked..

C:\Users\digital\Documents\nim\godot-nim-stub>nake build
Error: Could not read package info file in C:\Users\digital\Documents\nim\godot-nim-stub\src\stub.nimble;
... Reading as ini file failed with:
... Invalid section: .
... Evaluating as NimScript file failed with:
... Error: cannot open 'C:\Users\Rage Quit.choosenim\toolchains\nim-1.4.8\lib\system.nim'
... printPkgInfo() failed.

and it seems like at the end it always still accessed

Error: cannot open 'C:\Users\Rage Quit\.choosenim\toolchains\nim-1.4.8\lib\system.nim'
now I need to look again how I change it again~ seems like I forgot how it works

from godot-nim.

dsrw avatar dsrw commented on September 27, 2024

@Asarmir it looks like you're using a 32 bit Nim install, but https://github.com/pragmagic/godot-nim-stub/blob/master/src/config.nims#L40 is ensuring that a 64 bit nim is being used. It's possible that if you delete that assertion things will work, but you're probably better off switching to 64 bit if you can.

Also, if you're using Nim 1.6.0, you'll need to change https://github.com/pragmagic/godot-nim-stub/blob/master/src/stub.nimble#L6 to something like requires "godot >= 0.8.2", since earlier versions don't work with nim 1.6.

Finally, if you're not using vcc, you should remove or comment out https://github.com/pragmagic/godot-nim-stub/blob/master/src/config.nims#L41. I just tested on Windows 10 and MinGW and everything seems to work on both nim 1.4.8 and 1.6.0 with the above changes.

from godot-nim.

dsrw avatar dsrw commented on September 27, 2024

@DigitalNXZ I just tested under windows and there's is an issue running from a directory with spaces in the path. Wrapping the path in double quotes by changing https://github.com/pragmagic/godot-nim-stub/blob/master/nakefile.nim#L21 to direShell(godotBin, "--gdnative-generate-json-api", "\"" & getCurrentDir()/jsonFile & "\"") fixed the problem for me.

Your current issue is something else. It looks like nimble is trying to find nim system libraries in the home directory of another user, but can't access them either because they're not there, or it doesn't have permission to read them. I'd suggest either switching back to your "Rage Quit" user and applying the fix above, or reinstalling nim with your new user and verifying that you don't have "C:\Users\Rage Quit" on your path.

from godot-nim.

raelite avatar raelite commented on September 27, 2024

verifying that you don't have "C:\Users\Rage Quit" on your path.
I dont have this in my path if i look in variables but ya ill try the one above and switching back to my acc with the double name.

where do I need to change https://github.com/pragmagic/godot-nim-stub/blob/master/nakefile.nim#L21 with diresehll(godotB...?

from godot-nim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.