Skip to content

No warning when library name is converted to CMLIB keyword in a loss way. #6

@koudis

Description

@koudis

Taken from BringAuto internal Issue tracker, reported by @mikusaq .

I tried to add Packages to App using Package Tracker with the following code:

BA_PACKAGE_LIBRARY(test_package_1 v1.0.0)
BA_PACKAGE_LIBRARY(test_package_2 v1.0.0)

and I was then facing issues when building the App:

...
-- Distro ID: ubuntu
-- Distro Version ID: 24.04
-- Build type: Debug
...
-- BA_PACKAGE [REGISTER]: test_package_1
-- BA_PACKAGE [REGISTER]: test_package_2
�[31mCMake Error at /cmakelib/system_modules/CMLIB_CACHE_CONTROL.cmake:228 (MESSAGE):
  The cache under keywords 'BACPACK;TESTPACKAGE;DEBUG' already exist for
  different remote
Call Stack (most recent call first):
  /cmakelib/system_modules/CMLIB_DEPENDENCY.cmake:384 (CMLIB_CACHE_CONTROL_KEYWORDS_CHECK)
  /cmakelib/system_modules/CMLIB_DEPENDENCY.cmake:112 (_CMLIB_DEPENDENCY_DETERMINE_KEYWORDS)
  _tmp/cache/dir/CMLIB/STORAGE/DEP/BA_PACKAGE.cmake:181 (CMLIB_DEPENDENCY)
  _tmp/cache/dir/CMLIB/STORAGE/DEP/BA_PACKAGE.cmake:48 (_BRINGAUTO_PACKAGE)
  test_app_3/CMakeLists.txt:12 (BA_PACKAGE_LIBRARY)

�[0m
-- Configuring incomplete, errors occurred!

The problem is that the underscores and numeric values were replaced with empty strings so Package Tracker have seen two Packages with the same name. The allowed characters in Package Group Name are not documented. Also, the behavior of replacing characters with empty strings is confusing, maybe printing error message (something like these characters are not allowed) is a better idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions