libddprof 0.2.0.beta1 → 0.2.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7d6f24e3511e2560edb611e06fae670921fcbcda86eeaf4475b6432c17d395a
4
- data.tar.gz: 270084987103083b79fb0ad99bd15b64bfa44351460e0b43ce504ea7d7e94890
3
+ metadata.gz: ab2d397b008650be1995c56f28fcf085e355fa4609c91669027f592715c04419
4
+ data.tar.gz: 11eb276ac1dc89cbf9d4e11fa618104f0307016a5010463ece61454a2cdac565
5
5
  SHA512:
6
- metadata.gz: 89aa189f92a623a51785c098e4358f97ec8b955e22dc0c008afb6eaf9388cce6559acc9390986252da1fab23058ee47803a15d078b00c68b872dd07bd7253483
7
- data.tar.gz: d8309cfec327b55f159c13a76e8ff32b18040720a545e6496270472145db54a089506183d362264a07cdc211d31f53ed3af630896411bb5d95d2df22a7fcc058
6
+ metadata.gz: 8b4a4aa558f57d4b4ebf9002e93619e076b81b0bfed62eb149faf0d10c39c20bdde5b13e53218558a9213c8f4ca6928d45fa7a9683581e0a13386f64528e0c68
7
+ data.tar.gz: 0f4ec30dcf6401f5e55e7297162a17c36ab83ec47f70f91a8c55ce6414b80ad021f04f8d0434b277c6dc6f3dc0c5124977b8dc1e78910dc7c7a64e80e634415a
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # libddprof Ruby gem
2
+
3
+ `libddprof` provides a shared library containing common code used in the implementation of Datadog's
4
+ [Continuous Profilers](https://docs.datadoghq.com/tracing/profiler/).
5
+
6
+ **NOTE**: If you're building a new profiler or want to contribute to Datadog's existing profilers, you've come to the
7
+ right place!
8
+ Otherwise, this is possibly not the droid you were looking for.
9
+
10
+ ## Development
11
+
12
+ Run `bundle exec rake` to run the tests and the style autofixer.
13
+ You can also run `bundle exec pry` for an interactive prompt that will allow you to experiment.
14
+
15
+ ## Releasing a new version to rubygems.org
16
+
17
+ Note: No Ruby needed to run this! It all runs inside docker :)
18
+
19
+ 1. [ ] Locate the new libddprof release on GitHub: <https://github.com/DataDog/libddprof/releases>
20
+ 2. [ ] Update the `LIB_GITHUB_RELEASES` section of the <Rakefile> with the new version
21
+ 3. [ ] Update the <lib/libddprof/version.rb> file with the `LIB_VERSION` and `VERSION` to use
22
+ 4. [ ] Commit change, open PR, get it merged
23
+ 5. [ ] Release by running `docker-compose run push_to_rubygems`.
24
+ (When asked for rubygems credentials, check your local friendly 1Password.)
25
+ 6. [ ] Verify that release shows up correctly on: <https://rubygems.org/gems/libddprof>
26
+
27
+ ## Contributing
28
+
29
+ See <../CONTRIBUTING.md>.
data/Rakefile CHANGED
@@ -71,7 +71,7 @@ task extract: [:fetch] do
71
71
  end
72
72
 
73
73
  desc "Package lib downloaded releases as gems"
74
- task package: [:extract] do
74
+ task package: [:spec, :'standard:fix', :extract] do
75
75
  gemspec = eval(File.read("libddprof.gemspec"), nil, "libddprof.gemspec") # standard:disable Security/Eval
76
76
  FileUtils.mkdir_p("pkg")
77
77
 
@@ -80,16 +80,25 @@ task package: [:extract] do
80
80
  end
81
81
 
82
82
  desc "Release all packaged gems"
