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

nix/why-depends: fix output of --precise #8786

Merged
merged 1 commit into from
Aug 7, 2023

Commits on Aug 4, 2023

  1. nix/why-depends: fix output of --precise

    I haven't checked when this was exactly introduced, but on Nix 2.16 I
    realized that the additional lines inserted when using `--precise` are
    completely separated from the tree:
    
        nix why-depends /nix/store/ccgr4faaxys39s091qridxg1947lggh4-evcxr-0.14.2 /nix/store/b7hvml0m3qmqraz1022fwvyyg6fc1vdy-gcc-12.2.0 --precise --extra-experimental-features nix-command
        /nix/store/ccgr4faaxys39s091qridxg1947lggh4-evcxr-0.14.2
            → /nix/store/lcf37pgp3rgww67v9x2990hbfwx96c1w-gcc-wrapper-12.2.0
                → /nix/store/b7hvml0m3qmqraz1022fwvyyg6fc1vdy-gcc-12.2.0
        └───bin/evcxr: …':'}.PATH=${PATH/':''/nix/store/lcf37pgp3rgww67v9x2990hbfwx96c1w-gcc-wrapper-12.2.0/bin'':'/':'}…
            └───bin/cpp: …k disable=SC2193.[[ "/nix/store/b7hvml0m3qmqraz1022fwvyyg6fc1vdy-gcc-12.2.0/bin/cpp" = *++ ]] &&…
    
    This is apparently because `std::cout` is buffered and flushed in the
    end whereas the rest of the output isn't. The fix is rather simple, just
    use `logger->cout` as it's already the case for the rest of the code.
    
    This way we also don't need to insert additional newlines in the `hits`
    map since that's something the logger takes care of.
    
    Also added a small test to make sure that the layout of this is somehow
    tested to reduce the risk of further regressions here.
    Ma27 committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    7c09104 View commit details
    Browse the repository at this point in the history