Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eb7131bf8b3f
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 69326f3637f1
Choose a head ref

Commits on Oct 6, 2019

  1. nix doctor: add more logging output to checks

    When running nix doctor on a healthy system, it just prints the store URI and
    nothing else. This makes it unclear whether the system is in a good state and
    what check(s) it actually ran, since some of the checks are optional depending
    on the store type.
    
    This commit updates nix doctor to print an colored log message for every check
    that it does, and explicitly state whether that check was a PASS or FAIL to make
    it clear to the user whether the system passed its checkup with the doctor.
    
    Fixes #3084
    bhipple committed Oct 6, 2019
    Copy the full SHA
    c5bd564 View commit details

Commits on Oct 23, 2019

  1. nix repl: add :edit command

    This allows to have a repl-centric workflow to working on nixpkgs.
    
    Usage:
    
        :edit <package> - heuristic that find the package file path
    
        :edit <path> - just open the editor on the file path
    
    Once invoked, `nix repl` will open $EDITOR on that file path. Once the
    editor exits, `nix repl` will automatically reload itself.
    zimbatm committed Oct 23, 2019
    1
    Copy the full SHA
    73ff84f View commit details
  2. Copy the full SHA
    207a537 View commit details
  3. libexpr: add findDerivationFilename

    extract the derivation to filename:lineno heuristic
    zimbatm committed Oct 23, 2019
    Copy the full SHA
    59c7249 View commit details

Commits on Oct 25, 2019

  1. Switch to nixpkgs 19.09

    Ericson2314 committed Oct 25, 2019
    Copy the full SHA
    70cab05 View commit details

Commits on Oct 28, 2019

  1. Copy the full SHA
    ec448f8 View commit details
  2. Copy the full SHA
    3774fe5 View commit details
  3. Copy the full SHA
    d407f4d View commit details
  4. Copy the full SHA
    9a25059 View commit details

Commits on Oct 30, 2019

  1. minor: fix mismatch of struct/class forward decl of 'Source'

    Fixes the following warning and the indicate potential issue:
    
    src/libstore/worker-protocol.hh:66:1: warning: class 'Source' was previously declared as a struct; this is valid, but may result in linker errors
    under the Microsoft C++ ABI [-Wmismatched-tags]
    
    (cherry picked from commit 6e1bb04870b1b723282d32182af286646f13bf3c)
    dtzWill committed Oct 30, 2019
    Copy the full SHA
    0e9b72e View commit details
  2. Copy the full SHA
    99aac72 View commit details

Commits on Oct 31, 2019

  1. Minor updates to inline comments

    Add missing docstring on InstallableCommand. Also, some of these were wrapped
    when they're right next to a line longer than the unwrapped line, so we can just
    unwrap them to save vertical space.
    bhipple committed Oct 31, 2019
    Copy the full SHA
    80d5ec6 View commit details
  2. Merge pull request #3179 from dtzWill/fix/struct-class-mismatch-minor

    minor: fix mismatch of struct/class forward decl of 'Source'
    edolstra authored Oct 31, 2019
    Copy the full SHA
    4e840fc View commit details
  3. Merge pull request #3182 from bhipple/fixup/comments

    Minor updates to inline comments
    edolstra authored Oct 31, 2019
    Copy the full SHA
    6bff1aa View commit details
  4. travis: enable linux builds

    Also disable email to not notify the whole NixOS community about build failures
    Mic92 committed Oct 31, 2019
    Copy the full SHA
    f178264 View commit details
  5. Merge pull request #3187 from Mic92/travis

    travis: enable linux builds
    edolstra authored Oct 31, 2019
    Copy the full SHA
    6c8d013 View commit details

Commits on Nov 1, 2019

  1. include netinet/in.h in src/nix/main.cc

    Fixes #3186
    ng0 committed Nov 1, 2019
    Copy the full SHA
    b811bd2 View commit details
  2. Merge pull request #3192 from ng-0/ng0/issue3186

    include netinet/in.h in src/nix/main.cc
    edolstra authored Nov 1, 2019
    Copy the full SHA
    06f9364 View commit details
  3. Copy the full SHA
    f1d4ba2 View commit details

Commits on Nov 2, 2019

  1. docs: xref doesn't render in title

    The `post-build-hook` text currently appears in the index, but not on the actual title line of the section, this follows the pattern used in a previous section to get a reference into a title.
    kevinastock authored Nov 2, 2019
    Copy the full SHA
    808cb64 View commit details

