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

Publish relevant crate names #5

Draft
wants to merge 45 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4af6146
Deliver libddprof_ffi as a shared library (#22)
nsavoire Feb 15, 2022
8e2246e
Bump version to 0.4.0-rc.1 (#25)
r1viollet Feb 21, 2022
16b5a77
Add support for packaging shared library for Ruby on x86-64 Linux and…
ivoanjo Feb 22, 2022
2f588cf
Fix `ffi-build.sh: line 78: fix_macos_rpath: unbound variable` issue …
ivoanjo Feb 22, 2022
eaf1e5f
Ship debug information in a separate file from the shared library (#29)
ivoanjo Feb 23, 2022
c7d3570
RFC: Introduce `ddprof_ffi_Buffer_from_byte_slice` function to enable…
ivoanjo Feb 24, 2022
52322bb
Increase reported profile timestamp precision (#31)
ivoanjo Mar 9, 2022
06e9611
[PROF-4780] Breaking change: Change FFI File struct to contain a Buff…
ivoanjo Mar 11, 2022
63bef61
Switch ddprof http client (#32)
paullegranddc Mar 15, 2022
89f8ef8
Fix clippy lints,expose dependencies of API, remove unused Exporter A…
morrisonlevi Mar 18, 2022
a4de688
Add helper for creating CharSlice from a string literal (#36)
ivoanjo Mar 21, 2022
e2bf03e
Fix tests (#37)
morrisonlevi Mar 21, 2022
6454bce
Note the upgrade to Rust 1.56
morrisonlevi Mar 22, 2022
8c87c09
Bump version to v0.5.0-rc.1 (#38)
morrisonlevi Mar 24, 2022
2bbd55c
Ruby updates: 0.5.0 packaging + package arm64 + change fallback packa…
ivoanjo Mar 29, 2022
88277c1
Allow sending tags when building the HTTP request (#40)
morrisonlevi Mar 31, 2022
e6d6574
Add Vec type, remove Buffer, add SendResult_drop (#41)
morrisonlevi Mar 31, 2022
a311381
Return SerializeResult for serializing a profile (#42)
morrisonlevi Mar 31, 2022
da6864e
Github CI lint and and tests (#46)
pawelchcki Apr 12, 2022
079d96a
Cleanup slices, strings, tags, and vecs (#44)
morrisonlevi Apr 12, 2022
19b92af
Refactoring of https connector to make root certificates optional (#47)
pawelchcki Apr 13, 2022
baea3a4
Add missing copyright headers (#51)
pawelchcki Apr 13, 2022
c84b2ec
Enhance Tags API (#49)
morrisonlevi Apr 13, 2022
c64a3e3
Bump version to 0.6.0-rc.1 (#53)
r1viollet Apr 14, 2022
c5dcf33
Asynchronous cancellation for ddprof_ffi_ProfileExporterV3_send (#45)
ivoanjo Apr 14, 2022
bb2f6e4
Fix license check
r1viollet Apr 14, 2022
bfc2654
Import simple telemetry implementation without native_deps and langua…
pawelchcki Apr 15, 2022
7cb9f7e
Fix failing gitlab CI lints (#57)
paullegranddc Apr 21, 2022
eb5b0e8
Add more lints to correspond with existing build system (#58)
pawelchcki Apr 21, 2022
85be26e
Test rust 1.56.1 compatibility (#54)
pawelchcki Apr 21, 2022
6dbf2eb
Initial version of CODEOWNERS (#52)
pawelchcki Apr 21, 2022
be43188
Fix license paths
morrisonlevi Apr 21, 2022
a82bd9c
Release v0.6.0
morrisonlevi Apr 21, 2022
0711e0d
Fix inconsistency between `SendResult` and other results (#60)
ivoanjo Apr 26, 2022
4b305cd
Package 0.6.0 release for Ruby (#59)
ivoanjo May 3, 2022
0ebe874
Grab the datadog-profiler crate
r1viollet May 6, 2022
2d5ceb9
Define license to prevent upload error
r1viollet May 6, 2022
a71832a
Create an empty datadog telemetry crate
r1viollet May 6, 2022
6fc2342
Adding placeholder crates for Datadog
r1viollet May 6, 2022
e4eab02
Fix duplicated description in crate
r1viollet May 6, 2022
ca7d337
Remove existing apm crate
r1viollet May 6, 2022
5ed73fd
Fix missing license
r1viollet May 6, 2022
13022e3
Merge remote-tracking branch 'libdd/main' into m
pawelchcki May 10, 2022
7dbf423
Merge branch 'm' into r1viollet/publish_crates
pawelchcki May 10, 2022
8ba99f7
Create placeholder for `datadog-profiling` crate
ivoanjo Aug 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ruby updates: 0.5.0 packaging + package arm64 + change fallback packa…
…ge strategy (#39)

* Switch Ruby to use ddprof_ffi_with_rpath.pc

In a previous commit I added the code to generate
`ddprof_ffi_with_rpath.pc` but forgot to update the Ruby helpers to
use that file. (My testing did not flag this because my initial plan
was to change `ddprof_ffi.pc` directly to add the rpath flags, and
the rename came late in the branch.)

I will include a matching change on the dd-trace-rb side.

* Package libddprof 0.5.0.rc1, including arm64 (aarch64) binaries

* Exclude libddprof debug info from packaged gems

* Simplify files_for helper

* Actually push built arm64 gem

* Change fallback package with no platform to contain all binaries

See comment in `Rakefile` for details on this decision.

* Update Cargo.lock for 0.5.0-rc.1
  • Loading branch information
ivoanjo authored and r1viollet committed May 5, 2022
commit 2bbd55c5c96d4e26c41b92128ce8846f66133a68
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 26 additions & 12 deletions ruby/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@ RSpec::Core::RakeTask.new(:spec)

LIB_GITHUB_RELEASES = {
# This should match the version in the version.rb file
"0.3.0" => [
"0.5.0" => [
{
file: "libddprof-aarch64-alpine-linux-musl.tar.gz",
sha256: "121857f371fed5252654e6eebcb214c6d3a5b089c7e3340e41ab2089df0b9a25",
ruby_platform: "aarch64-linux-musl"
},
{
file: "libddprof-aarch64-unknown-linux-gnu.tar.gz",
sha256: "ab4cd1fc9bc3975775bd2ff2122ac0b475533d504965b931d377cca122f7b0b3",
ruby_platform: "aarch64-linux"
},
{
file: "libddprof-x86_64-alpine-linux-musl.tar.gz",
sha256: "854609c1acc86f6653f539b3fe8780ad1e60d8738f85efdb3b1aa0054e75a217",
sha256: "1675e6402973548ca22da0832babe33d0d4ec739ff9979a600677722fd46ff2f",
ruby_platform: "x86_64-linux-musl"
},
{
file: "libddprof-x86_64-unknown-linux-gnu.tar.gz",
sha256: "d9c64567e7ef5f957581dd81892b144b81e1f52fdf5671430c7af0b039b48929",
sha256: "2db92e2ad87005a043e415fd62079af1f1df3642be9bed3ade840c5533a61063",
ruby_platform: "x86_64-linux"
}
]
Expand Down Expand Up @@ -81,12 +91,18 @@ task package: [
gemspec = eval(File.read("libddprof.gemspec"), nil, "libddprof.gemspec") # standard:disable Security/Eval
FileUtils.mkdir_p("pkg")

# Fallback package without binaries
Helpers.package_for(gemspec, ruby_platform: nil, files: [])
# Fallback package with all binaries
# This package will get used by (1) platforms that have no matching `ruby_platform` or (2) that have set
# "BUNDLE_FORCE_RUBY_PLATFORM" (or its equivalent via code) to avoid precompiled gems.
# In a previous version of libddprof, this package had no binaries, but that could mean that we broke customers in case (2).
# For customers in case (1), this package is a no-op, and dd-trace-rb will correctly detect and warn that
# there are no valid binaries for the platform.
Helpers.package_for(gemspec, ruby_platform: nil, files: Helpers.files_for("x86_64-linux", "x86_64-linux-musl", "aarch64-linux", "aarch64-linux-musl"))

# We include both glibc and musl variants in the same binary gem to avoid the issues
# documented in https://github.com/rubygems/rubygems/issues/3174
Helpers.package_for(gemspec, ruby_platform: "x86_64-linux", files: Helpers.files_for("x86_64-linux", "x86_64-linux-musl"))
Helpers.package_for(gemspec, ruby_platform: "aarch64-linux", files: Helpers.files_for("aarch64-linux", "aarch64-linux-musl"))

# Experimental macOS package, not published to rubygems.org at the moment
if ENV["LIBDDPROF_PACKAGE_MACOS"] == "true"
Expand All @@ -103,6 +119,7 @@ task push_to_rubygems: [

system("gem push pkg/libddprof-#{Libddprof::VERSION}.gem")
system("gem push pkg/libddprof-#{Libddprof::VERSION}-x86_64-linux.gem")
system("gem push pkg/libddprof-#{Libddprof::VERSION}-aarch64-linux.gem")

system("gem signout") # leave no credentials behind
end
Expand Down Expand Up @@ -142,16 +159,13 @@ module Helpers
version: Libddprof::LIB_VERSION,
excluded_files: [
"ddprof_ffi.pc", # we use the ddprof_ffi_with_rpath.pc variant
"libddprof_ffi.a", "ddprof_ffi-static.pc" # We don't use the static library
"libddprof_ffi.a", "ddprof_ffi-static.pc", # We don't use the static library
"libddprof_ffi.so.debug", # We don't include debug info
"DDProfConfig.cmake" # We don't compile using cmake
]
)
files = []

excluded_files_from_packaging = [
*excluded_files,
"DDProfConfig.cmake" # We don't compile using cmake
]

each_github_release_variant(version: version) do |ruby_platform:, target_directory:, target_file:, **_|
next unless included_platforms.include?(ruby_platform)

Expand All @@ -161,7 +175,7 @@ module Helpers
Dir.glob("#{target_directory}/**/*")
.select { |path| File.file?(path) }
.reject { |path| path == downloaded_release_tarball }
.reject { |path| excluded_files_from_packaging.include?(File.basename(path)) }
.reject { |path| excluded_files.include?(File.basename(path)) }
end

files
Expand Down
9 changes: 2 additions & 7 deletions ruby/lib/libddprof.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
require_relative "libddprof/version"

module Libddprof
# Does this libddprof release include any binaries?
def self.binaries?
available_binaries.any?
end

# This should only be used for debugging/logging
def self.available_binaries
File.directory?(vendor_directory) ? (Dir.entries(vendor_directory) - [".", ".."]) : []
end

def self.pkgconfig_folder
def self.pkgconfig_folder(pkgconfig_file_name = "ddprof_ffi_with_rpath.pc")
current_platform = Gem::Platform.local.to_s

return unless available_binaries.include?(current_platform)

pkgconfig_file = Dir.glob("#{vendor_directory}/#{current_platform}/**/ddprof_ffi.pc").first
pkgconfig_file = Dir.glob("#{vendor_directory}/#{current_platform}/**/#{pkgconfig_file_name}").first

return unless pkgconfig_file

Expand Down
6 changes: 3 additions & 3 deletions ruby/lib/libddprof/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

module Libddprof
# Current libddprof version
LIB_VERSION = "0.3.0"
LIB_VERSION = "0.5.0"

GEM_MAJOR_VERSION = "2"
GEM_MAJOR_VERSION = "1"
GEM_MINOR_VERSION = "0"
GEM_PRERELEASE_VERSION = ".beta1" # remember to include dot prefix, if needed!
GEM_PRERELEASE_VERSION = "" # remember to include dot prefix, if needed!
private_constant :GEM_MAJOR_VERSION, :GEM_MINOR_VERSION, :GEM_PRERELEASE_VERSION

# The gem version scheme is lib_version.gem_major.gem_minor[.prerelease].
Expand Down
1 change: 1 addition & 0 deletions ruby/libddprof.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
.reject do |f|
[".rspec", ".standard.yml", "Rakefile", "docker-compose.yml", "gems.rb", "README.md"].include?(f)
end
.reject { |f| f.end_with?(".tar.gz") }
end
spec.require_paths = ["lib"]
end
14 changes: 1 addition & 13 deletions ruby/spec/libddprof_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
end

context "when no binaries are available in the vendor directory" do
describe ".binaries?" do
it { expect(Libddprof.binaries?).to be false }
end

describe ".available_binaries" do
it { expect(Libddprof.available_binaries).to be_empty }
end
Expand All @@ -47,10 +43,6 @@
context "when vendor directory does not exist" do
let(:temporary_directory) { "does/not/exist" }

describe ".binaries?" do
it { expect(Libddprof.binaries?).to be false }
end

describe ".available_binaries" do
it { expect(Libddprof.available_binaries).to be_empty }
end
Expand All @@ -66,10 +58,6 @@
Dir.mkdir("#{temporary_directory}/mipsel-linux")
end

describe ".binaries?" do
it { expect(Libddprof.binaries?).to be true }
end

describe ".available_binaries" do
it { expect(Libddprof.available_binaries).to contain_exactly("386-freedos", "mipsel-linux") }
end
Expand All @@ -79,7 +67,7 @@

before do
FileUtils.mkdir_p(pkgconfig_folder)
File.open("#{pkgconfig_folder}/ddprof_ffi.pc", "w") {}
File.open("#{pkgconfig_folder}/ddprof_ffi_with_rpath.pc", "w") {}
end

describe ".pkgconfig_folder" do
Expand Down