CelestialCartographers / Loenn

A Visual Map Maker and Level Editor for the game Celeste but better than the other one
MIT License
162 stars 21 forks source link

Require loop causes crash on startup #33

Closed Helen0903 closed 2 years ago

Helen0903 commented 2 years ago

I updated to the latest commit in the olympUI branch and got this crash:

Error

boot.lua:530: file_locations.lua:1: loop or previous error loading module 'utils.filesystem'

Traceback

[C]: in function 'error'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

Tracked it down to a require loop starting in logging.lua

file_locations -> utils.filesystem
       ^                 |
       |                 V
    logging    <-  utils.require

(This honestly might just be a me issue and I've messed something up)

Cruor commented 2 years ago

This is already fixed from what I remember, sounds like you are out of date 🤔 Can't really find anything super obvious here either, and neither filesystem or file locations use logging any more.

Helen0903 commented 2 years ago

I did think it was really weird, because if there really is a require loop I'd imagine it would be hard to work with Love crashing over it, so I must have messed something up? (Although I don't think I'm out of date, I'm on this Aug 4th commit)

Having said that, commenting out the logging in utils/require.lua did stop the crash, so there is a loop on my end at least.

Helen0903 commented 2 years ago

Ok came back to this and I'm pretty sure it is my fault: I don't think I set up the luajit-request dependency right, so Loenn fails in finding it. tryrequire uses logging when it fails to find a library, and so the loop is caused.

Seems like Love handles requires lazily because commenting out the logging lines fixes the crash despite require("logging") still being at the top of the file.

Helen0903 commented 2 years ago

I can replicate this on latest by doing love src from one level above the src folder, and "fix" it by doing cd src; love . so it looks a little bit like I'm just very dumb!

Closing :)