This repository was archived by the owner on Jun 28, 2022. It is now read-only.
Add support for packaging shared library for Ruby on x86-64 Linux and macOS#26
Merged
Conversation
We don't support using an up-to-date `Rakefile` to release a version other than the current in `version.rb` so it doesn't make sense to keep old versions around.
This is still WIP, since the 0.3.0 release doesn't actually ship a shared library.
The `ddprof_ffi_with_rpath.pc` includes the linker flags
`-Wl,-rpath,${libdir}` so that libddprof can be linked to and used in
the directory it gets installed to.
Without this, we would need to set the same flags in the libddprof user
side, or use `LD_LIBRARY_PATH` or some other mean to tell the OS how
to find libddprof.
These two links helped me figure this out:
* https://amir.rachum.com/blog/2016/09/17/shared-libraries/
* mesonbuild/meson#4027
Also included is a change to `ffi-build.sh` so that the macOS dynamic
library is setup to correctly being used with rpath.
ivoanjo
commented
Feb 21, 2022
Comment on lines
-15
to
-26
| "0.2.0" => [ | ||
| { | ||
| file: "libddprof-x86_64-alpine-linux-musl.tar.gz", | ||
| sha256: "d519a6241d78260522624b8e79e98502510f11d5d9551f5f80fc1134e95fa146", | ||
| ruby_platform: "x86_64-linux-musl" | ||
| }, | ||
| { | ||
| file: "libddprof-x86_64-unknown-linux-gnu.tar.gz", | ||
| sha256: "cba0f24074d44781d7252b912faff50d330957e84a8f40a172a8138e81001f27", | ||
| ruby_platform: "x86_64-linux" | ||
| } | ||
| ], |
Member
Author
There was a problem hiding this comment.
Doesn't make sense to have the full list of older releases, we should only keep the latest one.
ivoanjo
commented
Feb 21, 2022
Comment on lines
+36
to
+38
| .reject do |f| | ||
| [".rspec", ".standard.yml", "Rakefile", "docker-compose.yml", "gems.rb", "README.md"].include?(f) | ||
| end |
Member
Author
There was a problem hiding this comment.
I've excluded these files from the final Ruby package since they aren't useful to customers.
r1viollet
approved these changes
Feb 21, 2022
r1viollet
left a comment
Contributor
There was a problem hiding this comment.
LGTM !
Thanks for the helpful comments and context around the change
Member
Author
|
Thanks for the speedy review! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
ddprof_ffi_with_rpath.pcfile that allows a user of libddprof to link and run with libddprof being installed on any folderMotivation
Package up shared library version for Ruby.
How to test the change?
The addition of
ddprof_ffi_with_rpath.pcchange can be tested by compiling/linking to libddprof using pkg-config and keeping libddprof in the build folder, separate from the compiled app.The Ruby changes can't be tested right now, because we don't yet have published binaries for v0.4.0. I've tested them locally, and I'll open a follow-up PR once we're ready to package the final v0.4.0 for Ruby.