cel-rs-rb 0.3.0-x86_64-linux → 0.3.1-x86_64-linux
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 +10 -0
- data/README.md +2 -0
- data/lib/cel/3.3/cel.so +0 -0
- data/lib/cel/3.4/cel.so +0 -0
- data/lib/cel/4.0/cel.so +0 -0
- data/lib/cel/version.rb +1 -1
- data/spec/cel_spec.rb +35 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4feebb30b7b45f113543c828e681a23b153d45d0851cb57dabff58b412b0628b
|
|
4
|
+
data.tar.gz: e6ce475c06cc6069a2819c34b12bd21619ef8106c6d4ad4c6011b79a25da442f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f6f2e6f048e3097a1c6f3b263327b2bc46f3b7556ca9dec1fc568de42a1e25cf85751e15936086eb7d3a64f26d79a09711c6dccfde4b20a708d0ab4299718edc
|
|
7
|
+
data.tar.gz: 89ccf70a624d68d072b991707e3b362add14bc1cb1f227a3e31c1cf25854a26ecc65a708937dcf6047e69b41c203e272b49d258faf7f4d2d6e58094220311714
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Keep registered Ruby callback Procs and their captured values alive while their
|
|
8
|
+
`CEL::Context` is reachable. Prevents use-after-free after the caller drops its
|
|
9
|
+
own reference and Ruby runs garbage collection. Callbacks are also pinned during
|
|
10
|
+
compaction, including when collection runs inside a callback.
|
data/README.md
CHANGED
|
@@ -173,6 +173,8 @@ CI also runs the test suite on Ruby 3.3, Ruby 3.4, and Ruby 4.0 through Buildkit
|
|
|
173
173
|
|
|
174
174
|
## Releasing
|
|
175
175
|
|
|
176
|
+
See [CHANGELOG.md](CHANGELOG.md) for release notes. Update it alongside each version bump.
|
|
177
|
+
|
|
176
178
|
Releases publish a generic `ruby` platform gem and **precompiled native gems**
|
|
177
179
|
for six platforms (`x86_64-linux`, `aarch64-linux`, `x86_64-linux-musl`,
|
|
178
180
|
`aarch64-linux-musl`, `arm64-darwin`, `x86_64-darwin`) to
|
data/lib/cel/3.3/cel.so
CHANGED
|
Binary file
|
data/lib/cel/3.4/cel.so
CHANGED
|
Binary file
|
data/lib/cel/4.0/cel.so
CHANGED
|
Binary file
|
data/lib/cel/version.rb
CHANGED
data/spec/cel_spec.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "spec_helper"
|
|
4
4
|
require "time"
|
|
5
|
+
require "open3"
|
|
5
6
|
|
|
6
7
|
RSpec.describe CEL do
|
|
7
8
|
describe ".compile" do
|
|
@@ -99,6 +100,40 @@ RSpec.describe CEL do
|
|
|
99
100
|
expect(CEL.compile("sum(1, 2, 3)").execute(context)).to eq(6)
|
|
100
101
|
end
|
|
101
102
|
|
|
103
|
+
it "keeps registered callbacks alive through garbage collection and compaction" do
|
|
104
|
+
# Isolate native GC failures and discard the registering thread's stack roots.
|
|
105
|
+
output, status = Open3.capture2e(
|
|
106
|
+
RbConfig.ruby, "-I", File.expand_path("../lib", __dir__), "-rcel", "-rweakref", "-e", <<~RUBY
|
|
107
|
+
context, callbacks = Thread.new do
|
|
108
|
+
ctx = CEL::Context.new
|
|
109
|
+
prefix = +"retained:token:"
|
|
110
|
+
decorate = proc { |value| prefix + value }
|
|
111
|
+
collect = proc do
|
|
112
|
+
GC.start
|
|
113
|
+
GC.verify_compaction_references(expand_heap: true, toward: :empty)
|
|
114
|
+
17
|
|
115
|
+
end
|
|
116
|
+
ctx.define_function("decorate", &decorate)
|
|
117
|
+
ctx.define_function("collect", &collect)
|
|
118
|
+
[ctx, [WeakRef.new(decorate), WeakRef.new(collect)]]
|
|
119
|
+
end.value
|
|
120
|
+
|
|
121
|
+
program = CEL.compile("[decorate('ok'), collect(), decorate('again')]")
|
|
122
|
+
3.times do
|
|
123
|
+
GC.start
|
|
124
|
+
GC.verify_compaction_references(expand_heap: true, toward: :empty)
|
|
125
|
+
raise "registered callback was collected" unless callbacks.all?(&:weakref_alive?)
|
|
126
|
+
result = program.execute(context)
|
|
127
|
+
raise "incorrect callback result: \#{result.inspect}" unless result == [
|
|
128
|
+
"retained:token:ok", 17, "retained:token:again"
|
|
129
|
+
]
|
|
130
|
+
end
|
|
131
|
+
RUBY
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
expect(status.success?).to eq(true), output
|
|
135
|
+
end
|
|
136
|
+
|
|
102
137
|
it "passes method receiver as first block arg for method calls" do
|
|
103
138
|
context = CEL::Context.new(true)
|
|
104
139
|
context.define_function("startsWith") { |target, prefix| target.start_with?(prefix) }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cel-rs-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- CEL Ruby Contributors
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -86,6 +86,7 @@ executables: []
|
|
|
86
86
|
extensions: []
|
|
87
87
|
extra_rdoc_files: []
|
|
88
88
|
files:
|
|
89
|
+
- CHANGELOG.md
|
|
89
90
|
- LICENSE
|
|
90
91
|
- README.md
|
|
91
92
|
- lib/cel.rb
|