Skip to content

Commit ebc07c7

Browse files
committed
Update CHANGELOG and README
1 parent 3472594 commit ebc07c7

File tree

3 files changed

+62
-55
lines changed

3 files changed

+62
-55
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Revision history for nix-output-monitor
22

3+
## 1.1.0.0 -- 2022-03-07
4+
* Replace list of running and failed builds with a continually updated dependency graph
5+
* A lot of small convenience improvements e.g. nicer timestamps
6+
* Make input parsing more robust via using streamly. This hopefully fixes #23.
7+
* Symbols: Change a few used symbols and force text representation
8+
39
## 1.0.5.0 -- 2022-03-05
410
* Make the parser for storepath accept more storepaths which actually occur in the wild.
511

README.md

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Pipe your nix-build output through the nix-output-monitor (aka nom) to get addit
66

77
## Status
88

9-
This is an experimental fun project. The purpose of it is to write something fun and useful in Haskell. You are free and very welcome to contribute feedback, issues or PRs, but I do not commit to maintain this project over a long time period.
10-
This program relies on the output of the v1 nix commands (i.e. `nix-build` and not `nix build`) and will hopefully one day be obsolete.
11-
12-
Best case scenario: This could serve as inspiration as to how to improve nix output in the future.
9+
This was an experimental fun project, which proofed to be useful to quite a lot of people.
10+
The purpose of it is to write something fun and useful in Haskell.
11+
You are free and very welcome to contribute feedback, issues or PRs, but I do not commit to maintain this project over a long time period.
12+
This program relies on the output of the v1 nix commands (i.e. `nix-build` and not `nix build`) support for v2 output may come in the future.
1313

1414
## Installing
1515