Commits on Nov 3, 2019

  1. Copy the full SHA
    dcd7a26 View commit details
  2. Fix progress bar when nix-prefetch-url is piped.

    The intent of the code was that if the window size cannot be determined,
    it would be treated as having the maximum possible size. Because of a
    missing assignment, it was actually treated as having a width of 0.
    
    The reason the width could not be determined was because it was obtained
    from stdout, not stderr, even though the printing was done to stderr.
    
    This commit addresses both issues.
    hvdijk committed Nov 3, 2019
    Copy the full SHA
    c935ad3 View commit details

Commits on Nov 4, 2019

  1. Merge pull request #3203 from hvdijk/prefetch-progress

    Fix progress bar when nix-prefetch-url is piped.
    edolstra authored Nov 4, 2019
    Copy the full SHA
    8ec1b1e View commit details
  2. Merge pull request #3202 from kraem/master

    Update nix eval --help msg to not include deprecated command
    edolstra authored Nov 4, 2019
    Copy the full SHA
    f5a46ef View commit details
  3. Copy the full SHA
    cea05e5 View commit details
  4. Merge pull request #3206 from kevinastock/patch-3

    docs: correct default location of log directory
    edolstra authored Nov 4, 2019
    Copy the full SHA
    3770f5c View commit details

Commits on Nov 5, 2019

  1. Copy the full SHA
    1b600ec View commit details
  2. Copy the full SHA
    6b70871 View commit details
  3. Fix VM tests

    edolstra committed Nov 5, 2019
    Copy the full SHA
    e1725ba View commit details
  4. Merge pull request #3199 from kevinastock/patch-2

    docs: xref doesn't render in title
    edolstra authored Nov 5, 2019
    Copy the full SHA
    376802c View commit details
  5. Merge pull request #3180 from kevinastock/patch-1

    docs: fix upper bound on number of consumed cores
    edolstra authored Nov 5, 2019
    Copy the full SHA
    78b8203 View commit details
  6. Merge pull request #3193 from matthewbauer/patch-11

    Update man to show that nix-shell allows --arg
    edolstra authored Nov 5, 2019
    Copy the full SHA
    7876027 View commit details
  7. Copy the full SHA
    852554b View commit details
  8. Fix manual build

    edolstra committed Nov 5, 2019
    Copy the full SHA
    81a9b93 View commit details
  9. Disable shellcheck

    It's broken at the moment: https://hydra.nixos.org/build/105746055
    
    Also it pulls in GHC which is a pretty big dependency.
    edolstra committed Nov 5, 2019
    Copy the full SHA
    b4e260d View commit details
  10. Copy the full SHA
    d823381 View commit details
  11. Copy the full SHA
    b874272 View commit details
  12. Recursive Nix support

    This allows Nix builders to call Nix to build derivations, with some
    limitations.
    
    Example:
    
      let nixpkgs = fetchTarball channel:nixos-18.03; in
    
      with import <nixpkgs> {};
    
      runCommand "foo"
        {
          buildInputs = [ nix jq ];
          NIX_PATH = "nixpkgs=${nixpkgs}";
        }
        ''
          hello=$(nix-build -E '(import <nixpkgs> {}).hello.overrideDerivation (args: { name = "hello-3.5"; })')
    
          $hello/bin/hello
    
          mkdir -p $out/bin
          ln -s $hello/bin/hello $out/bin/hello
    
          nix path-info -r --json $hello | jq .
        ''
    
    This derivation makes a recursive Nix call to build GNU Hello and
    symlinks it from its $out, i.e.
    
      # ll ./result/bin/
      lrwxrwxrwx 1 root root 63 Jan  1  1970 hello -> /nix/store/s0awxrs71gickhaqdwxl506hzccb30y5-hello-3.5/bin/hello
    
      # nix-store -qR ./result
      /nix/store/hwwqshlmazzjzj7yhrkyjydxamvvkfd3-glibc-2.26-131
      /nix/store/s0awxrs71gickhaqdwxl506hzccb30y5-hello-3.5
      /nix/store/sgmvvyw8vhfqdqb619bxkcpfn9lvd8ss-foo
    
    This is implemented as follows:
    
    * Before running the outer builder, Nix creates a Unix domain socket
      '.nix-socket' in the builder's temporary directory and sets
      $NIX_REMOTE to point to it. It starts a thread to process
      connections to this socket. (Thus you don't need to have nix-daemon
      running.)
    
    * The daemon thread uses a wrapper store (RestrictedStore) to keep
      track of paths added through recursive Nix calls, to implement some
      restrictions (see below), and to do some censorship (e.g. for
      purity, queryPathInfo() won't return impure information such as
      signatures and timestamps).
    
    * After the build finishes, the output paths are scanned for
      references to the paths added through recursive Nix calls (in
      addition to the inputs closure). Thus, in the example above, $out
      has a reference to $hello.
    
    The main restriction on recursive Nix calls is that they cannot do
    arbitrary substitutions. For example, doing
    
      nix-store -r /nix/store/kmwd1hq55akdb9sc7l3finr175dajlby-hello-2.10
    
    is forbidden unless /nix/store/kmwd... is in the inputs closure or
    previously built by a recursive Nix call. This is to prevent
    irreproducible derivations that have hidden dependencies on
    substituters or the current store contents. Building a derivation is
    fine, however, and Nix will use substitutes if available. In other
    words, the builder has to present proof that it knows how to build a
    desired store path from scratch by constructing a derivation graph for
    that path.
    
    Probably we should also disallow instantiating/building fixed-output
    derivations (specifically, those that access the network, but
    currently we have no way to mark fixed-output derivations that don't
    access the network). Otherwise sandboxed derivations can bypass
    sandbox restrictions and access the network.
    
    When sandboxing is enabled, we make paths appear in the sandbox of the
    builder by entering the mount namespace of the builder and
    bind-mounting each path. This is tricky because we do a pivot_root()
    in the builder to change the root directory of its mount namespace,
    and thus the host /nix/store is not visible in the mount namespace of
    the builder. To get around this, just before doing pivot_root(), we
    branch a second mount namespace that shares its /nix/store mountpoint
    with the parent.
    
    Recursive Nix currently doesn't work on macOS in sandboxed mode
    (because we can't change the sandbox policy of a running build) and in
    non-root mode (because setns() barfs).
    edolstra committed Nov 5, 2019
    1
    Copy the full SHA
    c4d7c76 View commit details
  13. Copy the full SHA
    c921074 View commit details
  14. Copy the full SHA
    2af9561 View commit details
  15. Enable recursive Nix using a feature

    Derivations that want to use recursion should now set
    
      requiredSystemFeatures = [ "recursive-nix" ];
    
    to make the daemon socket appear.
    
    Also, Nix should be configured with "experimental-features =
    recursive-nix".
    edolstra committed Nov 5, 2019
    Copy the full SHA
    c119ab9 View commit details
  16. Copy the full SHA
    69326f3 View commit details
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
os: osx
script: ./tests/install-darwin.sh
matrix:
include:
- language: osx
script: ./tests/install-darwin.sh
- language: nix
script: nix-build release.nix -A build.x86_64-linux
notifications:
email: false
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -255,8 +255,8 @@ fi

# Whether to use the Boehm garbage collector.
AC_ARG_ENABLE(gc, AC_HELP_STRING([--enable-gc],
[enable garbage collection in the Nix expression evaluator (requires Boehm GC) [default=no]]),
gc=$enableval, gc=no)
[enable garbage collection in the Nix expression evaluator (requires Boehm GC) [default=yes]]),
gc=$enableval, gc=yes)
if test "$gc" = yes; then
PKG_CHECK_MODULES([BDW_GC], [bdw-gc])
CXXFLAGS="$BDW_GC_CFLAGS $CXXFLAGS"
4 changes: 2 additions & 2 deletions doc/manual/advanced-topics/cores-vs-jobs.xml
Original file line number Diff line number Diff line change
@@ -36,8 +36,8 @@ to <xref linkend="conf-cores" />, unless <xref linkend="conf-cores" />
equals <literal>0</literal>, in which case <envar>NIX_BUILD_CORES</envar>
will be the total number of cores in the system.</para>

