pyroscope 0.1.1 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,51 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pyroscope Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-28 00:00:00.000000000 Z
11
+ date: 2022-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake-compiler
14
+ name: ffi
43
15
  requirement: !ruby/object:Gem::Requirement
44
16
  requirements:
45
17
  - - ">="
46
18
  - !ruby/object:Gem::Version
47
19
  version: '0'
48
- type: :development
20
+ type: :runtime
49
21
  prerelease: false
50
22
  version_requirements: !ruby/object:Gem::Requirement
51
23
  requirements:
@@ -53,7 +25,7 @@ dependencies:
53
25
  - !ruby/object:Gem::Version
54
26
  version: '0'
55
27
  - !ruby/object:Gem::Dependency
56
- name: rubygems-tasks
28
+ name: bundler
57
29
  requirement: !ruby/object:Gem::Requirement
58
30
  requirements:
59
31
  - - ">="
@@ -67,64 +39,77 @@ dependencies:
67
39
  - !ruby/object:Gem::Version
68
40
  version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
- name: rspec
42
+ name: rake
71
43
  requirement: !ruby/object:Gem::Requirement
72
44
  requirements:
73
- - - ">="
45
+ - - "~>"
74
46
  - !ruby/object:Gem::Version
75
- version: '0'
47
+ version: '13.0'
76
48
  type: :development
77
49
  prerelease: false
78
50
  version_requirements: !ruby/object:Gem::Requirement
79
51
  requirements:
80
- - - ">="
52
+ - - "~>"
81
53
  - !ruby/object:Gem::Version
82
- version: '0'
83
- description: pyroscope client integration for ruby
84
- email: contact@pyroscope.io
54
+ version: '13.0'
55
+ description: Pyroscope FFI Integration for Ruby
56
+ email:
57
+ - contact@pyroscope.io
85
58
  executables: []
86
59
  extensions:
87
- - ext/pyroscope/extconf.rb
60
+ - ext/rbspy/extconf.rb
61
+ - ext/thread_id/extconf.rb
88
62
  extra_rdoc_files: []
89
63
  files:
90
- - ".gitignore"
91
- - Gemfile
92
- - Gemfile.lock
64
+ - LICENSE
93
65
  - README.md
94
- - Rakefile
95
- - ext/pyroscope/Makefile.example
96
- - ext/pyroscope/extconf.rb
97
- - ext/pyroscope/lib/.gitkeep
98
- - ext/pyroscope/lib/libpyroscope.rbspy.a
99
- - ext/pyroscope/lib/libpyroscope.rbspy.combo.a
100
- - ext/pyroscope/lib/librustdeps.a
101
- - ext/pyroscope/pyroscope.c
66
+ - elflib/rbspy/manylinux.sh
67
+ - elflib/rbspy/pyproject.toml
68
+ - elflib/rbspy/rbspy/__init__.py
69
+ - elflib/rbspy/setup.cfg
70
+ - elflib/rbspy/setup.py
71
+ - elflib/thread_id/manylinux.sh
72
+ - elflib/thread_id/pyproject.toml
73
+ - elflib/thread_id/setup.cfg
74
+ - elflib/thread_id/setup.py
75
+ - elflib/thread_id/thread_id/__init__.py
76
+ - ext/rbspy/Cargo.toml
77
+ - ext/rbspy/Rakefile
78
+ - ext/rbspy/build.rs
79
+ - ext/rbspy/cbindgen.toml
80
+ - ext/rbspy/extconf.rb
81
+ - ext/rbspy/src/lib.rs
82
+ - ext/thread_id/Cargo.toml
83
+ - ext/thread_id/Rakefile
84
+ - ext/thread_id/build.rs
85
+ - ext/thread_id/cbindgen.toml
86
+ - ext/thread_id/extconf.rb
87
+ - ext/thread_id/src/lib.rs
102
88
  - lib/pyroscope.rb
103
89
  - lib/pyroscope/version.rb
104
90
  - pyroscope.gemspec
105
- - test.rb
106
- homepage: http://rubygems.org/gems/pyroscope
91
+ - scripts/docker.sh
92
+ homepage: https://pyroscope.io
107
93
  licenses:
108
94
  - Apache-2.0
109
95
  metadata: {}
110
- post_install_message:
96
+ post_install_message:
111
97
  rdoc_options: []
112
98
  require_paths:
113
99
  - lib
114
- - ext/pyroscope
115
100
  required_ruby_version: !ruby/object:Gem::Requirement
116
101
  requirements:
117
102
  - - ">="
118
103
  - !ruby/object:Gem::Version
