Content-addressed Nix − call for testers

Shows up as expected, and I already restarted the nix-demon, will try a restart of the box next.

$ nix show-config | grep experimental
experimental-features = nix-command flakes ca-derivations ca-references

I will build a more recent version of nix on that box and try again tomorrow.

  1. That box is slow anyway
  2. I won’t have access for the next ~16h

This is fantastic news. I have been experimenting a bit with this already, but I wasn’t aware that we could already evaluate all of nixpkgs in this fashion. I’m definitely gonna be a weekend “raider of the unknown” :upside_down_face:

3 Likes

Unfortunately fixed-output derivations are currently basically unusable with this:

What Hydra version + patchset is best to use?

As already mentioned, unless nix::DerivationGoal::registerOutputs(): Assertion `newInfo.ca' failed. · Issue #4256 · NixOS/nix · GitHub is fixed, this seems pretty much unusable. We have a CI job that fails just about every single time. So probably this should be marked as a blocker for the feature or something. It had little activity until now.

I’ve tried running this on macos (using flakes). I get a very weird error.

Here is what I did

  • first add the 2 new experimental features, build and switch
    extraOptions = ''
      experimental-features = nix-command flakes ca-derivations ca-references
      keep-outputs = true
      keep-derivations = true
    '';

that worked fine.
Then add the contentAddressableByDefault=true;
building that failed.

here is the whole build output

warning: dumping very large path (> 256 MiB); this may run out of memory
warning: rewriting hashes in '/nix/store/z27z317qj57k5942f2nbg4ggvrxvbrcv-expat-2.2.10-dev'; cross fingers
warning: rewriting hashes in '/nix/store/wx5hai26dg26hwndq50b11q4pysgm91h-libffi-3.3-dev'; cross fingers
warning: rewriting hashes in '/nix/store/h3jrqw7r0p0fcms5l7kc19b25sr03kn9-libffi-3.3-info'; cross fingers
warning: rewriting hashes in '/nix/store/q5vpl4gmhvf5v5wmsv9fskpkgi5wxpjf-libffi-3.3-man'; cross fingers
warning: rewriting hashes in '/nix/store/h9bl89ama9mc9kcw8shhwa13m2cpds5p-pcre-8.44-bin'; cross fingers
warning: rewriting hashes in '/nix/store/08jmclbv36a9ih2pmxv9nzvv78q6vfmv-pcre-8.44-dev'; cross fingers
warning: rewriting hashes in '/nix/store/79g934l14h4is65y442wiq2glvd5pym7-pcre-8.44-doc'; cross fingers
warning: rewriting hashes in '/nix/store/lxlrn4mpfld0h9xsmldsscd9cx8fnbbz-pcre-8.44-man'; cross fingers
warning: rewriting hashes in '/nix/store/mzwwxv77fi0pyxwk6w45n1lylghi0iij-libidn-1.36-bin'; cross fingers
warning: rewriting hashes in '/nix/store/341wfnjz0h5hgqyzw41rsxh3sk9sc6hr-libidn-1.36-dev'; cross fingers
warning: rewriting hashes in '/nix/store/al1lhlcqhfaav9zkr2bdx3gr085z4vjx-libidn-1.36-devdoc'; cross fingers
warning: rewriting hashes in '/nix/store/nbvcaiw26ihdccwsyk396ylghdi6ll8g-libidn-1.36-info'; cross fingers
warning: rewriting hashes in '/nix/store/kmyd0l295pz2b68nzpd855gdkp6pgnsy-pkg-config-0.29.2-man'; cross fingers
warning: rewriting hashes in '/nix/store/x3143vmw60qfw5jqb0jpgwnag4cazs3n-pkg-config-0.29.2'; cross fingers
warning: rewriting hashes in '/nix/store/awasf47r2fpz79ymyln2s86srsmqzv4y-pkg-config-wrapper-0.29.2-man'; cross fingers
warning: rewriting hashes in '/nix/store/sy5g8a39hyl2r0s6d9zc7jrihkvlvgzl-pkg-config-wrapper-0.29.2'; cross fingers
warning: rewriting hashes in '/nix/store/i0402gpfa9mvvcbka3xhgzhbvma5j0wd-xz-5.2.5-bin'; cross fingers
warning: rewriting hashes in '/nix/store/gahrhnzyvd5j6d4kifji0w2clpmwsqsr-xz-5.2.5-dev'; cross fingers
warning: rewriting hashes in '/nix/store/12ql3mkkmzf9kbz6p6hs28f8ps6k61kz-xz-5.2.5-doc'; cross fingers
warning: rewriting hashes in '/nix/store/zppbk20y972ibap037ram1bgcc8l608n-xz-5.2.5-man'; cross fingers
warning: rewriting hashes in '/nix/store/s8j4v1n7ma0z42pq2bqkpgg19yhsyb05-zlib-1.2.11-dev'; cross fingers
warning: rewriting hashes in '/nix/store/wnaypr0a60v404qljp6j1khj047l8wvc-zlib-1.2.11-static'; cross fingers
warning: rewriting hashes in '/nix/store/x6x21dlm781fllrwviz62764wjc6421d-ncurses-6.2'; cross fingers
warning: rewriting hashes in '/nix/store/hc0p8c899v13c1mjlkw0mlg2l029393b-ncurses-6.2-dev'; cross fingers
warning: rewriting hashes in '/nix/store/17g1frzmlsna13f9l9jprq7mpfgmc68i-gmp-6.2.1-dev'; cross fingers
warning: rewriting hashes in '/nix/store/q5ivjnnyi81d9x5p36sxvagag7kjs0w2-gmp-6.2.1-info'; cross fingers
warning: rewriting hashes in '/nix/store/njjsr3j4jdqbsnvk8d1nj5qfzz7p62mi-perl-5.32.1-man'; cross fingers
warning: rewriting hashes in '/nix/store/gjbziwfi2p809cr93b168dndr1b2m1lz-perl-5.32.1'; cross fingers
warning: rewriting hashes in '/nix/store/p40g558pi8hafaqd3s54d97s2ifmkfbj-gnugrep-3.6'; cross fingers
warning: rewriting hashes in '/nix/store/7i4b51n26nblx1wkiggiw6zfh24gizy9-coreutils-8.32'; cross fingers
warning: rewriting hashes in '/nix/store/05ncyypppcklc2aj3ll3vyc1m0gjrhmr-gettext-0.21-doc'; cross fingers
warning: rewriting hashes in '/nix/store/llfxwn1ix2hffci2bqsi9ij8vmchdbjz-gettext-0.21-info'; cross fingers
warning: rewriting hashes in '/nix/store/v6iszvl4xpbbscg5qvd4rs17ykmbda1m-gettext-0.21-man'; cross fingers
warning: rewriting hashes in '/nix/store/jqa4n64vbqb3zb47rgi328npfmdlrnar-perl5.32.1-gettext-1.07'; cross fingers
warning: rewriting hashes in '/nix/store/dzaxa03cplsp8kpil254sjyi29fhvp9r-libtool-2.4.6'; cross fingers
warning: rewriting hashes in '/nix/store/lzyjgn3833bn901ckq1jgvhhin63r0y0-bzip2-1.0.6.0.2-bin'; cross fingers
warning: rewriting hashes in '/nix/store/yk4akv7bb24il6j5awdi6bdj8afdhzhs-bzip2-1.0.6.0.2-dev'; cross fingers
warning: rewriting hashes in '/nix/store/j9rq5x1m306kq11cxraqg6n6h04a0sds-bzip2-1.0.6.0.2-man'; cross fing
ers
warning: output dev of input /nix/store/lvxynw3gaknhijqjkyizdchq87akfsnz-zlib-1.2.11.drv missing, aborting the resolving
error: unexpected end-of-file

I’m not really sure how to debug further here.
Let me know if there is anything I can do to provide more informations.

The one currently deployed is GitHub - regnat/hydra at nix-ca. I try to keep it up-to-date with master (it’s very slightly behind right now, but nothing serious I think)

I wonder whether that’s another instance of the bug @Fuuzetsu and @hmenke mention.
The logs of the nix daemon (journalctl -u nix-daemon.service) might have a bit more information.

If you don’t have the same assertion error, feel free to open an issue on the Nix repo (and in any case, if you have a repro, please do post it, that’ll be immensely helpful)

Congrats!

To celebrate the release, I pushed the latest stable build to the nix-unstable-installer project. This is mainly useful to test CA in CI environments like GitHub Actions.

4 Likes

Thank you for your answer.
I’m on macos. I tried checking in /var/log/system.log but it was empty of anything nix-daemon related.

Things were going well on the full rebuild, but I got a failure on building mailutils, which had worked before without CA.

mailutils> *******************************************************************
mailutils> GNU Mailutils configured with the following settings:
mailutils> Default mailbox scheme ........ mbox
mailutils> Use PAM ....................... yes
mailutils> Use -ltdl ..................... yes
mailutils> Use DBM ....................... GDBM
mailutils> Use GNU TLS ................... yes
mailutils> Use GSASL ..................... yes
mailutils> Use GSSAPI .................... yes
mailutils> Use TCP wrappers .............. no
mailutils> Pthread support ............... yes
mailutils> Readline support .............. yes
mailutils> Libunistring support .......... yes
mailutils> MySQL support ................. yes
mailutils> PostgreSQL support ............ no
mailutils> LDAP support .................. no
mailutils> Radius support ................ no
mailutils> Support for virtual domains ... yes
mailutils> IPv6 support .................. yes
mailutils> Interfaces:
mailutils> Guile ......................... yes
mailutils> C++ ........................... no
mailutils> Python ........................ yes
mailutils> Mailbox formats:
mailutils> IMAP .......................... yes
mailutils> POP ........................... yes
mailutils> MH ............................ yes
mailutils> maildir ....................... yes
mailutils> dotmail ....................... yes
mailutils> Mailers:
mailutils> SMTP .......................... yes
mailutils> Sendmail ...................... yes
mailutils> Utilities to build:
mailutils> Servers ....................... pop3d imap4d comsat mda lmtpd
mailutils> Clients ....................... putmail frm mail sieve messages readmsg dotlock movemail mimeview decodemail mh
mailutils> *******************************************************************
mailutils> Before proceeding, verify if these satisfy your requirements.
mailutils> configure: WARNING: unrecognized options: --with-path-sendmail
mailutils> building
mailutils> build flags: SHELL=/nix/store/2fp2bd2p52cbdgrc9j9fq12m14kki37k-bash-4.4-p23/bin/bash
mailutils> Makefile:548: *** missing rule before recipe.  Stop.
error: builder for '/nix/store/6vxzvr7hvx48vnb037dkqznyc9j3p804-mailutils-3.12.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/8lq9d03jspsbf9vnv3g49sm3phkn92q1-smartmontools-7.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5pzfm6zh452bkzdkxni5rlk8gk9899hf-system-path.drv' failed to build

Using a flake setup with

    "nixpkgs": {
      "locked": {
        "lastModified": 1620136156,
        "narHash": "sha256-5MpbP3Pv2wcw5q3N/MqPNZub9TzD0c1OH8LkaystnLw=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "8a249aa732bdd3f4a4bdecfa1edd738536ca41c0",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "master",
        "repo": "nixpkgs",
        "type": "github"
      }
    },

Any thoughts? Should I move this issue to GitHub?

Yes please do :slight_smile: And if you can, also attach the full log (I have some weird stuff non-deterministically going on during the configurePhase that I suspect are related, I’d like to check whether you have these too)

(Interestingly, I can reproduce it but not deterministically :confused: )

I can not try… Not even with most recent nix it just complains about ca-derivations not beeing enabled:

$ nix --version
nix (Nix) 2.4pre20210326_dd77f71
$ nix build -L .#nixos/configs/$(hostname) --experimental-features "ca-derivations nix-command flakes"
error: experimental Nix feature 'ca-derivations' is disabled; use '--experimental-features ca-derivations' to override
(use '--show-trace' to show detailed location information)
$ nix shell -L nix
$ nix --version
nix (Nix) 2.4pre20210504_fe3a10a
$ nix build -L .#nixos/configs/$(hostname)
error: experimental Nix feature 'ca-derivations' is disabled; use '--experimental-features ca-derivations' to override
(use '--show-trace' to show detailed location information)
$ nix build -L .#nixos/configs/$(hostname) --experimental-features "ca-derivations nix-command flakes"
error: experimental Nix feature 'ca-derivations' is disabled; use '--experimental-features ca-derivations' to override
(use '--show-trace' to show detailed location information)

In my case the problem seems to be when I’m using direnv and I enter the directory. But it seems fine if I run nix develop.

.envrc

use flake
error: experimental Nix feature 'ca-derivations' is disabled; use '--experimental-features ca-derivations' to override
(use '--show-trace' to show detailed location information)

Assuming you’re using nix-direnv, the issue is probably that nix-direnv/direnvrc at 974fa8c7c3e9406d3249cd171c488df84d80e459 · nix-community/nix-direnv · GitHub resets the experimental-features. I guess the best fix is to send a patch to use --extra-experimental-features rather than --experimental-features

1 Like

Duh, that’s very puzzling. Do you mind opening a gh issue to discuss that. At the very least there’s a bad error message that has to be fixed

I haven’t done any ca-testing but with nix (Nix) 2.4pre20210503_6d2553a, most of my nix-shell calls end with a similar error:

nix-shell -A pkg-config channel:nixos-unstable                                                                                                                                                                                                      
error: derivation '/nix/store/wqysh0q3cxjl3psmmhib9qy7kg10qvxa-pkg-config-0.29.2.drv' does not have wanted outputs 'doc,man,out'`

My config

experimental-features = nix-command flakes
builders-use-substitutes = true

When I use nix develop it’s fine

The commands are run in a direnvd environment. I’ll check first with disabling direnv there. Will report back after that

I’ve opened an issue at Content addressed mailutils fails to build · Issue #121813 · NixOS/nixpkgs · GitHub .
I wanted to get a fresh mailutils log from nixos-rebuild, but it has now decided that my kernel needs to be rebuilt, even though I didn’t change my config afaik. Maybe there’s some non-determinism in there?

Okay, it’s getting really weird now…

Even though I did activate the nixpkgs.config.contentAddressedByDefault = true only within a single hosts configuration, I can’t build anything anymore from the flake…

nix build .#emacs
warning: unknown setting 'gc-check-reachability'
error: experimental Nix feature 'ca-derivations' is disabled; use '--experimental-features ca-derivations' to override
(use '--show-trace' to show detailed location information)