<para>The total number of consumed cores is a simple multiplication,
<xref linkend="conf-cores" /> * <envar>NIX_BUILD_CORES</envar>.</para>
<para>The maximum number of consumed cores is a simple multiplication,
<xref linkend="conf-max-jobs" /> * <envar>NIX_BUILD_CORES</envar>.</para>

<para>The balance on how to set these two independent variables depends
upon each builder's workload and hardware. Here are a few example
2 changes: 1 addition & 1 deletion doc/manual/advanced-topics/post-build-hook.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
version="5.0"
>

<title>Using the <xref linkend="conf-post-build-hook" /></title>
<title>Using the <option linkend="conf-post-build-hook">post-build-hook</option></title>
<subtitle>Uploading to an S3-compatible binary cache after each build</subtitle>


2 changes: 1 addition & 1 deletion doc/manual/command-ref/env-common.xml
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen>
<varlistentry><term><envar>NIX_LOG_DIR</envar></term>

<listitem><para>Overrides the location of the Nix log directory
(default <filename><replaceable>prefix</replaceable>/log/nix</filename>).</para></listitem>
(default <filename><replaceable>prefix</replaceable>/var/log/nix</filename>).</para></listitem>

</varlistentry>

7 changes: 4 additions & 3 deletions doc/manual/command-ref/opt-common.xml
Original file line number Diff line number Diff line change
@@ -243,9 +243,10 @@
<varlistentry><term><option>--arg</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>

