Commit Graph
77 Commits
Author SHA1 Message Date
Graham Christensen c502831a1d exportReferencesGraph: support working
Before, we would get:

    [deploy@bastion:~]$ nix-store -r /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    these derivations will be built:
      /nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv
      /nix/store/ssxwmll7v21did1c8j027q0m8w6pg41i-unit-prometheus-alertmanager-irc-notifier.service.drv
      /nix/store/mvyvkj46ay7pp7b1znqbkck2mq98k0qd-unit-script-network-local-commands-start.drv
      /nix/store/vsl1y9mz38qfk6pyirjwnfzfggz5akg6-unit-network-local-commands.service.drv
      /nix/store/wi5ighfwwb83fdmav6z6n2fw6npm9ffl-unit-prometheus-hydra-exporter.service.drv
      /nix/store/x0qkv535n75pbl3xn6nn1w7qkrg9wwyg-unit-prometheus-packet-sd.service.drv
      /nix/store/lv491znsjxdf51xnfxh9ld7r1zg14d52-unit-script-packet-sd-env-key-pre-start.drv
      /nix/store/nw4nzlca49agsajvpibx7zg5b873gk9f-unit-script-packet-sd-env-key-start.drv
      /nix/store/x674wwabdwjrkhnykair4c8mpxa9532w-unit-packet-sd-env-key.service.drv
      /nix/store/ywivz64ilb1ywlv652pkixw3vxzfvgv8-unit-wireguard-wg0.service.drv
      /nix/store/v3b648293g3zl8pnn0m1345nvmyd8dwb-unit-script-acme-selfsigned-status.nixos.org-start.drv
      /nix/store/zci5d3zvr6fgdicz6k7jjka6lmx0v3g4-unit-acme-selfsigned-status.nixos.org.service.drv
      /nix/store/f6pwvnm63d0kw5df0v7sipd1rkhqxk5g-system-units.drv
      /nix/store/iax8071knxk9c7krpm9jqg0lcrawf4lc-etc.drv
      /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    error: invalid file name 'closure-init-0' in 'exportReferencesGraph'

This was tough to debug, I didn't figure out which one was broken until I did:

    nix-store -r /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv 2>&1 | grep  nix/store | xargs -n1 nix-store -r

and then looking at the remaining build graph:

    $ nix-store -r /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    these derivations will be built:
      /nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv
      /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    error: invalid file name 'closure-init-0' in 'exportReferencesGraph'

and knowing the initrd build is before the system, then:

    $ nix show-derivation /nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv
    {
      "/nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv": {
        [...]
        "exportReferencesGraph": "closure-init-0 /nix/store/...-stage-1-init.sh closure-mdadm.conf-1 /nix/store/...-mdadm.conf closure-ubuntu.conf-2 ...",
        [...]
      }
    }

I then searched the repo for "in 'exportReferencesGraph'", found this
recently updated regex, and realized it was missing a "-".
2020-01-01 20:50:40 -05:00
Graham ChristensenandGitHub ec364582eb Merge pull request #3252 from bwignall/typo
Fix typos
2019-11-30 19:05:43 -05:00
Graham Christensen 171d784404 docs: operators: Make OR and AND capitalized 2019-08-27 06:55:22 -04:00
Graham ChristensenandGitHub 15ee2bc2fe Merge pull request #2946 from vmandela/proxy
installer: handle network proxy in systemd multi-user install
2019-08-24 14:55:19 -04:00
Graham Christensen 057af1dbd8 docs: document the installer's use of proxy env vars 2019-08-24 09:08:44 -04:00
Graham Christensen 92ddce4f46 operators: document exact precedenc, split up similar operators 2019-08-23 15:50:54 -04:00
Graham Christensen ee9c988a1b Track function start and ends for flame graphs
With this patch, and this file I called `log.py`:

    #!/usr/bin/env nix-shell
    #!nix-shell -i python3 -p python3 --pure

    import sys
    from pprint import pprint

    stack = []
    timestack = []

    for line in open(sys.argv[1]):
        components = line.strip().split(" ", 2)
        if components[0] != "function-trace":
            continue

        direction = components[1]
        components = components[2].rsplit(" ", 2)

        loc = components[0]
        _at = components[1]
        time = int(components[2])

        if direction == "entered":
            stack.append(loc)
            timestack.append(time)
        elif direction == "exited":
            dur = time - timestack.pop()
            vst = ";".join(stack)
            print(f"{vst} {dur}")
            stack.pop()

