maralorn / nix-output-monitor

Pipe your nix-build output through the nix-output-monitor a.k.a nom to get additional information while building.
GNU Affero General Public License v3.0
895 stars 27 forks source link

Output is bad in gitlab-ci #147

Open kjeremy opened 2 months ago

kjeremy commented 2 months ago

I'm trying to integrate this into my CI pipeline on gitlab and am getting output like the following:

$ nix --version nix (Nix) 2.18.5 $ nix store ping --store $OUR_NIX_STORE Store URL: unix:///mnt/nix/var/nix/daemon-socket/socket Version: 2.18.4 Trusted: 1 $ nix profile list warning: the group 'nixbld' specified in 'build-users-group' does not exist $ nom build -L $NIX_REMOTE_OPTS "$MRAK_TEST_PKG" warning: the group 'nixbld' specified in 'build-users-group' does not exist ⏱ 0s⏱ 1s⏱ 2s⏱ 3s⏱ 4s⏱ 4swarning: ignoring untrusted flake configuration setting 'extra-substituters'. Pass '--accept-flake-config' to trust it ⏱ 4s⏱ 4s⏱ 4s⏱ 4s⏱ 4s⏱ 4s⏱ 4s⏱ 4s⏱ 5scopying path '/nix/store/16ik5rfzbjbl2kxpagqx5rp03hkd32qp-source' from 'https://cache.nixos.org'/ ┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 5s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 6s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 7s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 8s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 9s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 10s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 11s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 12s┏━━━ Downloads
┗━ ∑ ↓ 1 │ ↓ 0 │ ⏸ 0 │ ⏱ 13s┏━━━ Downloads │ Host
┃ │ │ │ localhost
┃ │ ↓ 1 │ │ https://cache.nixos.org/ ┗━ ∑ ↓ 0 │ ↓ 1 │ ⏸ 0 │ ⏱ 13s ┏━━━ Downloads │ Host
┃ │ │ │ localhost
┃ │ ↓ 1 │ │ https://cache.nixos.org/ ┗━ ∑ ↓ 0 │ ↓ 1 │ ⏸ 0 │ ⏱ 13s ┏━━━ Downloads │ Host

I tried setting TERM as in https://docs.gitlab.com/ee/ci/yaml/script.html#job-log-output-is-not-formatted-as-expected-or-contains-unexpected-characters but it doesn't seem to make a difference.

maralorn commented 2 months ago

Yeah, that is to be expected.

The purpose of nom is to print a live status report below the log. I am not aware that this is possible in something like gitlab ci. (because there are afaict no control codes available to remove previous lines.)

Am I wrong in thinking this is not possible or do you have some other ideas how nom should behave?