Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
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

Closed

Description

@neilyoung

Already reported here.

https://groups.google.com/forum/#!searchin/kurento/calib%7Csort:date/kurento/tQXouGUdc3A/a0bbi6fbCwAJ

Validated on two different systems. Fresh installations.

Activity

  1. self-assigned this
    on Jun 25, 2020
  2. added
    bugNon-critical bug affecting expected behavior
    on Jun 25, 2020
  3. j1elo commented on Jun 25, 2020

    @j1elo
    Member

    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)

    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

    $ 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.

  4. neilyoung commented on Jun 25, 2020

    @neilyoung
    Author

    Well... two years later :) Thanks anyway. I have made my peace with this :)

  5. j1elo commented on Jun 25, 2020

    @j1elo
    Member

    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.

  6. reopened this on Jun 25, 2020
  7. neilyoung commented on Jun 25, 2020

    @neilyoung
    Author

    Sure. Sorry.

  8. j1elo commented on Apr 29, 2022

    @j1elo
    Member

    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:

  9. neilyoung commented on Apr 29, 2022

    @neilyoung
    Author

    Wow, this was an old one :)

  10. j1elo commented on Apr 29, 2022

    @j1elo
    Member

    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.

  11. neilyoung commented on May 12, 2022

    @neilyoung
    Author

    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 :)

    Nice bug

  12. j1elo commented on May 12, 2022

    @j1elo
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugNon-critical bug affecting expected behavior

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions