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

Install compiled libraries only to 'lib' #195

Merged
merged 2 commits into from Nov 9, 2023

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented May 16, 2023

The current behavior results in duplicate libraries installed to both the Python module in libdir and also into the global lib directory for the prefix.

The former seems unnecessary, so we should install the libraries only to lib.

@cottsay
Copy link
Member Author

cottsay commented May 16, 2023

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

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

So I'm not at all sure about this, but while looking this over I noticed something. That is the fact that if we remove the lines you are proposing to remove, then there is no reason to pass _build_type into these two macros anymore.

In turn, that leads me to look at where the macros are being called. They are called once with an "empty" (I assume "Release") build type for all platforms. And then, only on WIN32, they are called once for each build type. I don't exactly know what that means.

Looking at the history of this code, it was added in 2016 (via 1d7b4eb before we used PRs) and 2018 (via #10). So this code has been there quite a while.

I think we need to do some more extensive testing on this besides the normal CI. In particular, we should also test this out with Windows Debug to see what happens. If we can get it to work there, then I'm fine with the change, but we should then also remove the build_type argument from both macros (and maybe get rid of the macros completely).

@brta-jc
Copy link

brta-jc commented Oct 15, 2023

Bump. Any updates or plan for this?

@cottsay
Copy link
Member Author

cottsay commented Oct 16, 2023

Bump. Any updates or plan for this?

Yep:

I think we need to do some more extensive testing on this

By all means, if you're interested in seeing this merged, please test it and provide feedback.

cottsay and others added 2 commits November 8, 2023 21:12
The current behavior results in duplicate libraries installed to both
the Python module in libdir and also into the global lib directory for
the prefix.

The former seems unnecessary, so we should install the libraries only to
lib.

Signed-off-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette clalancette force-pushed the cottsay/install-libs-to-lib-only branch from 277ef2e to c5f3de2 Compare November 8, 2023 22:04
@clalancette
Copy link
Contributor

clalancette commented Nov 8, 2023

I've updated this to the latest, and also removed what I think are now unnecessary macros. Here's a large set of CI to see what happens:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status
  • Windows Debug Build Status
  • RHEL Build Status
  • Clang Build Status

@clalancette clalancette marked this pull request as ready for review November 9, 2023 15:17
@clalancette
Copy link
Contributor

All right, the extensive CI is actually really happy with this. So I'm going to go ahead and merge this in, since it seems to be an improvement, and doesn't seem to have downsides. After a few days in source, I'll likely also do a release of this just to be sure the buildfarm is happy with it as well.

@clalancette clalancette merged commit 058080f into rolling Nov 9, 2023
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the cottsay/install-libs-to-lib-only branch November 9, 2023 15:19
clalancette pushed a commit that referenced this pull request Apr 12, 2024
There seems that some regression might have happened after #195.
When removing those 2 lines, we avoid to install the .so files
in lib *and* python path.

Signed-off-by: Matthias Schoepfer <m.schoepfer@rethinkrobotics.com>
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.

rosidl_python installs two almost identical versions of lib<PACKAGE_NAME>__rosidl_generator_py.so
3 participants