Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--print-build-logs|-L ignores empty lines #11991

Open
2 tasks done
ysndr opened this issue Nov 29, 2024 · 1 comment
Open
2 tasks done

--print-build-logs|-L ignores empty lines #11991

ysndr opened this issue Nov 29, 2024 · 1 comment
Labels
bug derivation-build The process of building an individual derivation (see also sandbox label) good first issue Quick win for first-time contributors

Comments

@ysndr
Copy link
Member

ysndr commented Nov 29, 2024

Describe the bug

Empty lines printed by the builder of a derivation are not echo'ed to the build log,
despite being present in the build log of the derivation.

Steps To Reproduce

A minimal derivation that supposedly prints 5 lines.

# repro.nix

let buildscript = builtins.toFile "build.sh" ''
	#!/bin/sh
	echo "start"
	echo
	echo
	echo
	echo "end"
	: > $out
'';
in
builtins.derivation {
	name = "repro";
	builder = "/bin/sh";
	args = [ buildscript ];
	outputs = [ "out" ];
	system = builtins.currentSystem;
}

Build with nix

$ nix build -f ./repro.nix -L [--rebuild]
$ nix log -f ./repro.nix | cat

Expected behavior

Output should be the same for both commands and contain newlines

$ nix build -f ./repro.nix -L [--rebuild]
repro> start
repro>
repro>
repro>
repro> end
$nix log -f ./repro.nix | cat
start



end

Actual behavior

The build logs do not contain new-lines

$ nix build -f ./repro.nix -L [--rebuild]
repro> start
repro> end
$ nix log -f ./repro.nix | cat
start



end

Metadata

nix-env (Nix) 2.24.10

Checklist


Add 👍 to issues you find important.

@ysndr ysndr added the bug label Nov 29, 2024
@roberth roberth added the derivation-build The process of building an individual derivation (see also sandbox label) label Nov 29, 2024
@roberth roberth added this to Nix team Nov 29, 2024
@github-project-automation github-project-automation bot moved this to To triage in Nix team Nov 29, 2024
@roberth roberth added the good first issue Quick win for first-time contributors label Dec 4, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-12-04-nix-team-meeting-minutes-200/57005/1

@edolstra edolstra removed this from Nix team Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug derivation-build The process of building an individual derivation (see also sandbox label) good first issue Quick win for first-time contributors
Projects
None yet
Development

No branches or pull requests

3 participants