target / lorri

Your project's nix-env
Apache License 2.0
992 stars 69 forks source link

logging: build failure output does not put newlines #369

Open Profpatsch opened 4 years ago

Profpatsch commented 4 years ago

When we switched the log output to a one-line format, we also lost the multi-line output of logfiles.

The error messages we print therefore regressed to an unreadable mess:

Apr 06 16:55:20.423 INFO build status, message: BuildEvent(Failure { nix_file: Shell("/home/philip/kot/bazel/rules_haskell/shell.nix"), failure: Exit { cmd: "\"nix-build\" \"--out-link\" \"/tmp/.tmpRKySkl/result\" \"--\" \"/tmp/.tmpJau2Pc/result\"", status: Some(100), logs: [LogLine("these derivations will be built:"), LogLine(" /nix/store/max9slk160agbqnj00la2kx2gcdhm1dz-lorri-wrapped-project-nix-shell.drv"), LogLine("building \'/nix/store/max9slk160agbqnj00la2kx2gcdhm1dz-lorri-wrapped-project-nix-shell.drv\'..."), LogLine("[!] It looks like you are using a linux nix-based system. In order to build this project, you need to add the two following host_platform entries to your .bazelrc.local file."), LogLine(""), LogLine("build --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs"), LogLine("run --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs"), LogLine("/nix/store/p4agjpqk9gsackarch57ssw6mbh34hpk-bazel-2.0.0/share/bash-completion/completions/bazel: line 503: complete: command not found"), LogLine("builder for \'/nix/store/max9slk160agbqnj00la2kx2gcdhm1dz-lorri-wrapped-project-nix-shell.drv\' failed with exit code 127"), LogLine("error: build of \'/nix/store/max9slk160agbqnj00la2kx2gcdhm1dz-lorri-wrapped-project-nix-shell.drv\' failed")] } })

As long as we don’t have a better way for users to display build output, we should assume they are reading the daemon log and want to be able to read the error messages.

deliciouslytyped commented 4 years ago

Yes.