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
stdenv: Provide a way for full set -x
debugging
#29580
stdenv: Provide a way for full set -x
debugging
#29580
Conversation
If you want a less intrusive alternative, you could treat As a sidenote, I wrote a Linux tool that proved very useful to debug and inspect all kinds of build problems called fptrace. It supervises a build process and writes a shell script for each program launched during the build. You can examine what environment variables were set, what command line arguments were passed, and repeat any build step, possibly altering it beforehand. The command will look like You may be aware of this, but @dezgeg wrote the great nix-debug-shell that surpassed my need for |
@orivej I didn't know of either of those. Thanks, they look quite useful! There's still a need to debug the code before any the phases (say with all my changes to |
We could use a set of flags, but seeing that this is a mass-rebuild no matter what, I don't mind changing all the use-sites: it makes things clearer for the reader. |
You may also consider a more generic alternative: to evaluate an arbitrary value in |
I really like your improvements @Ericson2314 - just one request: can we update nixpkgs manual stdenv section to reflect such changes? In this case: https://nixos.org/nixpkgs/manual/#ssec-stdenv-attributes |
2f4dc60
to
b060702
Compare
@domenkozar Did that, and added wrapper script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually built this, but it looks good. Having bash tracing helps many times.
362a42b
to
dbdec88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it
5135d0e
to
0e67094
Compare
[Did a little force-push and force-push dance to get github to pickup that the previous PR this was based off of is now merged. That will make the history easier to read for @edolstra, the only person whose opinion this is blocked on.] |
Why 6? It seems a decently high number, giving us room for more degrees of debugging before the `set -x` sledgehammer without incurring a mass-rebuild.
0e67094
to
0d3d2a0
Compare
@edolstra approved of this on IRC. |
Motivation for this change
I need
set -x
all the time, and have been resorting to fairly ugly hacks to get it. @domenkozar needs it to. Re-purposingNIX_DEBUG
as a "log-level"-style debugger seemed like a pretty non-intrusive way to achieve this.Things done
I won't bother rebuilding the world just for this. But I'll be rebasing my #26805 on top of it.
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)N.B. I often rebase my PRs on top of each other---they either depend or it's easier to chain rebase if the history is already linear-- -and this one landed on #29610. Just look the last 4 commits.
CC @orivej