<listitem><para>This option is accepted by
<command>nix-env</command>, <command>nix-instantiate</command> and
<command>nix-build</command>. When evaluating Nix expressions, the
expression evaluator will automatically try to call functions that
<command>nix-env</command>, <command>nix-instantiate</command>,
<command>nix-shell</command> and <command>nix-build</command>.
When evaluating Nix expressions, the expression evaluator will
automatically try to call functions that
it encounters. It can automatically call functions for which every
argument has a <link linkend='ss-functions'>default value</link>
(e.g., <literal>{ <replaceable>argName</replaceable> ?
4 changes: 1 addition & 3 deletions release-common.nix
Original file line number Diff line number Diff line change
@@ -30,9 +30,7 @@ rec {
});

configureFlags =
[
"--enable-gc"
] ++ lib.optionals stdenv.isLinux [
lib.optionals stdenv.isLinux [
"--with-sandbox-shell=${sh}/bin/busybox"
];

6 changes: 2 additions & 4 deletions release.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ nix ? builtins.fetchGit ./.
, nixpkgs ? builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.03.tar.gz
, nixpkgs ? builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz
, officialRelease ? false
, systems ? [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]
}:
@@ -25,8 +25,6 @@ let

buildInputs = tarballDeps ++ buildDeps;

configureFlags = "--enable-gc";

postUnpack = ''
(cd $sourceRoot && find . -type f) | cut -c3- > $sourceRoot/.dist-files
cat $sourceRoot/.dist-files
@@ -128,7 +126,7 @@ let
in

runCommand "nix-binary-tarball-${version}"
{ nativeBuildInputs = lib.optional (system != "aarch64-linux") shellcheck;
{ #nativeBuildInputs = lib.optional (system != "aarch64-linux") shellcheck;
meta.description = "Distribution-independent Nix bootstrap binaries for ${system}";
}
''
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ useClang ? false }:

with import (builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.03.tar.gz) {};
with import (builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz) {};

with import ./release-common.nix { inherit pkgs; };

32 changes: 32 additions & 0 deletions src/libexpr/attr-path.cc
Original file line number Diff line number Diff line change
@@ -93,4 +93,36 @@ Value * findAlongAttrPath(EvalState & state, const string & attrPath,
}


Pos findDerivationFilename(EvalState & state, Value & v, std::string what)
{
Value * v2;
try {
auto dummyArgs = state.allocBindings(0);
v2 = findAlongAttrPath(state, "meta.position", *dummyArgs, v);
} catch (Error &) {
throw Error("package '%s' has no source location information", what);
}

// FIXME: is it possible to extract the Pos object instead of doing this
// toString + parsing?
auto pos = state.forceString(*v2);

auto colon = pos.rfind(':');
if (colon == std::string::npos)
throw Error("cannot parse meta.position attribute '%s'", pos);

std::string filename(pos, 0, colon);
unsigned int lineno;
try {
lineno = std::stoi(std::string(pos, colon + 1));
} catch (std::invalid_argument & e) {
throw Error("cannot parse line number '%s'", pos);
}

Symbol file = state.symbols.create(filename);

return { file, lineno, 0 };
}


}
3 changes: 3 additions & 0 deletions src/libexpr/attr-path.hh
Original file line number Diff line number Diff line change
@@ -10,4 +10,7 @@ namespace nix {
Value * findAlongAttrPath(EvalState & state, const string & attrPath,
Bindings & autoArgs, Value & vIn);

/* Heuristic to find the filename and lineno or a nix value. */
Pos findDerivationFilename(EvalState & state, Value & v, std::string what);

}
4 changes: 1 addition & 3 deletions src/libexpr/primops/fetchGit.cc
Original file line number Diff line number Diff line change
@@ -45,9 +45,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,

if (!clean) {

/* This is an unclean working tree. So copy all tracked
files. */

/* This is an unclean working tree. So copy all tracked files. */
GitInfo gitInfo;
gitInfo.rev = "0000000000000000000000000000000000000000";
gitInfo.shortRev = std::string(gitInfo.rev, 0, 7);
Loading