runtime_analysis 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/runtime_analysis/recording/blob.rb +5 -1
- data/lib/runtime_analysis/recording/run_manifest.rb +8 -5
- data/lib/runtime_analysis/recording/source_blob.rb +2 -2
- data/lib/runtime_analysis/recording.rb +1 -1
- data/lib/runtime_analysis/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 012254c21b3c3e0e794e1854dac060caa2b1171fa6ef3744607f5305467210d9
|
|
4
|
+
data.tar.gz: 87b07a6a764d385707d969e73616442f3f3d7506b025424c570114c8276c8693
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cfa168052ff7f753f3c2e4acb5f756f004ef24108005dd7270fe4ffa393fb80a804003743b4d5049d32aea7d92d2079269ea5b4a30484cd56366eef7277b3213
|
|
7
|
+
data.tar.gz: 4aaa15fda0ac8699946588b9a22989612c7e5798d598dcbe819e49d5cda2d559d32d3ff976344560fa2b6c4ed3261974a91f5a4a40df73b3559578613790f23d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [1.0.1] - 2026-12-06
|
|
2
|
+
|
|
3
|
+
- Pin a run's files with the hash its repository uses. A run records each file it wrapped a method in by its git blob id, and the tools read an older version of a file back from git by that id. The id was always SHA-1, so in a repository that hashes with SHA-256 git found none of them and every older version read as never stored. The recorder now hashes as the run's repository does, which the length of the run's commit id says, and with no commit it is SHA-1 as before. A recording made before this compares as it did
|
|
4
|
+
- Pass the specs on Ruby 3.2 and 3.3. The JSON report's spec compared text, and the json those Rubies ship lays out an empty array across lines. The gem's output was right; the spec now checks what the JSON says and how it is indented
|
|
5
|
+
|
|
1
6
|
## [1.0.0] - 2026-11-28
|
|
2
7
|
|
|
3
8
|
- Install on JRuby and TruffleRuby. `gem install` ran the extension's build on every Ruby, and on JRuby it failed there with mkmf's "Could not create Makefile". The build now does nothing on a Ruby that is not CRuby, which records with `config.mechanism = :pure` as before. RubyGems still runs `make` there, so the machine needs one. `ra` and `RUNTIME_ANALYSIS_ROOT` no longer ask for the C wrapper when `RUNTIME_ANALYSIS_MECHANISM` is unset, so they record on those Rubies too, and asking for the extension where there is none says to use `:pure` instead of to build it
|
|
@@ -7,7 +7,11 @@ module RuntimeAnalysis
|
|
|
7
7
|
module Blob
|
|
8
8
|
module_function
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
SHA256_ID_LENGTH = 64
|
|
11
|
+
|
|
12
|
+
def id(content, like: nil) = algorithm_of(like).hexdigest("blob #{content.bytesize}\0#{content}")
|
|
13
|
+
|
|
14
|
+
def algorithm_of(repository_id) = repository_id.to_s.length == SHA256_ID_LENGTH ? Digest::SHA256 : Digest::SHA1
|
|
11
15
|
end
|
|
12
16
|
end
|
|
13
17
|
end
|
|
@@ -50,7 +50,7 @@ module RuntimeAnalysis
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def pin(config, files, pid: Process.pid)
|
|
53
|
-
|
|
53
|
+
change(config, pid) { |said| { "sources" => blobs(files, said["git_sha"]) } }
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def seen(config, tally, pid: Process.pid, now: Time.now)
|
|
@@ -61,9 +61,12 @@ module RuntimeAnalysis
|
|
|
61
61
|
add(config, pid, "never_wrapped" => { "count" => methods.size, "methods" => methods.first(LISTED) })
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
def add(config, pid, fields)
|
|
64
|
+
def add(config, pid, fields) = change(config, pid) { fields }
|
|
65
|
+
|
|
66
|
+
def change(config, pid)
|
|
65
67
|
file = path(config.recording_dir, pid)
|
|
66
|
-
|
|
68
|
+
said = said(config, file, pid)
|
|
69
|
+
replace(file, JSON.generate(said.merge(yield(said))))
|
|
67
70
|
rescue SystemCallError, Errors.unreadable_json
|
|
68
71
|
nil
|
|
69
72
|
end
|
|
@@ -79,8 +82,8 @@ module RuntimeAnalysis
|
|
|
79
82
|
File.rename("#{file}.new", file)
|
|
80
83
|
end
|
|
81
84
|
|
|
82
|
-
def blobs(files)
|
|
83
|
-
files.filter_map { |source| (blob = SourceBlob.of(source)) && [source, blob] }
|
|
85
|
+
def blobs(files, commit)
|
|
86
|
+
files.filter_map { |source| (blob = SourceBlob.of(source, like: commit)) && [source, blob] }
|
|
84
87
|
end
|
|
85
88
|
|
|
86
89
|
def run(**fields) = Run.new(**fields)
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: runtime_analysis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Runtime Analysis
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: prism
|