liquidev / pan

puny animator – create motion graphics using Lua
MIT License
37 stars 2 forks source link

Fails to compile. #14

Open aqilc opened 3 years ago

aqilc commented 3 years ago

This was my first time installing the package on my system, I just used the command you suggested in the README, nimble install https://github.com/liquidev/pan and the build failed. This is also my first time working with nim, so I didn't know how to resolve it myself. It tried building v0.1.0 first, failed that, and then built from master and that failed too.

image

      Info: Dependency on stbimage@>= 2.5 already satisfied
  Verifying dependencies for stb_image@2.5
 Installing weave@#5034793
Downloading https://github.com/mratsim/weave using git
  Verifying dependencies for weave@#5034793
 Installing synthesis@any version
Downloading https://github.com/mratsim/Synthesis using git
  Verifying dependencies for synthesis@0.2.0
 Installing synthesis@0.2.0
   Success: synthesis installed successfully.
 Installing weave@#5034793
   Success: weave installed successfully.
 Installing pan@#head
   Building pan/pan.exe using c backend
fatal.nim(49)            sysFatal
Error: unhandled exception: 'sym' is not accessible using discriminant 'kind' of type 'TNode' [FieldDefect]
       Tip: 1501 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: pan
        ... Execution failed with exit code 1
        ... Command: "D:\Apps and Files\Apps\nim\bin\nim.exe" c --colors:on --noNimblePath -d:release -d:NimblePkgVersion=0.2.0 --path:C:\Users\aqilc\.nimble\pkgs\cairo-1.1.1 --path:C:\Users\aqilc\.nimble\pkgs\rapid-#head --path:C:\Users\aqilc\.nimble\pkgs\aglet-0.4.4 --path:C:\Users\aqilc\.nimble\pkgs\glm-1.1.1 --path:C:\Users\aqilc\.nimble\pkgs\glfw-4.0.0 --path:C:\Users\aqilc\.nimble\pkgs\stb_image-2.5 --path:C:\Users\aqilc\.nimble\pkgs\stb_image-2.5 --path:C:\Users\aqilc\.nimble\pkgs\synthesis-0.2.0 --path:C:\Users\aqilc\.nimble\pkgs\weave-#5034793 --hints:off -o:C:\Users\aqilc\AppData\Local\Temp\nimble_14372\githubcom_liquidevpan_#head\pan.exe C:\Users\aqilc\AppData\Local\Temp\nimble_14372\githubcom_liquidevpan_#head\src\pan.nim
liquidev commented 3 years ago

Oh boy, a compiler crash. Triggers my PTSD every time I see it, because these are so damn hard to debug.

Honestly it would be a lot more helpful if the compiler actually showed you where in the world the crash occured, but unfortunately it doesn't. Let's try to debug this anyways.

Which compiler version are you using? You can check that with nim -v.

aqilc commented 3 years ago

I literally just installed it :D image

liquidev commented 3 years ago

I suppose you used choosenim? If so, try downloading an older version using choosenim 1.4.4, as, if I recall correctly, that's what I developed pan on. If not, we may have to try the development branch, but let's try an older version first.

liquidev commented 3 years ago

Yeah, I just checked with both 1.4.4 and 1.4.6 and the former seems to work correctly, while the latter crashes the compiler somewhere.

aqilc commented 3 years ago

I suppose you used choosenim? If so, try downloading an older version using choosenim 1.4.4, as, if I recall correctly, that's what I developed pan on. If not, we may have to try the development branch, but let's try an older version first.

Nah, I literally installed it in like a minute from a chocolatey package when I found this repo, since I'm into animations, design and clean fast output.

Huh, problem with compilation over two patch versions. I guess I'll look into choosenim since I don't have much of a choice. Hope you figure out the problem, this looks like a super useful app :D

liquidev commented 3 years ago

Yeah unfortunately Nim 1.4.6 broke something and pan doesn't compile there. AFAIK Nim devel also works but you have to pass in a backward compatibility flag -d:nimLegacyConvEnumEnum because some bimbo decided that enum to enum conversions should be an error, even though it's explicit already… and I thought they said "no breaking changes in 1.x versions" ;)

aqilc commented 3 years ago

Shouldn't you report this to the main repo?

liquidev commented 3 years ago

I'm gonna leave a comment on the RFC that introduced this change. The breaking change is in the development branch as of now, so it can still be reverted.

Edit: Seems like there is some arguing going on already https://github.com/nim-lang/RFCs/issues/294. I'm going to "fix" my code in the meantime (almost as if it were broken from the beginning, except it wasn't).

liquidev commented 3 years ago

So whatever bug caused this compiler crash is already fixed in upstream Nim, and with commit 457752a I've pushed a fix that makes pan compile on Nim devel. So for anyone in the future reading this, stay away from Nim 1.4.6.

hamidb80 commented 3 years ago

same error with:


can you fix it? to be honest I was looking for this project the whole past year :)

liquidev commented 3 years ago

@hamidb80 This will not be fixed, as it is a problem with post-1.4.6 releases of the Nim compiler. Please bug the compiler team for a backport from devel.

Honestly I could spend the time and effort to track down the issue and fix it, but I don't see the point if you can use choosenim to compile pan with an older version of Nim, or with the devel branch. In the end it would be a waste of my own time, which would be better spent adding features or fixing bugs in the app itself.