-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Master] Hotswap reload on debian #19373
Comments
Is this an issue specific to debian or is there an issue on windows as well? |
Idk i don't have trying on windows :/ |
Yes it does use boost:
|
How are you starting worldserver, './worldserver' from 'install_path/bin' directory, or ? |
@svranesevic Directly in folder bin |
Alright, I had similar issue on OS X with #19365, problem was GetDirectoryOfExecutable() in ScriptReloadMgr.cpp not evaluating executable parent directory correctly - Parent path of executable was evaluated in non canonical form (Containing './', or '../', which rendered file watcher unable to watch scripts shared libraries) Anyhow, can you try this fix on ScriptReloadMgr.cpp ? @@ -112,7 +117,7 @@ static fs::path GetDirectoryOfExecutable() if (path.is_absolute()) return path.parent_path(); else - return fs::absolute(path).parent_path(); + return fs::canonical(fs::absolute(path)).parent_path(); |
i have build this change, but same no reload :/ |
Does -DSCRIPTS="dynamic" reloads properly ? @Naios shine some light upon us :) |
|
For information i use
and this command |
I currently don't have any idea about this, sorry. You could try to enable trace logs for the hotswapping system so we know what's happening. |
@DoctorKraft when you build it with cmake the -DCMAKE_INSTALL_PREFIX= path must be outside the bin directory in order to get the dynamic linking to work !! |
Ah good catch @Skizooo, maybe we could add a CMake warning to the buildsystem, |
Yes you could, that's a great idea. |
@Skizooo so if i resume, i need move all files in my -DCMAKE_INSTALL_PREFIX not bin folder ? |
@DoctorKraft if you move them now is useless, you must build with cmake again with the -DCMAKE_INSTALL_PREFIX path to another directory (you will call it for example "NewServer") , after you compiled everything you need to copy the worldserver / bnetserver from bin directory to the directory called "NewServer" and run them from there. |
Sorry but i don't understand, i can't get
can you give me a concrete example ? |
@DoctorKraft i'm sorry for the misunderstanding, right now just copy the files that are inside the bin outside and start the server from there. |
@Skizooo I have already tried with cmake run before. But nothing reload when i modify... I have look when i modify and reload, the recompiler create folder |
Make sure that:
make install ... probably you missed the latter point. |
@DoctorKraft Did you try out the configuration I described in the post above? If so, let us know, so we can close this issue. |
@Naios I know how to build, i resume because maybe i don't understand one point (i have a very bad english) x) i have 3 directories
now i have my binary in I'm right? |
No, all content must stay inside the directory it was installed. |
Skizooo he said
But when you say no moving, it's my first method and i don't have dynamic reload with this. The recompiler works perfect but i need reboot worldserver for reload lib with modification |
Ah no. That's wrong. Did you try to run the worldserver from various locations: cd server
./bin/worldserver
# ... vs ..
cd bin
./worldserver Maybe there are issues with relative pathing |
I have tried both but it's the same no reload (i don't have error on start or when the recompiler runs). I need reboot worldserver for get modification in my spellscript. Nobody has a linux for check if it's me or not? |
Can confirm this issue on Arch (running TC tag/6.2.4/21742). The library is being built correctly, the destructor of the old script is called, then constructor of the OLD(!) script runs. The old script is still being used afterwards for handling events (OnGossipHello, etc.).
What works:
So somehow, there's a difference between calling ProcessReloadScriptModule() and calling ProcessUnloadScriptModule(), waiting a few cycles and then calling ProcessLoadScriptModule(). ProcessReloadScriptModule() simply calls ProcessUnloadScriptModule(), then ProcessLoadScriptModule(), while keeping the script context when unloading. Forcing it to swap script context does not solve this issue. Maybe someone with more insight to this problem can figure something out from my tests. |
I have implemented a workaround to this problem. The attached patch defers loading of libraries to the next cycle when calling ProcessReloadScriptModule().
|
What happens when you enable caching for your platform? #else // Posix
#include <dlfcn.h>
- // #define HOTSWAP_PLATFORM_REQUIRES_CACHING
+ #define HOTSWAP_PLATFORM_REQUIRES_CACHING
#endif Can you post the logs when verbose logging for the hotswap system is enabled? |
No, I thought that it might lead to issues anyway overwriting the loading dll... |
Ok nice ! You PR or i make it ? |
Feel free to open a PR for it |
Done ! Thanks @Naios for your help and others, the hotswap system is awesome for fastly work 👍 |
This should be resolved by #19465 |
Description:
I have a problem with hotswap system on debian, when i modify a file (spellscript for example). The recompiler run no problem, but after he doesn't reload lib with modification. I need to restart my worldserver for get modifications.
Steps to reproduce the problem:
(also trying with dynamic)
Branch(es): Master
TC rev. hash/commit: 19a0e05
Operating system: Debian 8 Jessie
The text was updated successfully, but these errors were encountered: