-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add ignition-
deprecations and aliases, and gz-
redirect
#239
Conversation
Signed-off-by: methylDragon <methylDragon@gmail.com>
Ubuntu test is unstable because this introduced depreciation warnings. If there's another approach that can get CI passing, I'm for it 👀 |
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
61b8fca
to
0199446
Compare
Signed-off-by: methylDragon <methylDragon@gmail.com>
db33317
to
1924594
Compare
the example workspace only has packages that use |
My understanding is that we're adding the deprecation warnings for |
d33ea03
to
883adf4
Compare
Since it's working for ubuntu and homebrew, and users are expected to use the gz- prefix of our internal libraries... Should we, in addition to merging in the deprecation warnings:
In either case, we'll need to migrate the library names before merging the deprecation warning in, otherwise CI will turn unstable for every downstream package that uses ignition-cmake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started updating the libraries to use the gz-
project name making use of this PR. See
- CMake project names from ignition to gz gazebo-tooling/release-tools#718
- Rename CMake project to gz gz-utils#57
- Rename CMake project to gz gz-math#420
The gz-
targets are being generated properly, but the include paths aren't working yet. Math isn't able to find includes from Utils. I think we need some more aliases.
Edit
Ah I forgot I had already done some changes on top of this PR. I'm testing with
ignition-
depreciations and aliases, and gz-
redirectignition-
deprecations and aliases, and gz-
redirect
cmake/GzExport.hh.in
Outdated
* ========================================================================== | ||
* This file was automatically generated by CMake; do not modify it directly. | ||
* To modify this file, make changes to ign-cmake/cmake/Export.hh.in | ||
* ========================================================================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file could be a bit simpler if it just includes Export.hh
and defines new macros with different names. We did something like this with libsdformat:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think this file shouldn't be here... It was placed here for testing the Windows CI (which still isn't resolved.)
Sorry about that! 🙇 I'll revert that specific change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit that introduced this file is now 💥
# TODO(CH3): Remove on tock | ||
if(${PACKAGE_NAME} MATCHES "^ign(ition)?-") | ||
message(DEPRECATION | ||
"\nThe use of 'ign-' and 'ignition-' prefixed libraries has been " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has find_package(ign-*)
ever worked? I thought we always had to spell it out as 1ignition-*. If that is the case, I would simplify this to only cover the case of
ignition-` to avoid confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake/IgnUtils.cmake
Outdated
"\nThe use of 'ign-' and 'ignition-' prefixed libraries has been " | ||
"deprecated in favor of 'gz-' and will be removed in the next version!\n" | ||
) | ||
set(PACKAGE_NAME_BAK ${PACKAGE_NAME}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PACKAGE_NAME_BAK
variable is confusing. can we use GZ_PACKAGE_NAME
in this code path for the gz-*
name and leave PACKAGE_NAME
unchanged until we've determined which package name is to be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split out a subset of these changes into #246 since I think it is easier to review than the aliasing and redirections |
Signed-off-by: methylDragon <methylDragon@gmail.com>
13c189f
to
f049aca
Compare
Signed-off-by: methylDragon <methylDragon@gmail.com>
f049aca
to
8690f68
Compare
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
I did not checked in depth, but whenever a get_target_property(_GZ_DEFINE_SYMBOL ${PROJECT_LIBRARY_TARGET_NAME} DEFINE_SYMBOL )
set_target_property(${IGN_LIBRARY_TARGET_NAME} PROPERTIES DEFINE_SYMBOL ${_GZ_DEFINE_SYMBOL}) to ensure that everything works as expected. |
I believe parts of this PR have been moved to other PRs.
After iterating a bit more on all these packages, I think this isn't worth it anymore. What this is proposing is to have So I believe there's little value in providing this alias.
I believe we're addressing all of these downstream at each library, so |
You're right! I think the main reason for this alias was to help make sure things didn't break when we're migrating the project names, but due to the need to build with a single core (from the colcon dependency resolution issue)... we're kind of out of luck.. So I'll close the PR! |
Description
This PR adds a deprecation warning to any calls of
ign_find_package()
with packages that have theign-
orignition-
prefix.It then attempts to find the
gz-
prefixed version of the package first, before falling back to the originally requested package on failure-to-find, all with clear warnings/notices. (See big caveat below)Additionally, it also creates
ignition-
aliases for the library names and include directories for anygz-
prefixed libraries, so that they can be used as if they wereignition-
prefixed (see Examples below).Examples
Try out the example workspace here: https://github.com/methylDragon/ign-gz-cmake-package-alias
gz-dummy_dependency
and/orign-dummy_dependency
, and its impact onign-dummy_dependent
, which explicitly depends onignition-dummy_dependency1
Run the commands with:
colcon build --executor sequential
See caveat below for why.
Invocations
Example invocations (with `--executor sequential`)
If
gz-
prefixed library is presentIf
gz-
prefixed library not present, butignition-
prefixed library is presentAliases
Resolving
ignition-
prefix with explicitgz-
importThis works!!!
Resolving
ignition-
prefix with redirectedgz-
importSo does this, even if the
ign_find_package(ignition-dummy_dependency1
) call resolves it togz-dummy_dependency1
!!!:Caveats
This was only tested on the example workspace. The behavior with components is unknown.
Sequential Builds
[Only occurs with
ign_find_package(ignition-XXX)
]Due to how
colcon-cmake
resolves dependencies (by looking at the exact strings in the CMake files), thegz-
prefix redirection doesn't get picked up in the dependency resolution. Because of this, it is likely that thegz-
prefixed library will continue to be building while the dependent library looks for it, causing thegz-
library to not be able to be found and for theignition-
fallback to be triggered.It is possible to force colcon to build things sequentially with
--executor sequential
, but this causes things to slow down since there will only be one core building at a time. The true solution will be to just not use the redirection and have the user replace all instances ofignition-
prefixes withgz-
prefixes for library names in their CMake files.Windows Issues
[Only occurs with
find_package(ignition-XXX)
on WINDOWS]If a package looks for
ignition-XXX
targets but the found library's project name isgz-XXX
, it won't be found. This is expected behavior normally, but with the redirection, is an edge case. (Inign-cmake
, theignition-XXX
library target is EXPLICITLY generated even forgz-XXX
project names, and works on all platforms other than windows!)The Windows CI is green because it is looking for the
gz-XXX
library. But observing the console logs, it is obvious theignition-
library target isn't installed properly.A relatively significant chunk of time was devoted to trying to fix this, but no solutions were found as of yet... It seems to be something specific in how Windows is compiling the CMake.
(
ignition-component_deps.lib
is missing in/lib
, and this is only the case on Windows. On other platforms, both generate appropriately.)