Skip to content
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

Fix: resolve deadlock in LatestOsVersion#version_for_os #20329

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions snapshot/lib/snapshot/latest_os_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ def self.version(os)
def self.version_for_os(os)
# We do all this, because we would get all kind of crap output generated by xcodebuild
# so we need to ignore stderror
output = ''
Open3.popen3('xcodebuild -version -sdk') do |stdin, stdout, stderr, wait_thr|
output = stdout.read
end
stdout, _stderr, _status = Open3.capture3('xcodebuild -version -sdk')

matched = output.match(/#{os} ([\d\.]+) \(.*/)
matched = stdout.match(/#{os} ([\d\.]+) \(.*/)
if matched.nil?
FastlaneCore::UI.user_error!("Could not determine installed #{os} SDK version. Try running the _xcodebuild_ command manually to ensure it works.")
elsif matched.length > 1
Expand Down