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-shell refers to nix log, an experimental command #6231

Open
Profpatsch opened this issue Mar 11, 2022 · 4 comments
Open

nix-shell refers to nix log, an experimental command #6231

Profpatsch opened this issue Mar 11, 2022 · 4 comments

Comments

@Profpatsch
Copy link
Member

Describe the bug

When a nix-shell build fails, a message containing a redacted log and “please use nix log appears, but I cannot use nix log without enabling experimental features.

Steps To Reproduce

> nix-shell -E 'with import <nixpkgs> {}; mkShell { buildDepends = [ (hello.overrideAttrs (old: { patchPhase = "false\n" + old.patchPhase or ""; })) ]; }'
this derivation will be built:
  /nix/store/6nb93y5syyb33k3sbjn2ldbqfk3zc1xl-hello-2.12.drv
building '/nix/store/6nb93y5syyb33k3sbjn2ldbqfk3zc1xl-hello-2.12.drv' on 'ssh://nix-builder@build01.possehl-analytics.com'...
copying path '/nix/store/8nqv6kshb3vs5q5bs2k600xpj5bkavkc-hello-2.12.tar.gz' from 'https://cache.nixos.org'...
copying 0 paths...
unpacking sources
unpacking source archive /nix/store/8nqv6kshb3vs5q5bs2k600xpj5bkavkc-hello-2.12.tar.gz
source root is hello-2.12
setting SOURCE_DATE_EPOCH to timestamp 1643655444 of file hello-2.12/ChangeLog
patching sources
error: build of '/nix/store/6nb93y5syyb33k3sbjn2ldbqfk3zc1xl-hello-2.12.drv' on 'ssh://nix-builder@build01.possehl-analytics.com' failed: error: builder for '/nix/store/6nb93y5syyb33k3sbjn2ldbqfk3zc1xl-hello-2.12.drv' failed with exit code 1;
              last 5 log lines:
              > unpacking sources
              > unpacking source archive /nix/store/8nqv6kshb3vs5q5bs2k600xpj5bkavkc-hello-2.12.tar.gz
              > source root is hello-2.12
              > setting SOURCE_DATE_EPOCH to timestamp 1643655444 of file hello-2.12/ChangeLog
              > patching sources
              For full logs, run 'nix log /nix/store/6nb93y5syyb33k3sbjn2ldbqfk3zc1xl-hello-2.12.drv'.
error: builder for '/nix/store/6nb93y5syyb33k3sbjn2ldbqfk3zc1xl-hello-2.12.drv' failed with exit code 1;
       last 6 log lines:
       > copying path '/nix/store/8nqv6kshb3vs5q5bs2k600xpj5bkavkc-hello-2.12.tar.gz' from 'https://cache.nixos.org'...
       > unpacking sources
       > unpacking source archive /nix/store/8nqv6kshb3vs5q5bs2k600xpj5bkavkc-hello-2.12.tar.gz
       > source root is hello-2.12
       > setting SOURCE_DATE_EPOCH to timestamp 1643655444 of file hello-2.12/ChangeLog
       > patching sources
       For full logs, run 'nix log /nix/store/6nb93y5syyb33k3sbjn2ldbqfk3zc1xl-hello-2.12.drv'.

> nix log
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override

Expected behavior

Nix should show the full output or not require nix log, or nix log should not be experimental.

> nix-shell --version
nix-shell (Nix) 2.6.1
@Profpatsch Profpatsch added the bug label Mar 11, 2022
@Profpatsch Profpatsch changed the title nix-shell references nix log, an experimental command nix-shell requires nix log, an experimental command Mar 11, 2022
@sternenseemann
Copy link
Member

It does show the full log, but prints the last lines again with the note to nix log which should be removed.

@Profpatsch
Copy link
Member Author

It maybe does in this example, but it certainly doesn’t in a case where it happens after more than 6 log linse.

@Profpatsch
Copy link
Member Author

Or rather, the logic is even more confused than that:

> nix-shell -E 'with import <nixpkgs> {}; mkShell { buildDepends = [ (hello.overrideAttrs (old: { installPhase = old.installPhase or "" + "\nfalse"; })) ]; }'

<SNIP>

SKIP: tests/greeting-2
PASS: tests/hello-1
PASS: tests/last-1
PASS: tests/operand-1
PASS: tests/traditional-1
============================================================================
Testsuite summary for GNU Hello 2.12.1-6fe9
============================================================================
# TOTAL: 7
# PASS:  6
# SKIP:  1
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[4]: Leaving directory '/build/hello-2.12'
make[3]: Leaving directory '/build/hello-2.12'
make[2]: Leaving directory '/build/hello-2.12'
make[1]: Leaving directory '/build/hello-2.12'
installing
error: build of '/nix/store/zqnlbpp2n9ar9wva56g1jczqf57a2g3k-hello-2.12.drv' on 'ssh://nix-builder@build01.possehl-analytics.com' failed: error: builder for '/nix/store/zqnlbpp2n9ar9wva56g1jczqf57a2g3k-hello-2.12.drv' failed with exit code 1;
              last 10 log lines:
              > # XFAIL: 0
              > # FAIL:  0
              > # XPASS: 0
              > # ERROR: 0
              > ============================================================================
              > make[4]: Leaving directory '/build/hello-2.12'
              > make[3]: Leaving directory '/build/hello-2.12'
              > make[2]: Leaving directory '/build/hello-2.12'
              > make[1]: Leaving directory '/build/hello-2.12'
              > installing
              For full logs, run 'nix log /nix/store/zqnlbpp2n9ar9wva56g1jczqf57a2g3k-hello-2.12.drv'.
error: builder for '/nix/store/zqnlbpp2n9ar9wva56g1jczqf57a2g3k-hello-2.12.drv' failed with exit code 1;
       last 10 log lines:
       > # XFAIL: 0
       > # FAIL:  0
       > # XPASS: 0
       > # ERROR: 0
       > ============================================================================
       > make[4]: Leaving directory '/build/hello-2.12'
       > make[3]: Leaving directory '/build/hello-2.12'
       > make[2]: Leaving directory '/build/hello-2.12'
       > make[1]: Leaving directory '/build/hello-2.12'
       > installing
       For full logs, run 'nix log /nix/store/zqnlbpp2n9ar9wva56g1jczqf57a2g3k-hello-2.12.drv'.

@sternenseemann
Copy link
Member

Yes, that was what I was referring to. The full log is printed as nix-shell does still print the build output as it happens.

@Profpatsch Profpatsch changed the title nix-shell requires nix log, an experimental command nix-shell refers to nix log, an experimental command Mar 11, 2022
@stale stale bot added the stale label Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants