Howdy, all! I’ve added a package for the nwnsc compiler to the Arch User Repository. This allows Arch Linux users to easily install nwnsc as a package on their system.
Requirements
This package requires lib32-gcc-libs from the multilib repository. See the wiki for how to enable multilib.
Outdated requirements
Since nwnsc’s installation script relies on docker, you need to install the docker package, start its daemon, and ensure your user is added to the docker group:
It’s a build dependency. Why, I’m not sure, but that’s what the build script that is bundled with it uses. I get that memory error that you helped me with if I don’t use docker to build it, so it’s likely related to Arch’s configuration.
Getting rid of the docker dependency is next on my to-do list.
Ah, you meant it fails to compile a nss. Does it work without includes then? With latest git too? What’s your gcc version? Works for me with 5.5.0, with -i and without in 1.69 mode.
Ah, I misremembered. The error appears regardless of whether the script includes others or not. And yes, I am using the latest version. My gcc is 8.3.0.
Doing a little more research, it looks like the docker install script is building using Holy Build Box 32. I’m not sure whether this setup has some library that I don’t have installed locally. Any suggestions?
That bug is because the code is doing something invalid/undefined. Because it is undefined, behavior can easily change between compiler/library versions. It just so happens that the version used with docker doesn’t manifest it, but the bug is still there and anything could expose it… Maybe now it only happens on Tuesdays?
We should fix the bug, or even just apply the stupid hack I gave you.
I’ve applied that hack and removed the docker dependency. valgrind shows some more errors that aren’t present in the docker build, but it doesn’t appear to stop the program, so I suppose it’s good enough for now.
Yeah, I get that too when using the -n switch. But try without it: extract nwscript.nss to the folder with binary and compile there. It should work (works for me). While obviously not ready for production, it may give an answer whether the free error happens without multilib too.
This is why using platform-dependent longs (or other built-in types) to read data of known fixed length is bad idea. In order for this program to work on both 32 and 64 bit systems one would at least need to heavily alter _NwnUtilLib/OsCompat.h make a smarter kludge or fix all NWN data-related longs in the library to (u)int32_ts.
PROTIP: How to find sizes of all built-in types w/o making any programs.