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

Small fixes to the iOS build #2965

Merged
merged 2 commits into from
Oct 1, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build-scripts/xc-universal-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]; then
# # In this case, we need to add an extra library search path for build scripts and proc-macros,
# # which run on the host instead of the target.
# # (macOS Big Sur does not have linkable libraries in /usr/lib/.)
local libpath
libpath="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib"
export LIBRARY_PATH="${libpath}:${LIBRARY_PATH:-}"
fi
Expand Down
2 changes: 1 addition & 1 deletion glean-core/ios/Glean/Metrics/ObjectMetric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension Array: ObjectSerialize where Element: Codable {
public func intoSerializedObject() -> String {
let jsonEncoder = JSONEncoder()
let jsonData = try! jsonEncoder.encode(self)
let json = String(decoding: jsonData, as: UTF8.self)
let json = String(data: jsonData, encoding: String.Encoding.utf8)!
return json
}
}
Expand Down
4 changes: 3 additions & 1 deletion glean-core/ios/GleanTests/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func tearDownStubs() {
func JSONStringify(_ json: Any) -> String {
do {
let data = try JSONSerialization.data(withJSONObject: json, options: .prettyPrinted)
return String(decoding: data, as: UTF8.self)
if let string = String(data: data, encoding: String.Encoding.utf8) {
return string
}
} catch {
print(error)
}
Expand Down
Loading