Skip to content
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

Subtle fix for ament_libraries_deduplicate tests #516

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

cottsay
Copy link
Contributor

@cottsay cottsay commented Mar 1, 2024

Evidently 'release' isn't a config keyword, but 'general' is. I also modified the test to assert that the keyword is actually treated like a keyword.

We just got lucky that putting 'release' in that particular spot and treating it like a library name resulted in the same behavior as if it were a build config keyword.

@cottsay cottsay requested a review from sloretz March 1, 2024 18:58
@cottsay cottsay self-assigned this Mar 1, 2024
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this configuration list something ament invented, or does it come from somewhere else?

I see the ament_libraries_pack_build_configuration macro also looks for optimized:

if("${_lib}" MATCHES "^(debug|optimized|general)$")
. How about we add that to the test too?

@sloretz
Copy link
Contributor

sloretz commented Mar 1, 2024

Bread crumb for future readers: the keywords seem to come from the target_link_libraries call: https://cmake.org/cmake/help/v3.0/command/target_link_libraries.html#target-link-libraries

A debug, optimized, or general keyword indicates that the library immediately following it is to be used only for the corresponding build configuration. The debug keyword corresponds to the Debug configuration (or to configurations named in the DEBUG_CONFIGURATIONS global property if it is set). The optimized keyword corresponds to all other configurations. The general keyword corresponds to all configurations, and is purely optional (assumed if omitted). Higher granularity may be achieved for per-configuration rules by creating and linking to IMPORTED library targets.

Evidently 'release' isn't a config keyword, but 'general' is. I also
modified the test to assert that the keyword is actually treated like a
keyword.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay
Copy link
Contributor Author

cottsay commented Mar 1, 2024

How about we add that to the test too?

I updated the last test to validate that optimized is also treated as a keyword and not a library name.

Thanks!

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@cottsay cottsay merged commit c1cf011 into rolling Mar 1, 2024
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the cottsay/library-tests branch March 1, 2024 19:42
@VRichardJP
Copy link
Contributor

The general keyword corresponds to all configurations, and is purely optional (assumed if omitted).

Since "lib" = "general:lib", should the library deduplicate process transform "lib;general;lib" into "lib" (or "general;lib"?)

I don't think it is the case at the moment

@cottsay
Copy link
Contributor Author

cottsay commented Mar 2, 2024

Since "lib" = "general:lib", should the library deduplicate process transform "lib;general;lib" into "lib" (or "general;lib"?)

I don't think it is the case at the moment

I believe you're correct on both points. That additional deduplication could be viewed as a further optimization, separate from the additional tests and pending performance optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants