Skip to content

Commit 2775182

Browse files
authored
Merge pull request #79528 from iThinker/improve-benchmark-readme
Update benchmark README with info on how to ensure benchmarks test locally built stdlib
1 parent 068fd14 commit 2775182

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

benchmark/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ installed libraries instead, enable
119119
This will reflect the performance of the Swift standard library
120120
installed on the device, not the one included in the Swift root.
121121

122+
If a build fails with an error like `cannot find X in scope`, it may be because
123+
default toolchains don't give access to stdlib SPI. Try using a dev toolchain
124+
built locally or a dev snapshot from
125+
[Swift.org](https://www.swift.org/install/).
126+
122127
### build-script using SwiftPM+LLBuild
123128

124129
To build the benchmarks using build-script/swiftpm, one must build both
@@ -148,6 +153,15 @@ swift-source/swift/benchmark$ .build/release/SwiftBench
148153
...
149154
```
150155

156+
### Troubleshooting
157+
158+
* To check what libraries benchmark is linked against, set the
159+
`DYLD_PRINT_SEARCHING` environment variable. E.g.
160+
`export DYLD_PRINT_SEARCHING=1`.
161+
* To force linking with a locally built stdlib, use the `DYLD_LIBRARY_PATH`
162+
environment variable. E.g. `export
163+
DYLD_LIBRARY_PATH=<path_to_build_folder>/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/x86_64`.
164+
151165
## Editing in Xcode
152166

153167
It is now possible to work on swiftpm benchmarks in Xcode! This is done by using

0 commit comments

Comments
 (0)