and:

    nix-instantiate --trace-function-calls -vvvv ../nixpkgs/pkgs/top-level/release.nix -A unstable > log.matthewbauer 2>&1
    ./log.py ./log.matthewbauer > log.matthewbauer.folded
    flamegraph.pl --title matthewbauer-post-pr log.matthewbauer.folded > log.matthewbauer.folded.svg

I can make flame graphs like: http://gsc.io/log.matthewbauer.folded.svg

---

Includes test cases around function call failures and tryEval. Uses
RAII so the finish is always called at the end of the function.
2019-08-14 16:09:35 -04:00
Graham Christensen a02457db71 conf: stalled-download-timeout: make tunable
Make curl's low speed limit configurable via stalled-download-timeout.
Before, this limit was five minutes without receiving a single byte.
This is much too long as if the remote end may not have even
acknowledged the HTTP request.
2019-08-08 10:22:13 -04:00
Graham Christensen 1eeaf99cf8 fixup: docs for post-build-hook 2019-08-07 14:53:11 -04:00
Graham Christensen 363a2f6826 post-build-hook: docs fixup 2019-08-06 14:26:43 -04:00
Graham Christensen cf6172f05e docs: document balancing cores and max-jobs 2019-07-19 08:28:44 -04:00
Graham Christensen 648bdf153d tarball-ttl: document
Incorporates text from Niklas Hambüchen in #2978

Closes #1115
2019-07-05 15:55:28 -04:00
Graham Christensen 68bdd83dc8 timeout: test for error code 2019-07-02 11:18:36 -04:00
Graham Christensen c8205a3413 builtins.fetchGit: document absolute ref support 2019-07-02 09:05:56 -04:00
Graham Christensen 17d3ec3405 checkStoreName: give more precise/verbose error information
$ sudo ./inst/bin/nix-instantiate -E '"${./.git}"'
error: The path name '.git' is invalid: it is illegal to start the
name with a period. Path names are alphanumeric and can include the
symbols +-._?= and must not begin with a period. Note: If '.git' is a
source file and you cannot rename it on disk,
builtins.path { name = ... } can be used to give it an alternative
name.
2019-07-02 08:41:53 -04:00
Graham ChristensenandGitHub 7ce60a81ba Merge pull request #2931 from NinjaTrappeur/nin-add-warning-setting-untrusted
Daemon: warn when an untrusted user cannot override a setting
2019-06-15 04:07:26 -04:00
Graham Christensen f1b8e9efe7 runProgram: Uncomment chdir support 2019-05-12 17:03:01 -04:00
Graham Christensen 73b797c207 handleDiffHook: stop passing allowVfork 2019-05-12 13:44:22 -04:00
Graham Christensen a5efe61786 Clarify where output from the diff hook goes. 2019-05-12 13:23:30 -04:00
Graham Christensen b4a05edbfe runProgram: support gid, uid, chdir 2019-05-12 13:17:27 -04:00
Graham Christensen dde8eeb39a chdir, setgroups 2019-05-12 13:17:26 -04:00
Graham Christensen 6df61db060 diff hook: execute as the build user, and pass the temp dir 2019-05-12 13:17:26 -04:00
Graham Christensen c78686e411 build: run diff-hook under --check and document diff-hook 2019-05-12 13:17:24 -04:00
Graham ChristensenandGitHub 5713772568 Merge pull request #2594 from LnL7/darwin-10.12.6
installer: update macOS version check to 10.12.2
2019-05-08 07:16:06 -04:00
Graham ChristensenandGitHub 6e9e34ea1f Merge pull request #2744 from veprbl/patch-8
manual: mention the "channel:" shorthand for NIX_PATH
2019-03-25 21:49:48 -04:00
Graham ChristensenandGitHub caf297a9d3 Merge pull request #2725 from andir/docs/s3-typo
docs: fix typo in AllowDirectReads
2019-03-14 18:53:57 -04:00
Graham ChristensenandGitHub 47ed3b282f Merge pull request #2462 from matthewbauer/patch-10
nix-profile-daemon: remove cruft
2018-10-01 14:28:29 -04:00
Graham Christensen 51cbeec49a Update docs to describe how s3:// URLS does in fact support endpoint, region, and profile for upload 2018-09-27 17:01:39 -04:00
Graham Christensen f11acbaf17 nix-shell: add bashInteractive to the start of the PATH, set SHELL
Tools which re-exec `$SHELL` or `$0` or `basename $SHELL` or even just
`bash` will otherwise  get the non-interactive bash, providing a
broken shell for the same reasons described in
https://github.com/NixOS/nixpkgs/issues/27493.

