about summary refs log tree commit diff
path: root/src/libexpr
AgeCommit message (Collapse)AuthorFilesLines
2015-05-05 Make downloads interruptableEelco Dolstra1-0/+9
2015-04-16 Fix using restricted mode with chrootsEelco Dolstra1-0/+5
2015-04-09 Use cached result if there is a network errorEelco Dolstra3-8/+15
2015-04-09 Move curl stuff into a separate fileEelco Dolstra3-112/+150
2015-04-09 Implement a TTL on cached fetchurl/fetchTarball resultsEelco Dolstra1-13/+24
This is because we don't want to do HTTP requests on every evaluation, even though we can prevent a full redownload via the cached ETag. The default is one hour.
2015-04-09 Implement caching of fetchurl/fetchTarball resultsEelco Dolstra1-14/+119
ETags are used to prevent redownloading unchanged files.
2015-03-25 Add fetchTarball builtinEelco Dolstra2-1/+120
This function downloads and unpacks the given URL at evaluation time. This is primarily intended to make it easier to deal with Nix expressions that have external dependencies. For instance, to fetch Nixpkgs 14.12: with import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-14.12.tar.gz) {}; Or to fetch a specific revision: with import (fetchTarball https://github.com/NixOS/nixpkgs/archive/2766a4b44ee6eafae03a042801270c7f6b8ed32a.tar.gz) {}; This patch also adds a ‘fetchurl’ builtin that downloads but doesn't unpack its argument. Not sure if it's useful though.
2015-03-25 addToStore(): Take explicit name argumentEelco Dolstra2-2/+2
2015-03-24 Don't rely on __noChroot for corepkgsEelco Dolstra1-2/+5
This doesn't work anymore if the "strict" chroot mode is enabled. Instead, add Nix's store path as a dependency. This ensures that its closure is present in the chroot.
2015-03-19 Disable scanning for interior pointersEelco Dolstra1-0/+2
This may remove the "Repeated allocation of very large block" warnings.
2015-03-19 Fix Boehm API violationEelco Dolstra2-38/+46
We were calling GC_INIT() after doing an allocation (in the baseEnv construction), which is not allowed.
2015-03-19 Check return values from malloc/strdupEelco Dolstra1-11/+34
2015-03-18 Print some Boehm GC statsEelco Dolstra1-0/+7
2015-03-18 valueSize(): Take into account list/bindings/env sizeEelco Dolstra1-6/+15
2015-03-06 Fix typos: s/the the/the/Daniel Hahler1-1/+1
2015-03-06 forceValueDeep: Add to error prefixEelco Dolstra1-2/+7
2015-03-06 Improve error messageEelco Dolstra2-19/+25
2015-02-23 Add restricted evaluation modeEelco Dolstra5-11/+50
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 Dolstra3-2/+6
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 ExprConcatStrings: canonicalize concatenated pathsShea Levy1-1/+2
2015-02-19 Allow the leading component of a path to be a ~Shea Levy2-1/+11
2015-02-05 Remove tabEelco Dolstra1-1/+1
2015-01-29 Merge remote-tracking branch 'shlevy/baseNameOf-no-copy'Shea Levy1-1/+1
baseNameOf: Don't copy paths to the store first
2015-01-15 Fix assertion failure in nix-envEelco Dolstra1-3/+5
$ nix-env -f ~/Dev/nixops/ -iA foo nix-env: src/libexpr/eval.hh:57: void nix::Bindings::push_back(const nix::Attr&): Assertion `size_ < capacity' failed. Aborted
2015-01-09 Fix builtins.readDir on XFSEelco Dolstra1-1/+1
The DT_UNKNOWN fallback code was getting the type of the wrong path, causing readDir to report "directory" as the type of every file. Reported by deepfire on IRC.
2015-01-07 Show position info for failing <...> lookupsEelco Dolstra3-4/+8
2015-01-07 Remove quotes around filenames in position infoEelco Dolstra1-1/+1
2014-12-14 PedantryEelco Dolstra1-4/+0
2014-12-12 Remove canary stuffEelco Dolstra3-56/+0
2014-12-10 builtins.readFile: realise context associated with the pathShea Levy1-2/+6
2014-12-02 Make all ExternalValueBase functions constShea Levy4-15/+15
2014-12-02 Allow external code using libnixexpr to add typesShea Levy5-0/+108
Code that links to libnixexpr (e.g. plugins loaded with importNative, or nix-exec) may want to provide custom value types and operations on values of those types. For example, nix-exec is currently using sets where a custom IO value type would be more appropriate. This commit provides a generic hook for such types in the form of tExternal and the ExternalBase virtual class, which contains all functions necessary for libnixexpr's type-polymorphic functions (e.g. `showType`) to be implemented.
2014-11-25 Add a primop for regular expression pattern matchingEelco Dolstra1-1/+29
The function ‘builtins.match’ takes a POSIX extended regular expression and an arbitrary string. It returns ‘null’ if the string does not match the regular expression. Otherwise, it returns a list containing substring matches corresponding to parenthesis groups in the regex. The regex must match the entire string (i.e. there is an implied "^<pat>$" around the regex). For example: match "foo" "foobar" => null match "foo" "foo" => [] match "f(o+)(.*)" "foooobar" => ["oooo" "bar"] match "(.*/)?([^/]*)" "/dir/file.nix" => ["/dir/" "file.nix"] match "(.*/)?([^/]*)" "file.nix" => [null "file.nix"] The following example finds all regular files with extension .nix or .patch underneath the current directory: let findFiles = pat: dir: concatLists (mapAttrsToList (name: type: if type == "directory" then findFiles pat (dir + "/" + name) else if type == "regular" && match pat name != null then [(dir + "/" + name)] else []) (readDir dir)); in findFiles ".*\\.(nix|patch)" (toString ./.)
2014-11-25 forceString(): Accept pos argumentEelco Dolstra3-5/+5
2014-11-20 import derivation: cleanupShea Levy1-8/+11
Before this there was a bug where a `find` was being called on a not-yet-sorted set. The code was just a mess before anyway, so I cleaned it up while fixing it.
2014-11-15 realiseContext: Handle all context typesShea Levy1-2/+2
Avoids an assertion
2014-11-15 Add functors (callable attribute sets).Shea Levy2-1/+13
With this, attribute sets with a `__functor` attribute can be applied just like normal functions. This can be used to attach arbitrary metadata to a function without callers needing to treat it specially.
2014-10-31 Fix more warningsEelco Dolstra1-11/+1
2014-10-20 Fix build on gcc < 4.7Shea Levy1-0/+3
2014-10-20 Improve printing of ASTsEelco Dolstra3-16/+58
2014-10-18 baseNameOf: Don't copy paths to the store firstShea Levy1-1/+1
2014-10-17 Export realiseContext in libnixexprShea Levy2-9/+11
Useful for importNative plugins
2014-10-09 mkList: Scrub betterEelco Dolstra2-2/+3
Clearing v.app.right was not enough, because the length field of a list only takes 32 bits, so the most significant 32 bits of v.app.left (a.k.a. v.thunk.env) would remain. This could cause Boehm GC to interpret it as a valid pointer. This change reduces maximum RSS for evaluating the ‘tested’ job in nixos/release-small.nix from 1.33 GiB to 0.80 GiB, and runtime by about 8%.
2014-10-09 TypoEelco Dolstra1-1/+1
2014-10-05 Get rid of some unnecessary ExprConcatStrings nodes in dynamic attrsEelco Dolstra3-25/+18
This gives a ~18% speedup in NixOS evaluation (after converting most calls to hasAttr/getAttr to dynamic attrs).
2014-10-05 Show total allocationsEelco Dolstra1-8/+10