on master help sign in
Merge pull request #6411 from commercialhaskell/commenter-setup-help
2ec6a53Adam Bergmark
CURATORS.md+12−16
@@ -422,20 +422,16 @@ errors for builds, tests and benchmarks.
422
422
423### Large scale enabling/disabling of packages
423### Large scale enabling/disabling of packages
424
424
425−`etc/commenter` is a binary that mostly automates the translation of
425+`etc/commenter` is a binary that automates `build-constraints.yaml` workflows.
426−`./check` errors into lines that go into `build-constraints.yaml`. It
427−can only handle bounds issues, compilation issues still need to be
428−handled manually.
429−
430−It disables all offending packages/test suites/benchmarks, so it is
431−only meant to be used when we close bounds issues and want to disable
432−packages, and when upgrading GHC.
433
426
434#### Setup
427#### Setup
435This is currently a rust program, You can install the rust toolchain
428This is currently a rust program, You can install the rust toolchain
436by using [rustup](https://rustup.rs/).
429by using [rustup](https://rustup.rs/).
437
430
431+For some commands you also need etc/commenter/latest-version installed.
432+```
438−Then `cargo install --locked --path etc/commenter`
433+stack install --stack-yaml etc/commenter/latest-version/stack.yaml
434+```
439
435
440#### Example usage
436#### Example usage
441
437
@@ -456,7 +452,7 @@ testing-feat (GHC 9 bounds issues, Grandfathered dependencies) (not present) dep
456
452
457Now run:
453Now run:
458```
454```
459−./check 2>&1 >/dev/null | commenter add
455+./check 2>&1 >/dev/null | ./commenter add
460```
456```
461
457
462You will get this output:
458You will get this output:
@@ -483,8 +479,8 @@ Re-run this command until no more packages are disabled.
483We can periodically remove all packages under the bounds sections and then re-run the disabling flow above until we get a clean plan. This will automatically pick up packages that have been fixed.
479We can periodically remove all packages under the bounds sections and then re-run the disabling flow above until we get a clean plan. This will automatically pick up packages that have been fixed.
484
480
485```
481```
486−commenter clear
482+./commenter clear
487−./check 2>&1 >/dev/null | commenter add
483+./check 2>&1 >/dev/null | ./commenter add
488```
484```
489
485
490Repeat the second command until no updates are made to build-constraints.yaml.
486Repeat the second command until no updates are made to build-constraints.yaml.
@@ -493,7 +489,7 @@ Repeat the second command until no updates are made to build-constraints.yaml.
493
489
494Run `stack update` before doing this.
490Run `stack update` before doing this.
495
491
496−`commenter outdated` looks through all bounds issues and library
492+`./commenter outdated` looks through all bounds issues and library
497compilation failures and compares the marked version with the latest hackage release. Example output is
493compilation failures and compares the marked version with the latest hackage release. Example output is
498
494
499```
495```
@@ -504,7 +500,7 @@ aeson mismatch, auto: 1.5.6.0, hackage: 2.0.2.0
504where "manual" means the bound was added manually by a curator,
500where "manual" means the bound was added manually by a curator,
505perhaps due to a compilation failure so we could try re-enabling the
501perhaps due to a compilation failure so we could try re-enabling the
506package. "auto" means it's part of the sections generated by
502package. "auto" means it's part of the sections generated by
507−`commenter`, to update that run the `Re-enabling` step as documented
503+`./commenter`, to update that run the `Re-enabling` step as documented
508above.
504above.
509
505
510`outdated` only finds packages that are in the auto generated
506`outdated` only finds packages that are in the auto generated
@@ -520,7 +516,7 @@ To diff existing snapshots, or to evaluate changes before they end up
520in a snapshot you can run:
516in a snapshot you can run:
521
517
522```
518```
523−commenter diff-snapshot <old-snapshot.yaml> <new-snapshot.yaml>
519+./commenter diff-snapshot <old-snapshot.yaml> <new-snapshot.yaml>
524```
520```
525
521
526Existing snapshots can be retrieved from https://github.com/commercialhaskell/stackage-snapshots. Preliminary snapshots can be generated by running relevant parts of `automated/build.sh`, at the time of writing:
522Existing snapshots can be retrieved from https://github.com/commercialhaskell/stackage-snapshots. Preliminary snapshots can be generated by running relevant parts of `automated/build.sh`, at the time of writing:
@@ -535,7 +531,7 @@ TARGET=nightly-2021-01-14 \ # the date doesn't matter
535
531
536#### Finding disabled packages with lots of dependents
532#### Finding disabled packages with lots of dependents
537
533
538−`commenter disabled` prints the number of transitive dependents a disabled package has. Low hanging fruit to get a lot of packages included again.
534+`./commenter disabled` prints the number of transitive dependents a disabled package has. Low hanging fruit to get a lot of packages included again.
539
535
540Example output:
536Example output:
541```
537```
commenternew file+20
@@ -0,0 +1,20 @@
1+#!/usr/bin/env bash
2+
3+if ! command -v cargo
4+then
5+ echo "Rust doesn't seem to be installed. https://rustup.rs/"
6+ exit 1
7+fi
8+
9+if [ "$1" = "outdated" ];
10+then
11+ if ! command -v latest-version &> /dev/null
12+ then
13+ echo "This command requires latest-version in your PATH"
14+ echo "Install it with: "
15+ echo "stack install --stack-yaml etc/commenter/latest-version/stack.yaml"
16+ exit 1
17+ fi
18+fi
19+
20+cargo run -q --release --manifest-path etc/commenter/Cargo.toml $@
etc/commenter/src/lib.rs+1−1
@@ -164,7 +164,7 @@ fn latest_version(packages: impl Iterator<Item = Package>) -> BTreeMap<Package,
164 Command::new("latest-version")
164 Command::new("latest-version")
165 .args(packages.map(|p| p.0))
165 .args(packages.map(|p| p.0))
166 .output()
166 .output()
167− .unwrap()
167+ .expect("Could not find latest-version in PATH")
168 .stdout,
168 .stdout,
169 )
169 )
170 .unwrap()
170 .unwrap()