You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
Kurento scaffolder produces not compilable code if using a wrong name #289
If I choose the "wrong" name for my module there are compilation errors ahead
e.g. "calib" is such a name. "test" works (in general, all modules having "calib" in the name produce this error)
$ kurento-module-scaffold MyCvModule cv-module-1 true
$ cd cv-module-1/my-cv-module/
$ mkdir -p build/ && cd build/
$ cmake ..
$ make
[100%] Built target kmsmycvmodulemodule
But choosing the name MyCvModuleCalib instead of MyCvModule, triggers the error!
$ kurento-module-scaffold MyCvModuleCalib cv-module-2 true
$ cd cv-module-2/my-cv-module-calib/
$ mkdir -p build/ && cd build/
$ cmake ..
$ make
[ 15%] Building CXX object src/server/CMakeFiles/kmsmycvmodulecalibinterface.dir/interface/generated-cpp/MyCvModuleCalibInternal.cpp.o
[ 21%] Building CXX object src/server/CMakeFiles/kmsmycvmodulecalibinterface.dir/interface/generated-cpp/MyCvModuleCalib.cpp.o
In file included from /home/juan/tmp/cv-module-dir/my-cv-module-calib/build/src/server/interface/generated-cpp/MyCvModuleCalib.cpp:3:0:
/home/juan/tmp/cv-module-dir/my-cv-module-calib/build/src/server/interface/generated-cpp/MyCvModuleCalib.hpp:6:23: fatal error: json/json.h: No such file or directory
In file included from /home/juan/tmp/cv-module-dir/my-cv-module-calib/build/src/server/interface/generated-cpp/MyCvModuleCalibInternal.hpp:6:0,
from /home/juan/tmp/cv-module-dir/my-cv-module-calib/build/src/server/interface/generated-cpp/MyCvModuleCalibInternal.cpp:4:
/home/juan/tmp/cv-module-dir/my-cv-module-calib/build/src/server/interface/generated-cpp/MyCvModuleCalib.hpp:6:23: fatal error: json/json.h: No such file or directory
compilation terminated.
What the... ??
I grep-ed the complete sources of all Kurento projects, and there is no special treatment of the word calib anywhere to be seen. So I have no idea of where is this coming from.
I'd rather have this open so we can have this issue in mind. Because the problem with mysterious names is definitely happening with current versions of the code.
The issue was right there, but quite difficult to notice in the build log!
$ mkdir build/ ; cd build/
$ cmake ..
[...]
Run command: '/usr/bin/kurento-module-creator -r;/home/juan/tmp/my-cv-module-calib/src/server/interface;-dr;/usr/share/kurento/modules;-it;cpp_pkgconfig;-c;/home/juan/tmp/my-cv-module-calib/build/src/server;-lf'
-- Generated: kmsmycvmoduleca.pc.in
[...]
Run command: '/usr/bin/kurento-module-creator -r;/home/juan/tmp/my-cv-module-calib/src/server/interface;-dr;/usr/share/kurento/modules;-it;cpp_find_cmake;-c;/home/juan/tmp/my-cv-module-calib/build/src/server;-lf'
-- Generated: FindKMSMYCVMODULECA.cmake.in
[...]
Notice the wrong file names kmsmycvmoduleca.pc.in and FindKMSMYCVMODULECA.cmake.in.
This is because any appearance of the word lib is being removed from file names. Probably an attempt to convert things like libsomething into something, but with the unintended effect of converting mycalib into myca.
So far I've located 3 places where this bad replacement is done:
I still had it on the "pending notifications" part of github :-) and I've been swimming in the module creator's code for the 7.0 release, so it was a quick fix now that I had the context.
This is because any appearance of the word lib is being removed from file names.
You might laugh, but after years I again stumbled upon this problem :)
Meanwhile whenever I create a new filter module, I don't use the scaffolder. Instead I'm taking an existing working module and renaming the obvious parts. This worked when moving from "webrtcavc" as name to "webrtcbarcode" and from there to "webrtcarucocode". Today I tried to move one of these to "webrtccalibration", forgetting about the "lib" thing... And boom :)
Yeah it's a weird one. Totally unexpected effects.
Not using the scaffolder is alright, actually it is just a helper tool, but since you have a sample working module, you're just fine by taking it and replacing the old name with the new one...
FWIW, now that this got fixed, it will ship with Kurento 6.18 and it is already available in the current development nightly builds.
Activity
j1elo commentedon Jun 25, 2020
I could reproduce this issue. With the newly rewritten instructions for creating modules everything works fine:
https://doc-kurento.readthedocs.io/en/latest/user/writing_modules.html
But choosing the name
MyCvModuleCalibinstead ofMyCvModule, triggers the error!What the... ??
I
grep-ed the complete sources of all Kurento projects, and there is no special treatment of the wordcalibanywhere to be seen. So I have no idea of where is this coming from.neilyoung commentedon Jun 25, 2020
Well... two years later :) Thanks anyway. I have made my peace with this :)
j1elo commentedon Jun 25, 2020
I'd rather have this open so we can have this issue in mind. Because the problem with mysterious names is definitely happening with current versions of the code.
neilyoung commentedon Jun 25, 2020
Sure. Sorry.
j1elo commentedon Apr 29, 2022
The issue was right there, but quite difficult to notice in the build log!
Notice the wrong file names kmsmycvmoduleca.pc.in and FindKMSMYCVMODULECA.cmake.in.
This is because any appearance of the word
libis being removed from file names. Probably an attempt to convert things likelibsomethingintosomething, but with the unintended effect of convertingmycalibintomyca.So far I've located 3 places where this bad replacement is done:
neilyoung commentedon Apr 29, 2022
Wow, this was an old one :)
j1elo commentedon Apr 29, 2022
I still had it on the "pending notifications" part of github :-) and I've been swimming in the module creator's code for the 7.0 release, so it was a quick fix now that I had the context.
neilyoung commentedon May 12, 2022
You might laugh, but after years I again stumbled upon this problem :)
Meanwhile whenever I create a new filter module, I don't use the scaffolder. Instead I'm taking an existing working module and renaming the obvious parts. This worked when moving from "webrtcavc" as name to "webrtcbarcode" and from there to "webrtcarucocode". Today I tried to move one of these to "webrtccalibration", forgetting about the "lib" thing... And boom :)
Nice bug
j1elo commentedon May 12, 2022
Yeah it's a weird one. Totally unexpected effects.
Not using the scaffolder is alright, actually it is just a helper tool, but since you have a sample working module, you're just fine by taking it and replacing the old name with the new one...
FWIW, now that this got fixed, it will ship with Kurento 6.18 and it is already available in the current development nightly builds.