-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Drop FFI pin, plus a bunch of assorted other bits #14911
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
base: main
Are you sure you want to change the base?
Conversation
This requires the fix in Tested this with:
and it builds. |
Looks like there's a lot more sticking us to 1.15
|
rest-client isn't pinned, that inherited the pin from us... so just chef-powershell. |
OK chef/chef-powershell-shim#288 is for chef-powershell. There's no direct dep, but it's pulled in from somewhere. |
0e1a97c
to
40439eb
Compare
5e9e1f0
to
243dc8c
Compare
@tpowell-progress - as discussed in Slack, this needs a release of HOWEVER - any idea why |
edaaa49
to
0a41cc1
Compare
4fc3dff
to
b602254
Compare
On both macOS 13 and 15, for some reason I'm unable to get
|
Looks like the process is trying to update preferences in I wonder why this test attempts to modify this system preference instead of creating a test app. |
I applied this diff: diff --git a/spec/functional/resource/macos_userdefaults_spec.rb b/spec/functional/resource/macos_userdefaults_spec.rb
index 2d3f538cf2..5063f64db8 100644
--- a/spec/functional/resource/macos_userdefaults_spec.rb
+++ b/spec/functional/resource/macos_userdefaults_spec.rb
@@ -58,7 +58,7 @@ describe Chef::Resource::MacosUserDefaults, :macos_only do
context "can process expected data" do
it "set array values" do
- resource.domain "/Library/Preferences/ManagedInstalls"
+ resource.domain "#{ENV['HOME']}/Library/Preferences/com.chef.macos.test.preferences"
resource.key "TestArrayValues"
resource.value [ "/Library/Managed Installs/fake.log", "/Library/Managed Installs/also_fake.log"]
resource.run_action(:write)
@@ -66,7 +66,7 @@ describe Chef::Resource::MacosUserDefaults, :macos_only do
end
it "set dictionary value" do
- resource.domain "/Library/Preferences/ManagedInstalls"
+ resource.domain "#{ENV['HOME']}/Library/Preferences/com.chef.macos.test.preferences"
resource.key "TestDictionaryValues"
resource.value "User": "/Library/Managed Installs/way_fake.log"
resource.run_action(:write)
@@ -74,7 +74,7 @@ describe Chef::Resource::MacosUserDefaults, :macos_only do
end
it "set array of dictionaries" do
- resource.domain "/Library/Preferences/ManagedInstalls"
+ resource.domain "#{ENV['HOME']}/Library/Preferences/com.chef.macos.test.preferences"
resource.key "TestArrayWithDictionary"
resource.value [ { "User": "/Library/Managed Installs/way_fake.log" } ]
resource.run_action(:write)
@@ -82,7 +82,7 @@ describe Chef::Resource::MacosUserDefaults, :macos_only do
end
it "set boolean for preference value" do
- resource.domain "/Library/Preferences/ManagedInstalls"
+ resource.domain "#{ENV['HOME']}/Library/Preferences/com.chef.macos.test.preferences"
resource.key "TestBooleanValue"
resource.value true
resource.run_action(:write)
@@ -106,7 +106,7 @@ describe Chef::Resource::MacosUserDefaults, :macos_only do
end
it "we can delete a preference with full path" do
- resource.domain "/Library/Preferences/ManagedInstalls"
+ resource.domain "#{ENV['HOME']}/Library/Preferences/com.chef.macos.test.preferences"
resource.key "TestKey"
expect { resource.run_action(:delete) }. to_not raise_error
end
@@ -119,7 +119,7 @@ describe Chef::Resource::MacosUserDefaults, :macos_only do
context "resource can process FFI::Pointer type" do
it "for host property" do
- resource.domain "/Library/Preferences/ManagedInstalls"
+ resource.domain "#{ENV['HOME']}/Library/Preferences/com.chef.macos.test.preferences"
resource.key "TestDictionaryValues"
resource.value "User": "/Library/Managed Installs/way_fake.log"
resource.host :current
@@ -128,7 +128,7 @@ describe Chef::Resource::MacosUserDefaults, :macos_only do
end
it "for user property" do
- resource.domain "/Library/Preferences/ManagedInstalls"
+ resource.domain "#{ENV['HOME']}/Library/Preferences/com.chef.macos.test.preferences"
resource.key "TestDictionaryValues"
resource.value "User": "/Library/Managed Installs/way_fake.log"
resource.user :current This worked fine with macOS 13 and 15 with ffi v1.17.1, both precompiled and compiled versions. |
#14937 seems to work locally and in CI. |
* Add msys2 build-dep to windows hab so we can build libffi which is required in ffi 1.17.x * Add some post-bundle-install hacks for appbunder for ffi 1.17.x * Sort words in cspell config after adding 'autoreconf' See ffi/ffi#1139 (comment) for details ``` $ bundle update ffi ohai mixlib-log --conservative Fetching https://github.com/stanhu/mixlib-log.git Fetching https://github.com/jaymzh/ohai.git Fetching gem metadata from https://rubygems.org/....... Resolving dependencies... Resolving dependencies... Using mixlib-log 3.2.2 (was 3.0.9) from https://github.com/stanhu/mixlib-log.git (at sh-relax-ffi@6aff216) Using ohai 19.0.9 (was 19.0.5) from https://github.com/jaymzh/ohai.git (at ffi-ver@1c34928) Bundler attempted to update ffi but its version stayed the same Bundle updated! ``` Signed-off-by: Phil Dibowitz <phil@ipom.com>
|
The seg fault in macOS 13 came up again: https://github.com/chef/chef/actions/runs/14474375159/job/40596279236 I wonder why I can't reproduce that. |
The mac fixes from your PR, but not the segfault. |
Heh. Jinx. Yeah, it's pretty bizarre. I wonder if there's something specific to GH's runners. There's no Mac tests on BK, so no good way to compare. |
Oh, right, #14937 only updates the Chef tests. The actual Kitchen tests still use the There's a possibility that there is a memory access bug here with either I have to wonder if the Kitchen tests used a temporary file as #14937 does whether we'd see the seg fault. macOS 13 reaches EOL in November 2025 in any case, so I wonder if it's easier at this point to drop support for that. |
We can't drop support for an OS nearly a full year before it's EOL date... |
I wonder if we need to build the |
Ok, I was able to reproduce this issue on macOS 13 if I follow the Kitchen steps: brew install coreutils
sudo su
curl https://omnitruck.chef.io/install.sh | bash -s -- -P chef -c current
export PATH="/opt/chef/bin:/opt/chef/embedded/bin:$PATH"
<clone this branch>
cd chef
bundle install
gem install ohai
/opt/chef/embedded/bin/ruby /opt/chef/embedded/bin/rake install:local
gem uninstall ffi --platform x86-darwin Then I ran require 'chef'
events = Chef::EventDispatch::Dispatcher.new
node = Chef::Node.new
run_context = Chef::RunContext.new(node, {}, events)
r = Chef::Resource::MacosUserDefaults.new("Value with space", run_context).tap do |r|
r.value = [ "/Library/Managed Installs/fake.log", "/Library/Managed Installs/also_fake.log", "hello"]
r.key = "test-test"
end
r.run_action(:write)
r.get_preference(r) On macOS 13, the seg fault doesn't happen if I use the precompiled gem install ffi --platform ruby -- --disable-system-libffi --enable-libffi-alloc I wonder if we can avoid the |
Calling @tpowell-progress on updating libffi in the omnibus build for macos. |
Strangely I can't reproduce the macOS 13 failure this morning on a new VM. |
which is required in ffi 1.17.x
See ffi/ffi#1139 (comment)
for details
Signed-off-by: Phil Dibowitz phil@ipom.com