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

NWN_GFF Assert Defects with gff output in stdout [Windows] #93

Open
WilliamDraco opened this issue Sep 25, 2023 · 3 comments
Open

NWN_GFF Assert Defects with gff output in stdout [Windows] #93

WilliamDraco opened this issue Sep 25, 2023 · 3 comments

Comments

@WilliamDraco
Copy link
Contributor

Running self-built neverwinter 1.6.3 (core-master/d1a3a5, nim 2.0.0) on Windows 11.

Attempting to output to stdout fails, as below:

> nwn_gff -i module.ifo.json -k gff
IFO V3.2fatal.nim(53)            sysFatal
Error: unhandled exception: gff.nim(700, 9) `io.getPosition == 8 + ioPosStart`  [AssertionDefect]

(Notice it succeed at outputting the result of lines 698 and 699 before failing)
Trying to direct output to a file results in similar but different failure

fatal.nim(53)            sysFatal
Error: unhandled exception: gff.nim(757, 9) `io.getPosition == ioPosStart + 56 + structs.len * 12 + fields.len * 12`  [AssertionDefect]

Attempting the reverse (nwn_gff -i module.ifo -k json) operates as expected.
Identified trying to accommodate stdin/stdout for @nwnt, which utilities the same write function. I've not tried stdout before to know if this is new.

@WilliamDraco
Copy link
Contributor Author

in the same vein, trying to pipe in a gff also fails

> Get-Content module.ifo | nwn_gff -l gff -o moduletest.json
util.nim(11)             readStrOrErr
Error: unhandled exception: wanted to read 16 but only got 9 [IOError]

This traces back to these lines. - Again occurred in my nwnt test and then replicates with nwn_gff.

@niv
Copy link
Owner

niv commented Sep 25, 2023

  • Does this happen on Windows only, or on Linux too?
  • Does this happen on win32 i386 builds of nwn_gff too?

@WilliamDraco
Copy link
Contributor Author

Using the downloaded win32 i386 build,

  1. The first error still occurs in the same way (i.e. just trying to print to the terminal)
  2. the second error does not occur, redirecting stdout to a file does not error nwn_gff -i module.ifo.json -k gff > test.txt. text.txt is not binary identical to the original module.ifo, and renaming test.txt to an test.ifo and attempting to jsonify it (or nwnt it) fails with the error:
util.nim(11)             readStrOrErr
Error: unhandled exception: wanted to read 16 but only got 0 [IOError]
  1. Trying to pipe in the gff continues to fail with the same error as my earlier comment (wanted 16 but got 9) as opposed to trying to pipe in this output above where it's 'gets' 0.

Using the linux build, via WSL (don't have a linux box)

  1. different error, but still a failure
nwn_gff -i module.ifo.json -k gff
io.nim(153)              raiseEIO
Error: unhandled exception: cannot retrieve file position [IOError]
  1. Pushing to a file instead of stdout successfully creates a test.txt that is binary-identical to the original module.ifo. nwn_gff -i module.ifo.json -k gff >test.txt

  2. cat module.ifo | nwn_gff -l gff -o moduletest.json also works as expected - Output json is the same as simply using -i module.ifo

Happy to accept that outputting gff to terminal (as in 1) is not actually useful, but would expect windows to act as linux for 2) and 3). I'm also a windows scrub though, so maybe I'm misunderstanding piping somewhere.

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

No branches or pull requests

2 participants