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

Hide xcodebuild stderr to solve #21672 #21673

Merged
merged 1 commit into from Nov 29, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions fastlane_core/lib/fastlane_core/project.rb
Expand Up @@ -418,6 +418,8 @@ def build_settings(key: nil, optional: true)

command = build_xcodebuild_showbuildsettings_command

command = "#{command} 2>&1" # xcodebuild produces errors on stderr #21672

# Xcode might hang here and retrying fixes the problem, see fastlane#4059
begin
timeout = FastlaneCore::Project.xcode_build_settings_timeout
Expand Down
4 changes: 2 additions & 2 deletions fastlane_core/spec/project_spec.rb
Expand Up @@ -346,7 +346,7 @@ def within_a_temp_dir
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("11.0").and_return(false)
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("13").and_return(false)
expect(FastlaneCore::Helper).to receive(:xcode_at_least?).with("8.3").and_return(true)
command = "xcodebuild -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj"
command = "xcodebuild -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj 2>&1"
expect(FastlaneCore::Project).to receive(:run_command).with(command.to_s, { timeout: 3, retries: 3, print: true }).and_return(File.read("./fastlane_core/spec/fixtures/projects/build_settings_with_toolchains"))
expect(@project.build_settings(key: "SUPPORTED_PLATFORMS")).to eq("iphonesimulator iphoneos")
end
Expand All @@ -357,7 +357,7 @@ def within_a_temp_dir
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("11.0").and_return(false)
allow(FastlaneCore::Helper).to receive(:xcode_at_least?).with("13").and_return(false)
expect(FastlaneCore::Helper).to receive(:xcode_at_least?).with("8.3").and_return(false)
command = "xcodebuild clean -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj"
command = "xcodebuild clean -showBuildSettings -project ./fastlane_core/spec/fixtures/projects/Example.xcodeproj 2>&1"
expect(FastlaneCore::Project).to receive(:run_command).with(command.to_s, { timeout: 3, retries: 3, print: true }).and_return(File.read("./fastlane_core/spec/fixtures/projects/build_settings_with_toolchains"))
expect(@project.build_settings(key: "SUPPORTED_PLATFORMS")).to eq("iphonesimulator iphoneos")
end
Expand Down