about summary refs log tree commit diff
path: root/src/libexpr/parser.y
AgeCommit message (Collapse)AuthorFilesLines
2019-06-24 Refactor downloadCached() interfaceEelco Dolstra1-1/+3
(cherry picked from commit df3f5a78d5ab0a1f2dc9d288b271b38a9b8b33b5)
2019-06-24 downloadCached: Return ETagEelco Dolstra1-1/+1
(cherry picked from commit 529add316c5356a8060c35f987643b7bf5c796dc)
2019-05-28 Iterate over referencesEelco Dolstra1-6/+6
2019-05-28 Merge branch 'attrPaths' of https://github.com/NinjaTrappeur/nixEelco Dolstra1-3/+23
2019-03-27 Fix Bison 3.3 warningEelco Dolstra1-1/+1
2018-07-23 parser.y: right-associativity of ->volth1-1/+1
2018-07-21 parser.y: fix assoc of -> and < > <= >=volth1-2/+2
The parser allowed senseless `a > b > c` but disallowed `a -> b -> c` which seems valid It might be a typo
2018-05-11 Revert "Throw a specific error for incomplete parse errors."Eelco Dolstra1-8/+1
This reverts commit 6498adb002bcf7e715afe46c23b8635d4592c156. We don't actually use IncompleteParseError in 'nix repl'.
2018-05-02 Fix some random -Wconversion warningsEelco Dolstra1-6/+6
2018-04-18 parser: Allow mixed nested and top-level attrpathsFélix Baylac-Jacqué1-3/+23
Fixes #2077.
2017-11-03 Remove git:// support in NIX_PATHEelco Dolstra1-6/+1
This didn't support specifying a revision/branch, and was restricted to git:// URIs (since https:// or ssh:// would be ambiguous).
2017-10-30 builtins.fetchgit: Support importing a working treeEelco Dolstra1-1/+1
For example, you can write src = fetchgit ./.; and if ./. refers to an unclean working tree, that tree will be copied to the Nix store. This removes the need for "cleanSource".
2017-10-30 builtins.fetchGit: Return an attrset with revision infoEelco Dolstra1-1/+1
This adds rev, shortRev and revCount attributes, equal to what Hydra provides. E.g. $ nix eval '(fetchGit https://github.com/NixOS/patchelf.git)' { outPath = "/nix/store/ghigrkw02l440g8vfxa9wj4c3zpfmw99-source"; rev = "29c085fd9d3fc972f75b3961905d6b4ecce7eb2b"; revCount = 303; shortRev = "29c085f"; }
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-8/+8
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-26 nix-build/nix-shell: Eliminate call to nix-instantiate / nix-storeEelco Dolstra1-0/+7
Note that this removes the need for a derivation symlink, so the --drv-path and --add-drv-link flags now do nothing.
2017-05-05 Figure out the user's home directory if $HOME is not setEelco Dolstra1-1/+1
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-9/+9
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-9/+9
2016-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-2/+2
2016-09-14 Enable HTTP/2 supportEelco Dolstra1-1/+1
The binary cache store can now use HTTP/2 to do lookups. This is much more efficient than HTTP/1.1 due to multiplexing: we can issue many requests in parallel over a single TCP connection. Thus it's no longer necessary to use a bunch of concurrent TCP connections (25 by default). For example, downloading 802 .narinfo files from https://cache.nixos.org/, using a single TCP connection, takes 11.8s with HTTP/1.1, but only 0.61s with HTTP/2. This did require a fairly substantial rewrite of the Downloader class to use the curl multi interface, because otherwise curl wouldn't be able to do multiplexing for us. As a bonus, we get connection reuse even with HTTP/1.1. All downloads are now handled by a single worker thread. Clients call Downloader::enqueueDownload() to tell the worker thread to start the download, getting a std::future to the result.
2016-04-29 Support Git repos in the Nix pathEelco Dolstra1-4/+9
E.g. $ nix-build -I nixpkgs=git://github.com/NixOS/nixpkgs '<nixpkgs>' -A hello This is not extremely useful yet because you can't specify a branch/revision.
2016-04-14 Make the search path lazier with non-fatal errorsEelco Dolstra1-18/+42
Thus, -I / $NIX_PATH entries are now downloaded only when they are needed for evaluation. An error to download an entry is a non-fatal warning (just like non-existant paths). This does change the semantics of builtins.nixPath, which now returns the original, rather than resulting path. E.g., before we had [ { path = "/nix/store/hgm3yxf1lrrwa3z14zpqaj5p9vs0qklk-nixexprs.tar.xz"; prefix = "nixpkgs"; } ... ] but now [ { path = "https://nixos.org/channels/nixos-16.03/nixexprs.tar.xz"; prefix = "nixpkgs"; } ... ] Fixes #792.
2016-02-29 Add an HTTP binary cache storeEelco Dolstra1-1/+1
Allowing stuff like NIX_REMOTE=https://cache.nixos.org nix-store -qR /nix/store/x1p1gl3a4kkz5ci0nfbayjqlqmczp1kq-geeqie-1.1 or NIX_REMOTE=https://cache.nixos.org nix-store --export /nix/store/x1p1gl3a4kkz5ci0nfbayjqlqmczp1kq-geeqie-1.1 | nix-store --import
2016-02-24 Throw a specific error for incomplete parse errors.Scott Olson1-1/+8
`nix-repl` will use this for deciding whether to keep waiting for input or error out right away.
2016-02-12 Merge pull request #762 from ctheune/ctheune-floatsEelco Dolstra1-0/+3
Implement floats
2016-02-04 Eliminate the "store" global variableEelco Dolstra1-1/+1
Also, move a few free-standing functions into StoreAPI and Derivation. Also, introduce a non-nullable smart pointer, ref<T>, which is just a wrapper around std::shared_ptr ensuring that the pointer is never null. (For reference-counted values, this is better than passing a "T&", because the latter doesn't maintain the refcount. Usually, the caller will have a shared_ptr keeping the value alive, but that's not always the case, e.g., when passing a reference to a std::thread via std::bind.)
2016-01-05 First hit at providing support for floats in the language.Christian Theune1-0/+3
2015-07-17 OCD: foreach -> C++11 ranged forEelco Dolstra1-10/+10
2015-07-03 Fix the hack that resets the scanner state.Guillaume Maudoux1-15/+4
2015-05-06 nix-env/nix-instantiate/nix-build: Support URIsEelco Dolstra1-9/+0
For instance, you can install Firefox from a specific Nixpkgs revision like this: $ nix-env -f https://github.com/NixOS/nixpkgs/archive/63def04891a0abc328b1b0b3a78ec02c58f48583.tar.gz -iA firefox Or build a package from the latest nixpkgs-unstable channel: $ nix-build https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz -A hello
2015-05-05 Allow URLs in the Nix search pathEelco Dolstra1-7/+22
E.g. to install "hello" from the latest Nixpkgs: $ nix-build '<nixpkgs>' -A hello -I nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz Or to install a specific version of NixOS: $ nixos-rebuild switch -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/63def04891a0abc328b1b0b3a78ec02c58f48583.tar.gz
2015-02-23 Add restricted evaluation modeEelco Dolstra1-1/+2
If ‘--option restrict-eval true’ is given, the evaluator will throw an exception if an attempt is made to access any file outside of the Nix search path. This is primarily intended for Hydra, where we don't want people doing ‘builtins.readFile ~/.ssh/id_dsa’ or stuff like that.
2015-02-19 Merge branch 'tilde-paths' of https://github.com/shlevy/nixEelco Dolstra1-1/+2
2015-02-19 tilde paths: The rest of the string has to start with a slash anywayShea Levy1-1/+1
2015-02-19 tilde paths: construct the entire path at parse timeShea Levy1-6/+1
2015-02-19 tilde paths: get HOME at parse timeShea Levy1-3/+1
2015-02-19 Remove obsolete reference to ~ operatorEelco Dolstra1-1/+0
2015-02-19 Allow the leading component of a path to be a ~Shea Levy1-1/+9
2015-01-07 Show position info for failing <...> lookupsEelco Dolstra1-2/+6
2014-12-14 PedantryEelco Dolstra1-4/+0
2014-10-05 Get rid of some unnecessary ExprConcatStrings nodes in dynamic attrsEelco Dolstra1-12/+8
This gives a ~18% speedup in NixOS evaluation (after converting most calls to hasAttr/getAttr to dynamic attrs).
2014-08-20 Use proper quotes everywhereEelco Dolstra1-7/+7
2014-07-30 Rename nixPath to __nixPathEelco Dolstra1-1/+1
The name ‘nixPath’ breaks existing code.
2014-05-26 Remove ExprBuiltinEelco Dolstra1-8/+8
It's slower than ExprVar since it doesn't compute a static displacement. Since we're not using the throw primop in the implementation of <...> anymore, it's also not really needed.
2014-05-26 Make the Nix search path declarativeEelco Dolstra1-12/+11
Nix search path lookups like <nixpkgs> are now desugared to ‘findFile nixPath <nixpkgs>’, where ‘findFile’ is a new primop. Thus you can override the search path simply by saying let nixPath = [ { prefix = "nixpkgs"; path = "/my-nixpkgs"; } ]; in ... <nixpkgs> ... In conjunction with ‘scopedImport’ (commit c273c15cb13bb86420dda1e5341a4e19517532b5), the Nix search path can be propagated across imports, e.g. let overrides = { nixPath = [ ... ] ++ builtins.nixPath; import = fn: scopedImport overrides fn; scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; builtins = builtins // overrides; }; in scopedImport overrides ./nixos
2014-05-26 Ensure that -I flags get included in nixPathEelco Dolstra1-1/+1
Also fixes #261.
2014-05-26 Add primop ‘scopedImport’Eelco Dolstra1-2/+8
‘scopedImport’ works like ‘import’, except that it takes a set of attributes to be added to the lexical scope of the expression, essentially extending or overriding the builtin variables. For instance, the expression scopedImport { x = 1; } ./foo.nix where foo.nix contains ‘x’, will evaluate to 1. This has a few applications: * It allows getting rid of function argument specifications in package expressions. For instance, a package expression like: { stdenv, fetchurl, libfoo }: stdenv.mkDerivation { ... buildInputs = [ libfoo ]; } can now we written as just stdenv.mkDerivation { ... buildInputs = [ libfoo ]; } and imported in all-packages.nix as: bar = scopedImport pkgs ./bar.nix; So whereas we once had dependencies listed in three places (buildInputs, the function, and the call site), they now only need to appear in one place. * It allows overriding builtin functions. For instance, to trace all calls to ‘map’: let overrides = { map = f: xs: builtins.trace "map called!" (map f xs); # Ensure that our override gets propagated by calls to # import/scopedImport. import = fn: scopedImport overrides fn; scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; # Also update ‘builtins’. builtins = builtins // overrides; }; in scopedImport overrides ./bla.nix * Similarly, it allows extending the set of builtin functions. For instance, during Nixpkgs/NixOS evaluation, the Nixpkgs library functions could be added to the default scope. There is a downside: calls to scopedImport are not memoized, unlike import. So importing a file multiple times leads to multiple parsings / evaluations. It would be possible to construct the AST only once, but that would require careful handling of variables/environments.
2014-04-04 Show position info in attribute selection errorsEelco Dolstra1-4/+4
2014-04-04 Show position info in Boolean operationsEelco Dolstra1-5/+5
2014-04-04 Show position info in string concatenation / addition errorsEelco Dolstra1-6/+6