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: 03a4a3c95cf0
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3aaceeb7e2d3
Choose a head ref

Commits on Apr 2, 2020

  1. Make function arguments retain position info

    This allows querying the location of function arguments. E.g.
    
      builtins.unsafeGetAttrPos "x" (builtins.functionArgs ({ x }: null))
    
      => { column = 57; file = "/home/infinisil/src/nix/inst/test.nix"; line = 1; }
    infinisil committed Apr 2, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    infinisil Silvan Mosberger
    Copy the full SHA
    c34e96f View commit details

Commits on Apr 7, 2020

  1. Copy the full SHA
    9d04b5d View commit details

Commits on Apr 8, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    edolstra Eelco Dolstra
    Copy the full SHA
    1ab8d6a View commit details
  2. Merge pull request #3468 from Infinisil/functionArgsPositions

    Make function arguments retain position info
    edolstra authored Apr 8, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9ed097d View commit details
  3. Merge pull request #3478 from edolstra/ignore-failed-data

    Downloader: Only write data to the sink on a 200 response
    edolstra authored Apr 8, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    96f3c36 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf81b31 View commit details
  5. Merge pull request #3477 from Ninlives/nix-run-using-env

    `nix run` using $SHELL as default command
    edolstra authored Apr 8, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5449ff7 View commit details
  6. Copy the full SHA
    65ef57e View commit details
  7. Copy the full SHA
    741e901 View commit details
  8. Copy the full SHA
    e5cc53b View commit details
  9. Copy the full SHA
    142ed7f View commit details
  10. Copy the full SHA
    2df2741 View commit details
  11. Copy the full SHA
    cd39120 View commit details
  12. DownloadItem -> TransferItem

    knl committed Apr 8, 2020
    Copy the full SHA
    213d124 View commit details
  13. Copy the full SHA
    c4c1ae0 View commit details
  14. actDownload -> actDataTransfer

    knl committed Apr 8, 2020
    Copy the full SHA
    a0c5931 View commit details
  15. Add upload method

    knl committed Apr 8, 2020
    Copy the full SHA
    7848372 View commit details
  16. DataTransfer -> FileTransfer

    knl committed Apr 8, 2020
    Copy the full SHA
    c330109 View commit details
  17. Copy the full SHA
    f509559 View commit details
  18. after flake rebase

    knl committed Apr 8, 2020
    Copy the full SHA
    7867685 View commit details

