Skip to content

Commit a451fc7

Browse files
committed
[swift_snapshot_tool] Add a README.
1 parent 4cc9752 commit a451fc7

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

utils/swift_snapshot_tool/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
# Swift Snapshot Tool
3+
4+
Used to list and bisect nightly snapshots off of swift.org.
5+
6+
# Examples
7+
8+
## List snapshots
9+
10+
```
11+
# xcrun swift run swift_snapshot_tool list
12+
[INFO] Starting to download snapshot information from github.
13+
[INFO] Finished downloading snapshot information from github.
14+
0 swift-DEVELOPMENT-SNAPSHOT-2024-09-06-a
15+
1 swift-DEVELOPMENT-SNAPSHOT-2024-09-05-a
16+
2 swift-DEVELOPMENT-SNAPSHOT-2024-09-04-a
17+
3 swift-DEVELOPMENT-SNAPSHOT-2024-08-29-a
18+
...
19+
```
20+
21+
The number to the left is just the number back through historical time that the
22+
value is at. This allows for one to get a sense of the range of time in between
23+
two bisect numbers since one can look at the range in between them and how time
24+
varies.
25+
26+
## Bisect
27+
28+
```
29+
xcrun swift run swift_snapshot_tool bisect --script $SCRIPT_NAME --workspace $DIR_TO_DOWNLOAD_TOOLCHAINS \
30+
--good-tag $OLDER_TAG_NAME_THAT_PASSES --bad-tag $NEWER_TAG_NAME_THAT_FAILS
31+
```
32+
33+
bisect success is defined by `$SCRIPT_NAME` returning 0 as an exit code. All
34+
other exit codes are considered a failure.
35+
36+
Options:
37+
38+
- workspace: This is the place where we will download toolchains to. Defaults to
39+
`/tmp/swift_snapshot_tool_workspace_v1`
40+
41+
- script: This is the script that should be run. We pass in the environment
42+
variables `SWIFT_EXEC` and `SWIFT_FRONTEND` to the subscript. If the script
43+
returns a zero exit code then the run is considered a succeess. If the script
44+
returns a non-zero exit code, then the run is considered a failure.
45+
46+
- good_tag: This is the older tag and is assumed to succeed by returning a zero
47+
exit code.
48+
49+
- bad_tag: This is the newer tag and is assumed to fail by returning a non-zero
50+
exit code.
51+
52+
- invert: This causes test.sh's result to be inverted. This allows one to bisect
53+
backwards from a good state to a bad state. This is useful to determine when
54+
an error was fixed.
55+
56+
- branch: This controls the specific branch of snapshots that are downloaded. By
57+
default uses development. Also supports the options 5.0 and 6.0.

0 commit comments

Comments
 (0)