You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the default stackage json endpoint fails, fallback to trying
the <snapshot>/cabal.config endpoint. The latter seems more reliable.
This also allows us to easily add a --snapshot-path CLI arg, giving
users the ability to pass in a snapshot file manually.
Copy file name to clipboardExpand all lines: README.md
+32-5Lines changed: 32 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,23 +61,50 @@ The procedure is as follows:
61
61
62
62
### The clc-stackage exe
63
63
64
-
Previously, this project was just a single (massive) cabal file that had to be manually updated. Usage was fairly simple: `cabal build clc-stackage --keep-going` to build the project, `--keep-going` so that as many packages as possible are built.
64
+
`clc-stackage` is an executable that will:
65
65
66
-
This has been updated so that `clc-stackage` is now an executable that will automatically generate the desired cabal file based on the results of querying stackage directly. This streamlines updates, provides a more flexible build process, and potentially has prettier output (with `--batch` arg):
66
+
1. Download the stackage snapshot from the stackage server.
67
+
2. Divide the snapshot into groups (determined by `--batch` argument).
68
+
3. For each group, generate a cabal file and attempt to build it.
67
69
68
-

70
+
#### Querying stackage
69
71
70
-
In particular, the `clc-stackage` exe allows for splitting the entire package set into subset groups of size `N` with the `--batch N` option. Each group is then built sequentially. Not only can this be useful for situations where building the entire package set in one go is infeasible, but it also provides a "cache" functionality, that allows us to interrupt the program at any point (e.g. `CTRL-C`), and pick up where we left off. For example:
72
+
By default, `clc-stackage` queries https://www.stackage.org/ for snapshot information. In situations where this is not desirable (e.g. the server is not working, or we want to test a custom snapshot), the snapshot can be overridden:
This snapshot should be formatted similar to the `cabal.config` endpoint on the stackage server (e.g. https://www.stackage.org/nightly/cabal.config). That is, package lines should be formatted `<pkgs> ==<vers>`:
79
+
80
+
```
81
+
abstract-deque ==0.3
82
+
abstract-deque-tests ==0.3
83
+
abstract-par ==0.3.3
84
+
AC-Angle ==1.0
85
+
acc ==0.2.0.3
86
+
...
87
+
```
88
+
89
+
The stackage config itself is valid, so trailing commas and other extraneous lines are allowed (and ignored).
90
+
91
+
#### Investigating failures
92
+
93
+
By default (`--write-logs save-failures`), the build logs are saved to the `./output/logs/` directory, with `./output/logs/current-build/` streaming the current build logs.
94
+
95
+
#### Group batching
96
+
97
+
The `clc-stackage` exe allows for splitting the entire package set into subset groups of size `N` with the `--batch N` option. Each group is then built sequentially. Not only can this be useful for situations where building the entire package set in one go is infeasible, but it also provides a "cache" functionality, that allows us to interrupt the program at any point (e.g. `CTRL-C`), and pick up where we left off. For example:
98
+
99
+
```sh
73
100
$ ./bin/clc-stackage --batch 100
74
101
```
75
102
76
103
This will split the entire downloaded package set into groups of size 100. Each time a group finishes (success or failure), stdout/err will be updated, and then the next group will start. If the group failed to build and we have `--write-logs save-failures` (the default), then the logs and error output will be in `./output/logs/<pkg>/`, where `<pkg>` is the name of the first package in the group.
77
104
78
105
See `./bin/clc-stackage --help` for more info.
79
106
80
-
#### Optimal performance
107
+
#####Optimal performance
81
108
82
109
On the one hand, splitting the entire package set into `--batch` groups makes the output easier to understand and offers a nice workflow for interrupting/restarting the build. On the other hand, there is a question of what the best value of `N` is for `--batch N`, with respect to performance.
0 commit comments