Commits on Apr 9, 2020

  1. Merge pull request #3476 from knl/rename-download-to-filetransfer

    Rename download to filetransfer
    domenkozar authored Apr 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    74f94d6 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    domenkozar Domen Kožar
    Copy the full SHA
    a693a9f View commit details
  3. Verified

    This commit was signed with the committer’s verified signature.
    domenkozar Domen Kožar
    Copy the full SHA
    a364b15 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    30d4618 View commit details
  5. Verified

    This commit was signed with the committer’s verified signature.
    edolstra Eelco Dolstra
    Copy the full SHA
    d103c79 View commit details
  6. Fix build

    edolstra committed Apr 9, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    edolstra Eelco Dolstra
    Copy the full SHA
    3aaceeb View commit details
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Open Collective supporters](https://opencollective.com/nixos/tiers/supporter/badge.svg?label=Supporters&color=brightgreen)](https://opencollective.com/nixos)
[![Test](https://github.com/NixOS/nix/workflows/Test/badge.svg)](https://github.com/NixOS/nix/actions)

Nix, the purely functional package manager
------------------------------------------
2 changes: 1 addition & 1 deletion src/libexpr/common-eval-args.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common-eval-args.hh"
#include "shared.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "util.hh"
#include "eval.hh"
#include "fetchers.hh"
4 changes: 2 additions & 2 deletions src/libexpr/eval.cc
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
#include "derivations.hh"
#include "globals.hh"
#include "eval-inline.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "json.hh"
#include "function-trace.hh"
#include "flake/flake.hh"
@@ -1296,7 +1296,7 @@ void ExprWith::eval(EvalState & state, Env & env, Value & v)

void ExprIf::eval(EvalState & state, Env & env, Value & v)
{
(state.evalBool(env, cond) ? then : else_)->eval(state, env, v);
(state.evalBool(env, cond, pos) ? then : else_)->eval(state, env, v);
}


6 changes: 4 additions & 2 deletions src/libexpr/nixexpr.hh
Original file line number Diff line number Diff line change
@@ -209,9 +209,10 @@ struct ExprList : Expr

struct Formal
{
Pos pos;
Symbol name;
Expr * def;
Formal(const Symbol & name, Expr * def) : name(name), def(def) { };
Formal(const Pos & pos, const Symbol & name, Expr * def) : pos(pos), name(name), def(def) { };
};

struct Formals
@@ -261,8 +262,9 @@ struct ExprWith : Expr

struct ExprIf : Expr
{
Pos pos;
Expr * cond, * then, * else_;
ExprIf(Expr * cond, Expr * then, Expr * else_) : cond(cond), then(then), else_(else_) { };
ExprIf(const Pos & pos, Expr * cond, Expr * then, Expr * else_) : pos(pos), cond(cond), then(then), else_(else_) { };
COMMON_METHODS
};

10 changes: 5 additions & 5 deletions src/libexpr/parser.y
Original file line number Diff line number Diff line change
@@ -335,7 +335,7 @@ expr_function
;

expr_if
: IF expr THEN expr ELSE expr { $$ = new ExprIf($2, $4, $6); }
: IF expr THEN expr ELSE expr { $$ = new ExprIf(CUR_POS, $2, $4, $6); }
| expr_op
;

@@ -531,8 +531,8 @@ formals
;

formal
: ID { $$ = new Formal(data->symbols.create($1), 0); }
| ID '?' expr { $$ = new Formal(data->symbols.create($1), $3); }
: ID { $$ = new Formal(CUR_POS, data->symbols.create($1), 0); }
| ID '?' expr { $$ = new Formal(CUR_POS, data->symbols.create($1), $3); }
;

%%
@@ -544,7 +544,7 @@ formal
#include <unistd.h>

#include "eval.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "fetchers.hh"
#include "store-api.hh"

@@ -690,7 +690,7 @@ std::pair<bool, std::string> EvalState::resolveSearchPathElem(const SearchPathEl
try {
res = { true, store->toRealPath(fetchers::downloadTarball(
store, resolveUri(elem.second), "source", false).storePath) };
} catch (DownloadError & e) {
} catch (FileTransferError & e) {
printError(format("warning: Nix search path entry '%1%' cannot be downloaded, ignoring") % elem.second);
res = { false, "" };
}
7 changes: 5 additions & 2 deletions src/libexpr/primops.cc
Original file line number Diff line number Diff line change
@@ -1354,9 +1354,12 @@ static void prim_functionArgs(EvalState & state, const Pos & pos, Value * * args
}

state.mkAttrs(v, args[0]->lambda.fun->formals->formals.size());
for (auto & i : args[0]->lambda.fun->formals->formals)
for (auto & i : args[0]->lambda.fun->formals->formals) {
// !!! should optimise booleans (allocate only once)
mkBool(*state.allocAttr(v, i.name), i.def);
Value * value = state.allocValue();
v.attrs->push_back(Attr(i.name, value, &i.pos));
mkBool(*value, i.def);
}
v.attrs->sort();
}

2 changes: 1 addition & 1 deletion src/libexpr/primops/fetchTree.cc
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
#include "eval-inline.hh"
#include "store-api.hh"
#include "fetchers.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "registry.hh"

#include <ctime>
2 changes: 1 addition & 1 deletion src/libfetchers/github.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "download.hh"
#include "filetransfer.hh"
#include "cache.hh"
#include "fetchers.hh"
#include "globals.hh"
1 change: 0 additions & 1 deletion src/libfetchers/registry.cc
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
#include "fetchers.hh"
#include "util.hh"
#include "globals.hh"
#include "download.hh"
#include "store-api.hh"

#include <nlohmann/json.hpp>
10 changes: 5 additions & 5 deletions src/libfetchers/tarball.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "fetchers.hh"
#include "cache.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "globals.hh"
#include "store-api.hh"
#include "archive.hh"
@@ -36,13 +36,13 @@ DownloadFileResult downloadFile(
if (cached && !cached->expired)
return useCached();

DownloadRequest request(url);
FileTransferRequest request(url);
if (cached)
request.expectedETag = getStrAttr(cached->infoAttrs, "etag");
DownloadResult res;
FileTransferResult res;
try {
res = getDownloader()->download(request);
} catch (DownloadError & e) {
res = getFileTransfer()->download(request);
} catch (FileTransferError & e) {
if (cached) {
warn("%s; using cached version", e.msg());
return useCached();
6 changes: 3 additions & 3 deletions src/libstore/build.cc
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
#include "affinity.hh"
#include "builtins.hh"
#include "builtins/buildenv.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "finally.hh"
#include "compression.hh"
#include "json.hh"
@@ -361,7 +361,7 @@ class Worker
{
actDerivations.progress(doneBuilds, expectedBuilds + doneBuilds, runningBuilds, failedBuilds);
actSubstitutions.progress(doneSubstitutions, expectedSubstitutions + doneSubstitutions, runningSubstitutions, failedSubstitutions);
act.setExpected(actDownload, expectedDownloadSize + doneDownloadSize);
act.setExpected(actFileTransfer, expectedDownloadSize + doneDownloadSize);
act.setExpected(actCopyPath, expectedNarSize + doneNarSize);
}
};
@@ -2161,7 +2161,7 @@ void DerivationGoal::startBuilder()
if (needsHashRewrite()) {

if (pathExists(homeDir))
throw Error(format("directory '%1%' exists; please remove it") % homeDir);
throw Error(format("home directory '%1%' exists; please remove it to assure purity of builds without sandboxing") % homeDir);

/* We're not doing a chroot build, but we have some valid
output paths. Since we can't just overwrite or delete
10 changes: 5 additions & 5 deletions src/libstore/builtins/fetchurl.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "builtins.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "store-api.hh"
#include "archive.hh"
#include "compression.hh"
@@ -26,23 +26,23 @@ void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData)
auto mainUrl = getAttr("url");
bool unpack = get(drv.env, "unpack").value_or("") == "1";

/* Note: have to use a fresh downloader here because we're in
/* Note: have to use a fresh fileTransfer here because we're in
a forked process. */
auto downloader = makeDownloader();
auto fileTransfer = makeFileTransfer();

auto fetch = [&](const std::string & url) {

auto source = sinkToSource([&](Sink & sink) {

/* No need to do TLS verification, because we check the hash of
the result anyway. */
DownloadRequest request(url);
FileTransferRequest request(url);
request.verifyTLS = false;
request.decompress = false;

auto decompressor = makeDecompressionSink(
unpack && hasSuffix(mainUrl, ".xz") ? "xz" : "none", sink);
downloader->download(std::move(request), *decompressor);
fileTransfer->download(std::move(request), *decompressor);
decompressor->finish();
});

Loading