Poor UX without build output
Closed this issue · 4 comments
The --no-build-output flag was introduced in 8966357. Was there a good reason for this to be introduced?
In my case, the underlying command is taking a long time time to return (looks like I'm compiling GHC, maybe because of an old pinned nixpkgs). Without build output, it appears that stack2nix just hangs, and I had no way of knowing why or what it's doing without going through the code. I would at least expect to see this output when the --verbose flag is used.
Is it enough to revert this commit? Or do you want a PR that enables build output for this command only when the --verbose flag is used?
I think this needs better logging as per relevant #102
Do you have a plan? I'd be happy to help where possible. Would reverting 8966357 be a good-enough-for-now change, so users at least don't get stuck with no hint why stack2nix is hanging?
The plan is to communicate what stack2nix is doing, but preserve build output unless --verbose is given.
I had intended to have a go at fixing this, but running the tests fails on my machine (MacOS). Here's the last bit of output:
copying path '/nix/store/5wzyjnwj3ykknsv4kri5ydybhm8rbhyj-neat-interpolation-0.3.2.2' from 'https://cache.nixos.org'...
copying path '/nix/store/hiyp100hdgcyib50npjjj0vppq4klmcr-persistent-template-2.5.4' from 'https://cache.nixos.org'...
copying path '/nix/store/xpchqw2s7yavjzqshznxagvkyi3c9gaq-persistent-sqlite-2.8.1.2' from 'https://cache.nixos.org'...
building '/nix/store/f9zl1hy3nianij0vfrzc186l66cgap5y-stack-1.7.1.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/ss5vcirhscngmq6fxzpb70r2w8mj1ssa-ghc-8.4.3.
ignoring (possibly broken) abi-depends field for packages
ignoring (possibly broken) abi-depends field for packages
unpacking sources
unpacking source archive /nix/store/0xr8nd9ga0c1na3mw2jkr6wmq8rjgkwy-stack-1.7.1.tar.gz
source root is stack-1.7.1
setting SOURCE_DATE_EPOCH to timestamp 1524865969 of file stack-1.7.1/stack.cabal
patching sources
Replace Cabal file with edited version from http://hackage.haskell.org/package/stack-1.7.1/revision/8.cabal.
Run jailbreak-cabal to lift version restrictions on build inputs.
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/tmp/nix-build-stack-1.7.1.drv-0/setup-package.conf.d -j1 -threaded
[1 of 1] Compiling Main ( Setup.hs, /private/tmp/nix-build-stack-1.7.1.drv-0/Main.o )
Linking Setup ...
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/nix/store/d69jsf9vhvb10acqh7xiz4rhjig5n3zm-clang-wrapper-5.0.2/bin/cc: line 183: /nix/store/mz3ll8v5rx9v0yjjjcfyazr706qpjp4d-clang-5.0.2/bin/clang: Argument list too long
`cc' failed in phase `Linker'. (Exit code: 126)
builder for '/nix/store/f9zl1hy3nianij0vfrzc186l66cgap5y-stack-1.7.1.drv' failed with exit code 1
error: build of '/nix/store/f9zl1hy3nianij0vfrzc186l66cgap5y-stack-1.7.1.drv' failed
++ STACK=/bin