![]() |
|
Possible dependency bug - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: Possible dependency bug (/thread-2354.html) |
Possible dependency bug - esitee - 02-07-2017 Hello everyone! While working on my new mainframe, I've noticed a interesting (possible) bug with the dependency of 2 libs. I tried to include both of them via dependency directly in the server environement. Both libs basically included some tables with data. The strange part now was that I could use the contents of the first lib perfectly fine, but the second lib's tables weren't recognized at all (nil error). Both libs were located on the exact same path of my shared folder, with the same permissions set on them. Furthermore the paths and names were written perfectly fine, so everything was ok there. Here's the example code I used at first:
Anyhow, after Yuri thought it may be intentional, I tried a different version and it worked:
I did check the sf-helper and the tutorial in case there would have been anything to clear this up, but there wasn't. So is this a bug, was it intentional or did I just misunderstood how the whole dependency system works? RE: Possible dependency bug - Person8880 - 02-07-2017 I can't reproduce this. When I use two different files from the shared area that both declare globals with --@dependency, they are both run and both globals are available. If you can reduce this to the test case you've given in your post and get it to still fail (I'm assuming that's not the code you were really using), that would be helpful. RE: Possible dependency bug - esitee - 02-07-2017 (02-07-2017, 05:46 PM)Person8880 Wrote: If you can reduce this to the test case you've given in your post and get it to still fail (I'm assuming that's not the code you were really using), that would be helpful. I did reduce it to the test case before with the same result. I'll just leave the exact test code I used, when getting the error:
This throws the following error: Code: [SF - ERROR] SF:libtest.txt:10: attempt to index global 'L' (a nil value)And here the used table excerpts of the libs. For the sake of simplicity, i'm only going to post one entry of the warp table: Permission-Lib (functions and that stuff left out, but they work as well) :
Aschen-Lib:
As stated before, when I change things up, so that one file is later included with Code: require( "filepath" )RE: Possible dependency bug - Person8880 - 02-07-2017 I found the problem, it should be fixed when the servers next restart. RE: Possible dependency bug - esitee - 02-07-2017 Thank you, Person! |