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

Scoped logs for Nix builds #3117

Open
matthew-piziak opened this issue Oct 4, 2019 · 4 comments
Open

Scoped logs for Nix builds #3117

matthew-piziak opened this issue Oct 4, 2019 · 4 comments
Labels

Comments

@matthew-piziak
Copy link

When I run nixos-rebuild switch , sometimes I get a lot of logs. It is not obvious which derivations these come from.

…
checking for struct ifreq.ifr_addr.sa_len... no         << what's happening now?
checking whether gcc understands -MMD -MF... yes
stripping FHS paths in `./certs/Makefile'...                  
stripping FHS paths in `./crypto/async_tx/Makefile'...  << driver dependencies maybe??
stripping FHS paths in `./crypto/Makefile'...
stripping FHS paths in `./crypto/asymmetric_keys/Makefile'... 
…

When a job fails it's usually possible to figure out which package is responsible, but it's much harder to figure out why a particular build is taking so long. It's also hard to debug a build when logs from multiple jobs are interleaved.

Something like this on the other hand…

[emacs-speed-type-20190526.953.drv] unpacking sources
[emacs-speed-type-20190526.953.drv] source root is source
[nvidia-x11-435.21-4.19.76.drv    ] checking whether gcc understands -MMD -MF... yes
[nvidia-x11-435.21-4.19.76.drv    ] stripping FHS paths in `./crypto/Makefile'...
[emacs-speed-type-20190526.953.drv] patching sources
[emacs-speed-type-20190526.953.drv] configuring
[emacs-speed-type-20190526.953.drv] no configure script, doing nothing
[emacs-speed-type-20190526.953.drv] building
[emacs-speed-type-20190526.953.drv] installing

…would be more comfortable.

@arcnmx
Copy link
Member

arcnmx commented Oct 4, 2019

As of nix 2.3 nix build -L already has this feature, so adding this to nix-build seems reasonable? Also NixOS/nixpkgs#45919 (closed but using nix build would get you scoped logs with nixpkgs today) and/or NixOS/nixpkgs#54188 may be relevant.

bonus round (don't actually do this?):

nix run -I nixos-config=/etc/nixos/configuration.nix -Lf '<nixpkgs/nixos>' system -c switch-to-configuration switch

@zimbatm
Copy link
Member

zimbatm commented Oct 6, 2019

#3073 also makes the -L option available to nix-build

@stale
Copy link

stale bot commented Feb 18, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 18, 2021
@stale
Copy link

stale bot commented Apr 29, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed Apr 29, 2022
@thufschmitt thufschmitt reopened this Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants