diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a7769ea5..8d1b4f7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ macOS-13, macOS-14 ] + os: [ macOS-14, macOS-15 ] runs-on: ${{matrix.os}} steps: @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ macOS-13, macOS-14 ] + os: [ macOS-14, macOS-15 ] sim: [ tvOS, watchOS ] runs-on: ${{matrix.os}} diff --git a/dinghy-lib/src/android/mod.rs b/dinghy-lib/src/android/mod.rs index 0b7fe398..65a9a1b8 100644 --- a/dinghy-lib/src/android/mod.rs +++ b/dinghy-lib/src/android/mod.rs @@ -214,7 +214,8 @@ fn ndk() -> Result> { fn ndk_version(ndk: &path::Path) -> Result { let sources_prop_file = ndk.join("source.properties"); - let props = fs::read_to_string(&sources_prop_file)?; + let props = fs::read_to_string(&sources_prop_file) + .with_context(|| format!("Reading prop file {sources_prop_file:?}"))?; let revision_line = props .split("\n") .find(|l| l.starts_with("Pkg.Revision")) diff --git a/dinghy-lib/src/apple/device.rs b/dinghy-lib/src/apple/device.rs index 7158ab39..9a8afebc 100644 --- a/dinghy-lib/src/apple/device.rs +++ b/dinghy-lib/src/apple/device.rs @@ -57,7 +57,12 @@ impl IosDevice { } fn is_pre_ios_17(&self) -> Result { - Ok(semver::VersionReq::parse(&self.os)?.comparators.get(0).ok_or_else(|| anyhow!("Invalid iOS version: {}", self.os))?.major < 17) + Ok(semver::VersionReq::parse(&self.os)? + .comparators + .get(0) + .ok_or_else(|| anyhow!("Invalid iOS version: {}", self.os))? + .major + < 17) } fn is_locked(&self) -> Result { @@ -547,7 +552,14 @@ fn launch_app(dev: &AppleSimDevice, app_args: &[&str], _envs: &[&str]) -> Result .to_string_lossy() .into_owned(); let stdout_param = &format!("--stdout={}", stdout); - let mut xcrun_args: Vec<&str> = vec!["simctl", "launch", "-w", stdout_param, &dev.id, "Dinghy"]; + let mut xcrun_args: Vec<&str> = vec![ + "simctl", + "launch", + "--wait-for-debugger", + stdout_param, + &dev.id, + "Dinghy", + ]; xcrun_args.extend(app_args); debug!("Launching app via xcrun using args: {:?}", xcrun_args); let launch_output = process::Command::new("xcrun") @@ -572,7 +584,8 @@ fn launch_app(dev: &AppleSimDevice, app_args: &[&str], _envs: &[&str]) -> Result .arg("-s") .arg(lldb_script_filename) .output()?; - let test_contents = std::fs::read_to_string(stdout)?; + let test_contents = std::fs::read_to_string(&stdout) + .with_context(|| format!("Reading llvm stdout from {stdout}"))?; println!("{}", test_contents); let output: String = String::from_utf8_lossy(&output.stdout).to_string(); diff --git a/dinghy-lib/src/apple/mod.rs b/dinghy-lib/src/apple/mod.rs index 2b5749d8..22359c12 100644 --- a/dinghy-lib/src/apple/mod.rs +++ b/dinghy-lib/src/apple/mod.rs @@ -19,11 +19,13 @@ pub struct SignatureSettings { pub file: String, pub entitlements: String, pub name: String, + #[allow(dead_code)] pub profile: String, } #[derive(Debug, Clone)] pub struct SigningIdentity { + #[allow(dead_code)] pub id: String, pub name: String, pub team: String, @@ -274,7 +276,9 @@ fn devices_from_devicectl(devices: &mut HashMap) -> Result<() if !devicectl.status.success() { bail!("xcrun command failed. Please check that \"xcrun devicectl list devices\" works.\n{devicectl:?}"); } - for device in json::parse(&std::fs::read_to_string(tmpjson)?)?["result"]["devices"].members() { + let txt = std::fs::read_to_string(&tmpjson) + .with_context(|| format!("Reading devicectl json output {tmpjson:?}"))?; + for device in json::parse(&txt)?["result"]["devices"].members() { let Some(udid) = device["hardwareProperties"]["udid"] .as_str() .map(|s| s.to_string()) diff --git a/dinghy-lib/src/config.rs b/dinghy-lib/src/config.rs index 619598eb..5820aaed 100644 --- a/dinghy-lib/src/config.rs +++ b/dinghy-lib/src/config.rs @@ -2,9 +2,8 @@ use itertools::Itertools; use serde::de; use serde::{Deserialize, Serialize}; use std::fmt; -use std::io::Read; use std::result; -use std::{collections, fs, path}; +use std::{collections, path}; use crate::errors::*; @@ -185,10 +184,9 @@ impl Configuration { } fn read_config_file>(file: P) -> Result { - let mut data = String::new(); - let mut fd = fs::File::open(file)?; - fd.read_to_string(&mut data)?; - Ok(::toml::from_str(&data)?) + let file = file.as_ref(); + let data = std::fs::read_to_string(file).with_context(|| format!("Reading {file:?}"))?; + Ok(toml::from_str(&data)?) } pub fn dinghy_config>(dir: P) -> Result {