Extends c94f3d5575
2018-09-27 15:12:56 -04:00
Graham Christensen be9e356e61 nix-shell: document double quotes being necessary for a simple Nix expression in the shebang 2018-09-19 13:01:27 -04:00
Graham Christensen 10a7f19937 nix-shell: explain the merging property close to the example 2018-09-19 12:48:08 -04:00
Graham Christensen 0cd863197b docs: document deprecated aliases 2018-09-18 12:23:32 -04:00
Graham ChristensenandEelco Dolstra 0aca1ffb6e Prefer 'remote builder' over 'slave' 2018-09-10 18:57:46 +02:00
Graham Christensen c42eaaf684 Create upgrade notes 2018-09-01 15:35:46 -04:00
Graham Christensen 4be7652dd3 release notes: note that the multi-user installer is available but not selected for Linux with systemd, and the bug about selinux 2018-09-01 10:45:57 -04:00
Graham Christensen 51f9682a8b Default to single-user install 2018-09-01 10:45:56 -04:00
Graham Christensen c3e508d924 Document the multi-user installer some
Use sh <(...) syntax for installation to preserve stdin and prompting

also update installation docs to account for changes in multi-user selection
2018-09-01 10:45:50 -04:00
Graham Christensen f66fa7cd20 We support aarch64 now 2018-09-01 10:44:33 -04:00
Graham Christensen 87702532d2 nix-build: Print stats even in failing builds 2018-08-31 21:03:32 -04:00
Graham Christensen b7bb627f67 nix-build: print stats on sucessful builds 2018-08-31 20:57:07 -04:00
Graham Christensen 0b7568fb73 Drop ssh://... as a required formatting for builtins.fetchGit 2018-08-31 19:49:56 -04:00
Graham ChristensenandGitHub 06080e4abc 2.1 release notes: Add note about s3-compatible stores 2018-08-03 11:09:31 -04:00
Graham Christensen 6ba1726eeb install-multi-user: support 'set -u' runs, closes #2193 2018-05-30 09:35:21 -04:00
Graham Christensen d459d3307c nix-daemon.sh profile script: operate under set -u
If the profile is sourced inside a script with `set -u`, the check for
__ETC_PROFILE_NIX_SOURCED and NIX_SSL_CERT_FILE would raise an error.
A simple guard around this check allows the script to operate under
standard environments (where it is fairly reasonable to assume USER
and HOME are set.)
2018-05-30 09:15:46 -04:00
Graham ChristensenandGitHub f9940f47b3 Merge pull request #2164 from mickours/doc-fetchTarball-timout
Explain fetchTarball timeout behavior in the doc
2018-05-30 08:04:26 -04:00
Graham Christensen 51cbe99104 installer: default to the daemon installor for Linux with systemd
Note: don't backport to 2.0-maintenance
2018-04-19 13:45:17 -04:00
Graham Christensen 17b158af85 installer: allow opting in / out to the daemon installer
By passing --daemon or --no-daemon, the installer can be forced to
select one or the other installation options, despite what the
automatic detection can provide.

This commit can be backported to 2.0-maintenance because it explicitly
turns off the daemon installation for Linux under systemd.
2018-04-19 13:45:11 -04:00
Graham ChristensenandGitHub 3fbaa230a2 Merge pull request #2026 from grahamc/multi-user-linux
Expand the multi-user installer to support Linuxes with systemd
2018-03-30 16:04:11 -04:00
Graham Christensen 4eb40c72ed macos: Handle when a build user doesn't have a user ID 2018-03-30 13:57:00 -04:00
Graham Christensen f06f8102bd Use a looser comparison for the 'user note' check
We use grep instead of an equality check because it is difficult
to extract _just_ the user's note, instead it is prefixed with
some plist junk. This was causing the user note to always be set,
even if there was no reason for it.
2018-03-30 11:38:08 -04:00
Graham Christensen 4ba91f5bae Check for the existence of a profile target before seeing if it mentions Nix
Grep would ignore files that didn't exist, but would complain
about files in a directory if the directory didn't exist. Simply check
for the directory first, prior to grepping it.
2018-03-30 11:37:32 -04:00
Graham Christensen 2921165a9d Expand the multi-user installer to support Linuxes with systemd
- darwin installer: delete hardware report, not necessary
 - moves os-specific code from the darwin installer to to `poly_*`
   functions
 - adds profile.d support to the profile targets, which automatically
   handles many distros which don't have a /etc/bashrc but do have an
   /etc/profile.d
 - /bin/bash -> /usr/bin/env bash
 - document why each excluded shellcheck check is excluded
 - rename the multi-user to Daemon-based