@@ -41,62 +41,63 @@ To preserve the color of the redirected text you can use the `unbuffer` command
4141
unbuffer nix-build |& nom
4242
```
4343

44-
## Icons / Legend
45-
46-
```Haskell
47-
running = "" -- yellow, running builds
48-
done = "" -- green, completed builds
49-
todo = "" -- blue, planned builds/downloads
50-
down = "" -- green, downloads (running and finished sadly in one number)
51-
up = "" -- green, uploads
52-
warning = "" -- failed build
53-
goal = "🏁" -- the final build of the running command
54-
average = "" -- a moving average over past builds of this derivation
55-
bigsum = "" -- a summary over all packages and hosts
56-
```
44+
## Explanation
45+
46+
### Legend
47+
48+
Nom tries to convey informations via symbols and colors
49+
50+
* ▶, yellow: running builds
51+
* ✔, green: completed builds
52+
* ⏳︎︎︎, blue: planned builds
53+
* ⬇, cyan: downloads often in the form `completed/total`
54+
* ⬆, magenta: uploads
55+
* ⚠, red: failed builds
56+
* ∅: a moving average over past builds of this derivation
57+
* ⏱︎: running time
58+
* ∑: a summary over all packages and hosts
5759

5860
If you can‘t see all icons you maybe need another terminal font.
5961
I recommend any font from `pkgs.nerdfonts` e.g. `"JetBrainsMono Nerd Font"`.
62+
Also different terminals might work differently well. I recommend: `pkgs.foot`.
6063

61-
## Example Run
62-
63-
With some local builds and downloads:
64+
### How to Read the Dependency Graph
6465

65-
[![asciicast](https://asciinema.org/a/HKWeTpFS42muAaJapSvMiSEbn.svg)](https://asciinema.org/a/HKWeTpFS42muAaJapSvMiSEbn)
66+
* nom will sort all builds into a tree.
67+
* Children of a node are direct dependencies.
68+
* nom will try to show you the most relevant part of the dependency tree, roughly aiming to fill a third of your terminal
69+
* No build will be printed twice in the tree, it will only be shown for the lower most dependency.
70+
* Everytime nom decides to not show all direct dependencies of a build (and for root nodes), it will print a `&` and a summary over the build state of all dependencies.
71+
* Use the colors from above to read the summary
6672

67-
With more builds on a remote server:
73+
## Example Runs
6874

69-
[![asciicast](https://asciinema.org/a/1TVTTlogGdmbC1jtwWCPiatb7.svg)](https://asciinema.org/a/1TVTTlogGdmbC1jtwWCPiatb7)
75+
An example remote build:
76+
[![asciicast](https://asciinema.org/a/TASdstyOJm3reqFcKZrekgH65.svg)](https://asciinema.org/a/TASdstyOJm3reqFcKZrekgH65)
7077

71-
## Implementation
78+
An example failing remote build:
79+
[![asciicast](https://asciinema.org/a/TASdstyOJm3reqFcKZrekgH65.svg)](https://asciinema.org/a/TASdstyOJm3reqFcKZrekgH65)
7280

73-
The program consists of three steps in a loop, powered by Haskell lazyness.
81+
An example really large build:
82+
[![asciicast](https://asciinema.org/a/DDdRLAaiL65PsYUS4dvEaFWBm.svg)](https://asciinema.org/a/DDdRLAaiL65PsYUS4dvEaFWBm)
7483

75-
1. parsing (If you have suggestion for improving my parser combinators, I am all ears!)
76-
2. updating state (with IO to look into the the nix store.)
77-
3. printing
84+
## Implementation
7885

79-
Right now it uses three sources of information:
86+
Right now nom uses four sources of information:
8087

8188
1. The parsed nix-build output
8289
2. it checks if build results exist in the nix-store
8390
3. it querys `.drv` files for information about the `out` output path.
84-
4. It caches build times in `~/.cache/nix-output-monitor/build-reports.csv`.
85-
86-
## Caveats
87-
88-
This will fail in unexpected and expected ways.
89-
nix-output-monitor receives most it's information from parsing nix-build output. The parser might be to strict or to loose for use cases I didn‘t think of. Then **the numbers displayed will be off**!
90-
91-
Terminal clearing and reprinting is brittle. It might fail with your terminal or terminal width. But at this point I‘ve invested some effort to make it usable.
92-
This program also makes assumptions like your nix-store is at "/nix/store" or that every derivation has an output at "out".
93-
94-
Luckily I don‘t think this program screws up anything more than your terminal.
91+
4. It caches build times in `$XDG_CACHE_HOME/nix-output-monitor/build-reports.csv`.
9592

96-
## Strengths
93+
## Limitations
9794

98-
The biggest strength of nom are ovbiously the colorful unicode symbols! (If you don‘t agree I accept PRs to making that configurable.)
95+
* This will fail in unexpected and expected ways.
96+
* nix-output-monitor receives most it's information from parsing nix-build output. The parser might be to strict or to loose for use cases I didn‘t think of. Then **the numbers displayed will be off**!
97+
* nix-build does not show info when a download or upload is finished, so we currently cannot differentiate between started and completed downloads.
98+
* remote builds will sometimes be shown as running even when they are actually still waiting for uploads or downloads.
9999

100-
nom ignores any output it doesn‘t recognize and will always print out everything it receives. So you can never loose information (besides coloring of nix output).
100+
* Terminal clearing and reprinting is brittle. It might fail with your terminal or terminal width. But at this point I‘ve invested some effort to make it usable.
101+
* This program also makes assumptions like your nix-store is at "/nix/store" or that every derivation has an output at "out".
101102

102-
nom does not assume that you run exactly one nix-build. If you run e.g. a script running multiple builds it will aggregate the information of all of them.
103+
* Luckily I don‘t think this program screws up anything more than your terminal.

test/golden2.nix

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
with import <nixpkgs> { }; let
22
build5 = pkgs.runCommand "build5" { } ''
3-
sleep 30s
3+
sleep 3s
44
echo "output of build1" > $out
55
'';
66
build6 = pkgs.runCommand "build6" { } ''
7-
sleep 10s
7+
sleep 3s
88
cat ${build5}
99
echo "test" > $out
1010
'';
1111
build7 = pkgs.runCommand "build7" { } ''
12-
sleep 30s
12+
sleep 3s
1313
echo "output of build1" > $out
1414
'';
1515
build8 = pkgs.runCommand "build8" { } ''
16-
sleep 10s
16+
sleep 3s
1717
cat ${build7}
1818
cat ${build4}
1919
echo "test" > $out
2020
'';
2121
build1 = pkgs.runCommand "build1" { } ''
22-
sleep 30s
22+
sleep 3s
2323
cat ${build11}
2424
echo "output of build1" > $out
2525
'';
2626
build2 = pkgs.runCommand "build2" { } ''
27-
sleep 10s
27+
sleep 3s
2828
cat ${build5}
2929
cat ${build1}
3030
echo "test" > $out
3131
'';
3232
build9 = pkgs.runCommand "build9" { } ''
33-
sleep 10s
33+
sleep 3s
3434
cat ${build2}
3535
echo "test" > $out
3636
'';
3737
build3 = pkgs.runCommand "build3" { } ''
3838
cat ${build1}
3939
cat ${build9}
40-
sleep 10s
40+
sleep 3s
4141
cat ${build4}
4242
cat ${build8}
4343
echo "test" > $out
@@ -47,11 +47,11 @@ with import <nixpkgs> { }; let
4747
echo "test" > $out
4848
'';
4949
build10 = pkgs.runCommand "build10" { } ''
50-
sleep 5s
51-
exit 1
50+
sleep 3s
51+
echo "test" > $out
5252
'';
5353
build11 = pkgs.runCommand "build11" { } ''
54-
sleep 1s
54+
sleep 3s
5555
echo "test" > $out
5656
'';
5757
in

0 commit comments

Comments
 (0)