Skip to content

Commit

Permalink
fix(patch): Provide better feedback when benchmark init hooks fails (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hassila authored Jun 13, 2023
1 parent 874ee0c commit 5bc62b1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Sources/Benchmark/BenchmarkRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,20 @@ public struct BenchmarkRunner: AsyncParsableCommand, BenchmarkRunnerReadWrite {
try await setup()
}
} catch {
try channel.write(.error("Benchmark.setup or local benchmark setup failed: \(error)"))
let description = """
Benchmark.setup or local benchmark setup failed:
\(error)
If it is a filesystem permissioning error or if the benchmark uses networking, you may need
to give permissions or even disable SwiftPM's sandbox environment and run the benchmark using:
swift package --allow-writing-to-package-directory benchmark
or
swift package --disable-sandbox benchmark
"""

try channel.write(.error(description))
return
}

Expand Down

0 comments on commit 5bc62b1

Please sign in to comment.