119
- version: '0'
104
+ version: 2.5.9
120
105
  required_rubygems_version: !ruby/object:Gem::Requirement
121
106
  requirements:
122
107
  - - ">="
123
108
  - !ruby/object:Gem::Version
124
109
  version: '0'
125
110
  requirements: []
126
- rubygems_version: 3.2.22
127
- signing_key:
111
+ rubygems_version: 3.3.7
112
+ signing_key:
128
113
  specification_version: 4
129
- summary: pyroscope
114
+ summary: Pyroscope
130
115
  test_files: []
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- *.gem
2
- .DS_Store
3
- lib/pyroscope_c.bundle
4
- /build
5
- /pkg
6
- /ext/pyroscope/lib/*.a
7
- /ext/pyroscope/lib/*.bundle
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in wrap_c_example.gemspec
4
- gemspec
data/Gemfile.lock DELETED
@@ -1,48 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- pyroscope (0.0.10)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.4.4)
10
- io-console (0.5.9)
11
- irb (1.3.6)
12
- reline (>= 0.2.5)
13
- rake (13.0.4)
14
- rake-compiler (1.1.1)
15
- rake
16
- reline (0.2.6)
17
- io-console (~> 0.5)
18
- rspec (3.10.0)
19
- rspec-core (~> 3.10.0)
20
- rspec-expectations (~> 3.10.0)
21
- rspec-mocks (~> 3.10.0)
22
- rspec-core (3.10.1)
23
- rspec-support (~> 3.10.0)
24
- rspec-expectations (3.10.1)
25
- diff-lcs (>= 1.2.0, < 2.0)
26
- rspec-support (~> 3.10.0)
27
- rspec-mocks (3.10.2)
28
- diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.10.0)
30
- rspec-support (3.10.2)
31
- rubygems-tasks (0.2.5)
32
- irb (~> 1.0)
33
-
34
- PLATFORMS
35
- arm64-darwin-20
36
- x86_64-darwin-20
37
- x86_64-linux
38
-
39
- DEPENDENCIES
40
- bundler
41
- pyroscope!
42
- rake
43
- rake-compiler
44
- rspec
45
- rubygems-tasks
46
-
47
- BUNDLED WITH
48
- 2.2.15
data/Rakefile DELETED
@@ -1,56 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rubygems/package_task"
3
- require "rake/extensiontask"
4
- require "rake/testtask"
5
- require "rspec/core/rake_task"
6
- require "rake/clean"
7
- require_relative "./lib/pyroscope/version"
8
-
9
- CLEAN.include(
10
- "ext/pyroscope/*.o",
11
- "ext/pyroscope/*.bundle"
12
- )
13
-
14
- CLOBBER.include(
15
- "ext/pyroscope/Makefile",
16
- "pkg"
17
- )
18
-
19
- BUILD_DIR = 'build'
20
-
21
- def gem_spec
22
- @gem_spec ||= Gem::Specification.load('pyroscope.gemspec')
23
- end
24
-
25
- Gem::PackageTask.new(gem_spec) do |pkg|
26
- pkg.need_zip = true
27
- pkg.need_tar = true
28
- end
29
-
30
- Rake::ExtensionTask.new("pyroscope_c", gem_spec) do |ext|
31
- # ext.name = 'pyroscope'
32
- ext.ext_dir = './ext/pyroscope'
33
- # ext.lib_dir = 'lib/pyroscope'
34
- ext.tmp_dir = BUILD_DIR
35
- ext.config_script = "extconf.rb"
36
- end
37
-
38
- RSpec::Core::RakeTask.new(:spec)
39
-
40
- task :build => [:clean, :compile]
41
-
42
- task :default => [:build, :spec]
43
-
44
- task :test do
45
- sudo = RUBY_PLATFORM =~ /darwin/ ? "sudo -E" : ""
46
- system "rake build && #{sudo} gem install pkg/pyroscope-#{Pyroscope::VERSION}.gem && #{sudo} ruby test.rb"
47
- end
48
-
49
- task :test_exec do
50
- # system "cd ../pyroscope && DOCKER_BUILDKIT=1 docker build -f Dockerfile.static-libs --output type=local,dest=out ." if RUBY_PLATFORM.include?("linux")
51
- system "sudo -E pyroscope exec ruby test.rb"
52
- end
53
-
54
- task :publish do
55
- system "rake build && gem install pkg/pyroscope-#{Pyroscope::VERSION}.gem && gem push pkg/pyroscope-#{Pyroscope::VERSION}.gem"
56
- end
@@ -1,265 +0,0 @@
1
- SHELL = /bin/sh
2
-
3
- # V=0 quiet, V=1 verbose. other values don't work.
4
- V = 1
5
- Q1 = $(V:1=)
6
- Q = $(Q1:0=@)
7
- ECHO1 = $(V:1=@ :)
8
- ECHO = $(ECHO1:0=@ echo)
9
- NULLCMD = :
10
-
11
- #### Start of system configuration section. ####
12
-
13
- srcdir = ../../../../ext/pyroscope
14
- topdir = /usr/include
15
- hdrdir = $(topdir)
16
- arch_hdrdir = /usr/include
17
- PATH_SEPARATOR = :
18
- VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
19
- prefix = $(DESTDIR)/usr
20
- rubysitearchprefix = $(sitearchlibdir)/$(RUBY_BASE_NAME)
21
- rubyarchprefix = $(DESTDIR)/usr/lib64/ruby
22
- rubylibprefix = $(exec_prefix)/share/ruby
23
- exec_prefix = $(DESTDIR)/usr
24
- vendorarchhdrdir = $(vendorhdrdir)/$(arch)
25
- sitearchhdrdir = $(sitehdrdir)/$(arch)
26
- rubyarchhdrdir = $(DESTDIR)/usr/include
27
- vendorhdrdir = $(rubyhdrdir)/vendor_ruby
28
- sitehdrdir = $(rubyhdrdir)/site_ruby
29
- rubyhdrdir = $(DESTDIR)/usr/include
30
- rubygemsdir = $(DESTDIR)/usr/share/rubygems
31
- vendorarchdir = $(DESTDIR)/usr/lib64/ruby/vendor_ruby
32
- vendorlibdir = $(vendordir)
33
- vendordir = $(DESTDIR)/usr/share/ruby/vendor_ruby
34
- sitearchdir = $(DESTDIR)/usr/local/lib64/ruby/site_ruby
35
- sitelibdir = $(sitedir)
36
- sitedir = $(DESTDIR)/usr/local/share/ruby/site_ruby
37
- rubyarchdir = $(rubyarchprefix)
38
- rubylibdir = $(rubylibprefix)
39
- sitearchincludedir = $(includedir)/$(sitearch)
40
- archincludedir = $(includedir)/$(arch)
41
- sitearchlibdir = $(libdir)/$(sitearch)
42
- archlibdir = $(DESTDIR)/usr/lib64
43
- ridir = $(datarootdir)/$(RI_BASE_NAME)
44
- mandir = $(DESTDIR)/usr/share/man
45
- localedir = $(datarootdir)/locale
46
- libdir = $(exec_prefix)/lib64
47
- psdir = $(docdir)
48
- pdfdir = $(docdir)
49
- dvidir = $(docdir)
50
- htmldir = $(docdir)
51
- infodir = $(DESTDIR)/usr/share/info
52
- docdir = $(datarootdir)/doc/$(PACKAGE)
53
- oldincludedir = $(DESTDIR)/usr/include
54
- includedir = $(DESTDIR)/usr/include
55
- localstatedir = $(DESTDIR)/var
56
- sharedstatedir = $(DESTDIR)/var/lib
57
- sysconfdir = $(DESTDIR)/etc
58
- datadir = $(DESTDIR)/usr/share
59
- datarootdir = $(prefix)/share
60
- libexecdir = $(DESTDIR)/usr/libexec
61
- sbindir = $(DESTDIR)/usr/sbin
62
- bindir = $(exec_prefix)/bin
63
- archdir = $(rubyarchdir)
64
-
65
-
66
- CC_WRAPPER =
67
- CC = gcc
68
- CXX = g++
69
- LIBRUBY = $(LIBRUBY_SO)
70
- LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
71
- LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
72
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static $(MAINLIBS)
73
- empty =
74
- OUTFLAG = -o $(empty)
75
- COUTFLAG = -o $(empty)
76
- CSRCFLAG = $(empty)
77
-
78
- RUBY_EXTCONF_H =
79
- cflags = $(optflags) $(debugflags) $(warnflags)
80
- cxxflags =
81
- optflags = -O3
82
- debugflags = -ggdb3
83
- warnflags = -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable
84
- cppflags =
85
- CCDLFLAGS = -fPIC
86
- CFLAGS = $(CCDLFLAGS) -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC $(ARCH_FLAG)
87
- INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
88
- DEFS =
89
- CPPFLAGS = -I/usr/include $(DEFS) $(cppflags)
90
- CXXFLAGS = $(CCDLFLAGS) -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic $(ARCH_FLAG)
91
- ldflags = -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -rdynamic -Wl,-export-dynamic
92
- dldflags = -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
93
- ARCH_FLAG = -m64
94
- DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
95
- LDSHARED = $(CC) -shared
96
- LDSHAREDXX = $(CXX) -shared
97
- AR = gcc-ar
98
- EXEEXT =
99
-
100
- RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
101
- RUBY_SO_NAME = ruby
102
- RUBYW_INSTALL_NAME =
103
- RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version_dir_name)
104
- RUBYW_BASE_NAME = rubyw
105
- RUBY_BASE_NAME = ruby
106
-
107
- arch = x86_64-linux
108
- sitearch = $(arch)
109
- ruby_version = 3.0.0
110
- ruby = $(bindir)/$(RUBY_BASE_NAME)
111
- RUBY = $(ruby)
112
- ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
113
-
114
- RM = rm -f
115
- RM_RF = $(RUBY) -run -e rm -- -rf
116
- RMDIRS = rmdir --ignore-fail-on-non-empty -p
117
- MAKEDIRS = /usr/bin/mkdir -p
118
- INSTALL = /usr/bin/install -c
119
- INSTALL_PROG = $(INSTALL) -m 0755
120
- INSTALL_DATA = $(INSTALL) -m 644
121
- COPY = cp
122
- TOUCH = exit >
123
-
124
- #### End of system configuration section. ####
125
-
126
- preload =
127
- libpath = . $(archlibdir) /usr/lib64 /home/dmitry/pyroscope-ruby/ext/pyroscope/lib
128
- LIBPATH = -L. -L$(archlibdir) -L/usr/lib64 -L/home/dmitry/pyroscope-ruby/ext/pyroscope/lib
129
- DEFFILE =
130
-
131
- CLEANFILES = mkmf.log
132
- DISTCLEANFILES =
133
- DISTCLEANDIRS =
134
-
135
- extout =
136
- extout_prefix =
137
- target_prefix =
138
- LOCAL_LIBS = -lpyroscope.rbspy -lrustdeps
139
- LIBS = $(LIBRUBYARG_SHARED) -lm -lc
140
- ORIG_SRCS = pyroscope.c
141
- SRCS = $(ORIG_SRCS)
142
- OBJS = pyroscope.o
143
- HDRS =
144
- LOCAL_HDRS =
145
- TARGET = pyroscope_c
146
- TARGET_NAME = pyroscope_c
147
- TARGET_ENTRY = Init_$(TARGET_NAME)
148
- DLLIB = $(TARGET).so
149
- EXTSTATIC =
150
- STATIC_LIB =
151
-
152
- TIMESTAMP_DIR = .
153
- BINDIR = $(bindir)
154
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
155
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
156
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
157
- HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
158
- ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
159
- TARGET_SO_DIR =
160
- TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
161
- CLEANLIBS = $(TARGET_SO)
162
- CLEANOBJS = *.o *.bak
163
-
164
- all: $(DLLIB)
165
- static: $(STATIC_LIB)
166
- .PHONY: all install static install-so install-rb
167
- .PHONY: clean clean-so clean-static clean-rb
168
-
169
- clean-static::
170
- clean-rb-default::
171
- clean-rb::
172
- clean-so::
173
- clean: clean-so clean-static clean-rb-default clean-rb
174
- -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
175
-
176
- distclean-rb-default::
177
- distclean-rb::
178
- distclean-so::
179
- distclean-static::
180
- distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
181
- -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
182
- -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
183
- -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
184
-
185
- realclean: distclean
186
- install: install-so install-rb
187
-
188
- install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
189
- $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
190
- clean-static::
191
- -$(Q)$(RM) $(STATIC_LIB)
192
- install-rb: pre-install-rb do-install-rb install-rb-default
193
- install-rb-default: pre-install-rb-default do-install-rb-default
194
- pre-install-rb: Makefile
195
- pre-install-rb-default: Makefile
196
- do-install-rb:
197
- do-install-rb-default:
198
- pre-install-rb-default:
199
- @$(NULLCMD)
200
- $(TIMESTAMP_DIR)/.sitearchdir.time:
201
- $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
202
- $(Q) $(TOUCH) $@
203
-
204
- site-install: site-install-so site-install-rb
205
- site-install-so: install-so
206
- site-install-rb: install-rb
207
-
208
- .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
209
-
210
- .cc.o:
211
- $(ECHO) compiling $(<)
212
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
213
-
214
- .cc.S:
215
- $(ECHO) translating $(<)
216
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
217
-
218
- .mm.o:
219
- $(ECHO) compiling $(<)
220
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
221
-
222
- .mm.S:
223
- $(ECHO) translating $(<)
224
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
225
-
226
- .cxx.o:
227
- $(ECHO) compiling $(<)
228
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
229
-
230
- .cxx.S:
231
- $(ECHO) translating $(<)
232
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
233
-
234
- .cpp.o:
235
- $(ECHO) compiling $(<)
236
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
237
-
238
- .cpp.S:
239
- $(ECHO) translating $(<)
240
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
241
-
242
- .c.o:
243
- $(ECHO) compiling $(<)
244
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
245
-
246
- .c.S:
247
- $(ECHO) translating $(<)
248
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
249
-
250
- .m.o:
251
- $(ECHO) compiling $(<)
252
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
253
-
254
- .m.S:
255
- $(ECHO) translating $(<)
256
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
257
-
258
- $(TARGET_SO): $(OBJS) Makefile
259
- $(ECHO) linking shared-object $(DLLIB)
260
- -$(Q)$(RM) $(@)
261
- $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
262
-
263
-
264
-
265
- $(OBJS): $(HDRS) $(ruby_headers)
@@ -1,79 +0,0 @@
1
- require "mkmf"
2
-
3
- require 'net/http'
4
-
5
- LIBDIR = RbConfig::CONFIG['libdir']
6
- INCLUDEDIR = RbConfig::CONFIG['includedir']
7
-
8
- HEADER_DIRS = [INCLUDEDIR]
9
-
10
- LIB_DIRS = [LIBDIR, File.expand_path(File.join(File.dirname(__FILE__), "lib"))]
11
-
12
- COMMIT = "df45c48"
13
-
14
- # TODO: this is not very accurate, but it works for now
15
- OS = RUBY_PLATFORM.include?("darwin") ? "mac" : "linux"
16
- ARCH = RUBY_PLATFORM.include?("arm64") ? "arm64" : "amd64"
17
-
18
- PREFIX = "/static-libs/#{COMMIT}/#{OS}-#{ARCH}"
19
-
20
- ROOT = File.expand_path("..", __FILE__)
21
-
22
- def run(str)
23
- system(str) || fail("command failed: #{str}")
24
- end
25
-
26
- if ENV["PYROSCOPE_RUBY_LOCAL"]
27
- puts "PYROSCOPE_RUBY_LOCAL yes"
28
- # TODO: make configurable
29
- pyroscope_path = "#{ENV["HOME"]}/pyroscope"
30
- run("rm -rf #{File.join(ROOT, "build")}")
31
- run("cd #{pyroscope_path} && make build-rust-dependencies-docker")
32
- run("cp #{pyroscope_path}/out/libpyroscope.rbspy.a #{File.join(ROOT, "lib/libpyroscope.rbspy.a")}")
33
- run("cp #{pyroscope_path}/out/librustdeps.a #{File.join(ROOT, "lib/librustdeps.a")}")
34
- else
35
- Net::HTTP.start("dl.pyroscope.io", 443, :use_ssl => true) do |http|
36
- ["libpyroscope.rbspy.a", "librustdeps.a"].each do |name|
37
- url = PREFIX+"/#{name}.gz"
38
- req = Net::HTTP::Get.new(url)
39
- http.request(req) do |resp|
40
- raise "HTTP error: #{resp.code}" unless resp.code == "200"
41
-
42
- r, w = IO.pipe
43
-
44
- t = Thread.new do
45
- zreader = Zlib::GzipReader.new(r)
46
- File.open(File.join(ROOT, "lib/#{name}"), "wb") do |f|
47
- loop do
48
- begin
49
- chunk = zreader.readpartial(32768)
50
- break if chunk.nil?
51
- rescue EOFError
52
- break
53
- end
54
- f.write(chunk)
55
- end
56
- end
57
- end
58
-
59
- resp.read_body do |chunk|
60
- w.write(chunk)
61
- end
62
-
63
- t.join
64
- end
65
- end
66
- end
67
- end
68
-
69
- # this is now done upstream
70
- # system "strip --strip-debug #{File.join(ROOT, "lib/libpyroscope.rbspy.combo.a")}"
71
-
72
- dir_config('pyroscope', HEADER_DIRS, LIB_DIRS)
73
-
74
- libs = ['-lpyroscope.rbspy', '-lrustdeps']
75
- libs.each do |lib|
76
- $LOCAL_LIBS << "#{lib} "
77
- end
78
-
79
- create_makefile('pyroscope_c')
Binary file
Binary file