83
- task package: [
83
+ task push_to_rubygems: [
84
84
  :package,
85
- :'release:guard_clean',
85
+ :'release:guard_clean'
86
86
  ] do
87
+ system("gem signout") # make sure there are no existing credentials in use
87
88
 
89
+ system("gem push pkg/libddprof-#{Libddprof::VERSION}.gem")
90
+ system("gem push pkg/libddprof-#{Libddprof::VERSION}-x86_64-linux.gem")
91
+
92
+ system("gem signout") # leave no credentials behind
88
93
  end
89
94
 
90
95
  module Helpers
91
96
  def self.each_github_release_variant(version: Libddprof::LIB_VERSION)
92
- LIB_GITHUB_RELEASES.fetch(version).each do |file:, sha256:, ruby_platform:|
97
+ LIB_GITHUB_RELEASES.fetch(version).each do |variant|
98
+ file = variant.fetch(:file)
99
+ sha256 = variant.fetch(:sha256)
100
+ ruby_platform = variant.fetch(:ruby_platform)
101
+
93
102
  # These two are so common that we just centralize them here
94
103
  target_directory = "vendor/libddprof-#{version}/#{ruby_platform}"
95
104
  target_file = "#{target_directory}/#{file}"
@@ -103,7 +112,7 @@ module Helpers
103
112
  def self.package_without_binaries(gemspec)
104
113
  target_gemspec = gemspec.dup
105
114
 
106
- puts "Building a variant without binaries including: (this can take a while)"
115
+ puts "Building a variant without binaries including:"
107
116
  pp target_gemspec.files
108
117
 
109
118
  package = Gem::Package.build(target_gemspec)
@@ -118,7 +127,7 @@ module Helpers
118
127
  target_gemspec.files += files_for("x86_64-linux", "x86_64-linux-musl")
119
128
  target_gemspec.platform = "x86_64-linux"
120
129
 
121
- puts "Building for x86_64-linux including:"
130
+ puts "Building for x86_64-linux including: (this can take a while)"
122
131
  pp target_gemspec.files
123
132
 
124
133
  package = Gem::Package.build(target_gemspec)
@@ -0,0 +1,14 @@
1
+ version: '3.2'
2
+ services:
3
+ push_to_rubygems:
4
+ image: ruby:3.1
5
+ platform: linux/x86_64
6
+ stdin_open: true
7
+ tty: true
8
+ command: bash -c 'cd /libddprof/ruby && bundle install && bundle exec rake push_to_rubygems'
9
+ volumes:
10
+ - ..:/libddprof
11
+ - bundle-3.1:/usr/local/bundle
12
+
13
+ volumes:
14
+ bundle-3.1:
data/gems.rb CHANGED
@@ -10,3 +10,4 @@ gem "rspec", "~> 3.10"
10
10
  gem "standard", "~> 1.3" unless RUBY_VERSION < "2.5"
11
11
  gem "http", "~> 5.0"
12
12
  gem "pry"
13
+ gem "pry-byebug"
@@ -5,5 +5,5 @@ module Libddprof
5
5
  LIB_VERSION = "0.2.0"
6
6
 
7
7
  # This is the Ruby gem version -- often it will match LIB_VERSION, but sometimes it may not
8
- VERSION = "#{LIB_VERSION}.beta1"
8
+ VERSION = "#{LIB_VERSION}.beta2"
9
9
  end
data/lib/libddprof.rb CHANGED
@@ -9,7 +9,7 @@ module Libddprof
9
9
  end
10
10
 
11
11
  def self.available_binaries
12
- Dir.children(vendor_directory)
12
+ File.directory?(vendor_directory) ? Dir.children(vendor_directory) : []
13
13
  end
14
14
 
15
15
  def self.pkgconfig_folder
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libddprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta1
4
+ version: 0.2.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-01 00:00:00.000000000 Z
11
+ date: 2022-02-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: libddprof contains implementation bits used by Datadog's ddtrace gem
14
14
  as part of its Continuous Profiler feature.
@@ -20,11 +20,12 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - ".rspec"
22
22
  - ".standard.yml"
23
+ - README.md
23
24
  - Rakefile
25
+ - docker-compose.yml
24
26
  - gems.rb
25
27
  - lib/libddprof.rb
26
28
  - lib/libddprof/version.rb
27
- - libddprof.gemspec
28
29
  homepage: https://docs.datadoghq.com/tracing/profiler/
29
30
  licenses:
30
31
  - Apache-2.0
@@ -33,7 +34,7 @@ metadata:
33
34
  homepage_uri: https://docs.datadoghq.com/tracing/profiler/
34
35
  source_code_uri: https://github.com/DataDog/libddprof/tree/main/ruby
35
36
  rubygems_mfa_required: 'true'
36
- post_install_message:
37
+ post_install_message:
37
38
  rdoc_options: []
38
39
  require_paths:
39
40
  - lib
@@ -48,8 +49,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
49
  - !ruby/object:Gem::Version
49
50
  version: 1.3.1
50
51
  requirements: []
51
- rubygems_version: 3.1.6
52
- signing_key:
52
+ rubygems_version: 3.3.3
53
+ signing_key:
53
54
  specification_version: 4
54
55
  summary: Library of common code used by Datadog Continuous Profiler for Ruby
55
56
  test_files: []
data/libddprof.gemspec DELETED
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path("../lib", __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "libddprof/version"
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "libddprof"
9
- spec.version = Libddprof::VERSION
10
- spec.authors = ["Datadog, Inc."]
11
- spec.email = ["dev@datadoghq.com"]
12
-
13
- spec.summary = "Library of common code used by Datadog Continuous Profiler for Ruby"
14
- spec.description =
15
- "libddprof contains implementation bits used by Datadog's ddtrace gem as part of its Continuous Profiler feature."
16
- spec.homepage = "https://docs.datadoghq.com/tracing/profiler/"
17
- spec.license = "Apache-2.0"
18
- spec.required_ruby_version = ">= 2.1.0"
19
-
20
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
-
22
- spec.metadata["homepage_uri"] = spec.homepage
23
- spec.metadata["source_code_uri"] = "https://github.com/DataDog/libddprof/tree/main/ruby"
24
-
25
- # Require releases on rubygems.org to be coming from multi-factor-auth-authenticated accounts
26
- spec.metadata["rubygems_mfa_required"] = "true"
27
-
28
- # Specify which files should be added to the gem when it is released.
29
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
31
- `git ls-files -z`.split("\x0").reject do |f|
32
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
33
- end
34
- end
35
- spec.require_paths = ["lib"]
36
- end