2018-03-29 15:38:01 -04:00
Graham ChristensenandGitHub 9432f3fb7d Merge pull request #1901 from veprbl/patch-5
Fix a small typo in the release notes
2018-02-24 10:26:14 -05:00
Graham ChristensenandGitHub ab435463d0 Merge pull request #1903 from primeos/release-notes-2.0-url-fix
doc: Fix a URL in the release notes for Nix 2.0
2018-02-24 10:19:39 -05:00
Graham Christensen e4ece83b1a tests.setuid: only on i686 and x86_64 linuxs 2017-12-12 08:31:31 -05:00
Graham Christensen 1db034364a replace lolcat with nix-info 2017-12-08 07:19:32 -05:00
Graham Christensen be79d1f189 darwin installer: fix on High Sierra 2017-12-08 07:19:26 -05:00
Graham Christensen fbab9ed01e upload-release.pl: support aarch64-linux 2017-12-07 19:02:35 -05:00
Graham ChristensenandGitHub 364f75e03a Update mailing list. 2017-07-18 08:04:01 -04:00
Graham ChristensenandGitHub da2ad30054 Update the mailing list. 2017-07-18 08:02:53 -04:00
Graham Christensen e0d39c8dc4 Rename PINCH_ME_IM_SILLY to ALLOW_PREEXISTING_INSTALLATION 2017-07-14 12:11:33 -04:00
Graham Christensen 12f6bb33d2 If there is no TTY, also skip verbose sudo messages 2017-07-14 12:11:30 -04:00
Graham Christensen ce2281e6d8 Ensure PINCH_ME_IM_SILLY allows a /nix/store to stick around between builds
Also output in the status report that the user is very silly
2017-07-14 12:11:26 -04:00
Graham Christensen 1c7ce2a018 Assume yes if we have no TTY
Starve the TTY of input to ensure this works, but provide yes to the
current installer to handle the current broken case.
2017-07-14 12:11:23 -04:00
Graham Christensen 73a57a2f22 Cleanup and more specificity around set -e 2017-07-14 12:11:20 -04:00
Graham Christensen 3839dda2ec Only clean if the file exists 2017-07-14 12:11:17 -04:00
Graham Christensen 92ca93528f Clean up nix hints from the old insstaller 2017-07-14 12:11:13 -04:00
Graham Christensen 61ea9e9867 Run nix-build inside a fresh bash login 2017-07-14 12:11:10 -04:00
Graham Christensen bc647fd299 chmod 2017-07-14 12:11:07 -04:00
Graham Christensen a0369b14f4 Test the installer 2017-07-14 12:11:04 -04:00
Graham Christensen 657b47e1b3 Address feedback around printf & exec 2017-07-14 12:11:00 -04:00
Graham Christensen 6a4037ca05 Don't install a second nix after the initial installation, and the rsync change fixes a bug hidden by the nix replacement where the store files were being owned by the installing user due to rsync's -a implying -og. 2017-07-14 12:10:57 -04:00
Graham Christensen 092f447c6d Clean up issues around uninstall directions, and only show
relevant directions
2017-07-14 12:10:54 -04:00
Graham Christensen 6f639943c2 Prompt for sudo before validating assumptions, and check ourselves for root-owned files instead of making a scary warning. 2017-07-14 12:10:51 -04:00
Graham Christensen 2b5ab03524 multi-user install: move the profile in to the nix etc/profiles.d output 2017-07-14 12:10:47 -04:00
Graham Christensen fb40d73e23 Switch to a fancy multi-user installer on Darwin 2017-07-14 12:10:44 -04:00
Graham Christensen a0ad8ba12e Shellcheck the existing installer 2017-07-14 11:42:33 -04:00