aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-06-22Prefix env vars for attrs.* files with NIX_Maximilian Bosch
2021-06-22Remove now-obsolete typedefMaximilian Bosch
2021-06-22Add testcase for `nix develop` with `__structuredAttrs`Maximilian Bosch
2021-06-22Split shell & json creation for build environments with structured attrsMaximilian Bosch
2021-06-22Fix usage of structured attrs for `nix develop`Maximilian Bosch
2021-06-22Set environment variables for .attrs.json & .attrs.shMaximilian Bosch
This way no derivation has to expect that these files are in the `cwd` during the build. This is problematic for `nix-shell` where these files would have to be inserted into the nix-shell's `cwd` which can become problematic with e.g. recursive `nix-shell`. To remain backwards-compatible, the location inside the build sandbox will be kept, however using these files directly should be deprecated from now on.
2021-06-22Source complete env in `nix-shell` with `__structuredAttrs = true;`Maximilian Bosch
This is needed to push the adoption of structured attrs[1] forward. It's now checked if a `__json` exists in the environment-map of the derivation to be openend in a `nix-shell`. Derivations with structured attributes enabled also make use of a file named `.attrs.json` containing every environment variable represented as JSON which is useful for e.g. `exportReferencesGraph`[2]. To provide an environment similar to the build sandbox, `nix-shell` now adds a `.attrs.json` to `cwd` (which is mostly equal to the one in the build sandbox) and removes it using an exit hook when closing the shell. To avoid leaking internals of the build-process to the `nix-shell`, the entire logic to generate JSON and shell code for structured attrs was moved into the `ParsedDerivation` class. [1] https://nixos.mayflower.consulting/blog/2020/01/20/structured-attrs/ [2] https://nixos.org/manual/nix/unstable/expressions/advanced-attributes.html#advanced-attributes
2021-06-21Merge pull request #4833 from NixOS/ca/json-realisations-in-worker-protocolEelco Dolstra
Always send the realisations as JSON
2021-06-21Merge pull request #4928 from NixOS/ca/remove-existing-invalid-store-pathEelco Dolstra
Remove a possible existing store path when building CA derivations
2021-06-21Only symlink the requested outputs in `nix build`regnat
Fix #4925
2021-06-21Remove a possible existing store path when building CA derivationsregnat
In case a previous interrupted build left a garbage path laying around, remove it before trying to move the path to its final location. Fix #4858
2021-06-18UDSRemoteStore: Support the 'root' store parameterEelco Dolstra
Useful when we're using a daemon with a chroot store, e.g. $ NIX_DAEMON_SOCKET_PATH=/tmp/chroot/nix/var/nix/daemon-socket/socket nix-daemon --store /tmp/chroot Then the client can now connect with $ nix build --store unix:///tmp/chroot/nix/var/nix/daemon-socket/socket?root=/tmp/chroot nixpkgs#hello
2021-06-15nix develop: Filter out NIX_REMOTEEelco Dolstra
When recursive Nix is enabled, NIX_REMOTE is set to unix:///build/.nix-socket, which doesn't work outside of the sandbox.
2021-06-02fix error: 'optional' in namespace 'std' does not name a template typekeke
2021-06-02doc: Wrap at 80 charactersregnat
2021-06-02Fix a documentation typoThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-06-02throw_ -> reportErrorregnat
This function might or might not throw depending on the value of `keepGoing`, so naming it `throw_` was a bit confusing
2021-06-02Let `nix flake check` keep going when keep-going is setregnat
When the `keep-going` option is set to `true`, make `nix flake check` continue as much as it can before failing. The UI isn’t perfect as-it-is as all the lines currently start with a mostly useless `error (ignored): error:` prefix, but I’m not sure what the best output would be, so I’ll leave it as-it-is for the time being (This is a bit hijacking the `keep-going` flag as it’s supposed to be a build-time only thing. But I think it’s faire to reuse it here). Fix https://github.com/NixOS/nix/issues/4450
2021-06-01Check the CA hash when importing stuff in the local storeregnat
When adding a path to the local store (via `LocalStore::addToStore`), ensure that the `ca` field of the provided `ValidPathInfo` does indeed correspond to the content of the path. Otherwise any untrusted user (or any binary cache) can add arbitrary content-addressed paths to the store (as content-addressed paths don’t need a signature).
2021-06-01Merge pull request #4866 from alyssais/libdlEelco Dolstra
Only link with libdl on Linux
2021-06-01Merge pull request #4864 from jeremyschlatter/fix-typoEelco Dolstra
Fix typo in documentation
2021-06-01Merge pull request #4734 from p01arst0rm/fix-s3-ifdefEelco Dolstra
unified macro style for ENABLE_S3
2021-06-01Only link with libdl on LinuxAlyssa Ross
Linux is (as far as I know) the only mainstream operating system that requires linking with libdl for dlopen. On BSD, libdl doesn't exist, so on non-FreeBSD BSDs linking will currently fail. On macOS, it's apparently just a symlink to libSystem (macOS libc), presumably present for compatibility with things that assume Linux. So the right thing to do here is to only add -ldl on Linux, not to add it for everything that isn't FreeBSD.
2021-06-01Fix typo in documentationJeremy Schlatter
2021-05-29Add .tar.zst support for TarballInputSchemeTimothy Klim
2021-05-28Merge pull request #4849 from NixOS/ca/fix-nix-store--exportEelco Dolstra
Make the Nar hash non modulo
2021-05-26Remove the remaining occurenceses of a NarHash moduloregnat
2021-05-25Make the Nar hash non moduloregnat
It makes much more sense to have the Nar hash be a plain straight hash rather than a hash modulo
2021-05-24fix doc: nix profile info -> nix profile listMichael Adler
Signed-off-by: Michael Adler <therisen06@gmail.com>
2021-05-19Always send the realisations as JSONregnat
Align all the worker protocol with `buildDerivation` which inlines the realisations as one opaque json blob. That way we don’t have to bother changing the remote store protocol when the definition of `Realisation` changes, as long as we keep the json backwards-compatible
2021-05-19Extract a generic `computeClosure` functionregnat
Move the `closure` logic of `computeFSClosure` to its own (templated) function. This doesn’t bring much by itself (except for the ability to properly test the “closure” functionality independently from the rest), but it allows reusing it (in particular for the realisations which will require a very similar closure computation)
2021-05-19Merge pull request #4831 from matthewbauer/fix-extra-slash-in-canon-pathEelco Dolstra
Fix extra slash in canonPath output
2021-05-18Fix extra slash in canonPath outputMatthew Bauer
When you have a symlink like: /tmp -> ./private/tmp you need to resolve ./private/tmp relative to /tmp’s dir: ‘/’. Unlike any other path output by dirOf, / ends with a slash. We don’t want trailing slashes here since we will append another slash in the next comoponent, so clear s like we would if it was a symlink to an absoute path. This should fix at least part of the issue in https://github.com/NixOS/nix/issues/4822, will need confirmation that it actually fixes the problem to close though. Introduced in f3f228700a52857fe6e8632df4e935551ea219ff.
2021-05-18Restore an accidentally suppressed negationregnat
Accidentally removed in ca96f5219489c1002499bfe2c580fdd458219144. This caused `nix run` to systematically fail with ``` error: app program '/nix/store/…' is not in the Nix store ```
2021-05-18Merge pull request #4827 from matthewbauer/run-bashrc-first-in-nix-developEelco Dolstra
Source bashrc first in nix develop
2021-05-17Source bashrc first in nix developMatthew Bauer
~/.bashrc should be sourced first in the rc script so that PATH & other env vars give precedence over the bashrc PATH. Also, in my bashrc I alias rm as: alias rm='rm -Iv' To avoid running this alias (which shows ‘removed '/tmp/nix-shell.*'), we can just prefix rm with command.
2021-05-17Split the parsing of an `App` and its resolvingregnat
That way things (like `nix flake check`) can evaluate the `app` outputs without having to build anything
2021-05-17Merge pull request #4819 from NixOS/ca/fix-nix-runEelco Dolstra
Resolve the program path in `nix run`
2021-05-17Merge pull request #4818 from NixOS/ca/cli-use-builtpathsEelco Dolstra
Enforce the use of properly built paths in libcmd
2021-05-17Resolve the program path in `nix run`regnat
Fix #4768
2021-05-17Enfore the use of properly built paths in libcmdregnat
Replace `DerivedPathWithHints` by a new `BuiltPath` type that serves as a proof that the corresponding path has been built.
2021-05-17sandbox: allow SystemVersionCompat.plist on DarwinEmily
For whatever reason, many programs trying to access SystemVersion.plist also open SystemVersionCompat.plist; this includes Python code and coreutils’ `cat(1)` (but not the native macOS `/bin/cat`). Illustratory `dtruss(1m)` output: open("/System/Library/CoreServices/SystemVersion.plist\0", 0x0, 0x0) = 3 0 open("/System/Library/CoreServices/SystemVersionCompat.plist\0", 0x0, 0x0) = 4 0 I assume this is a Big Sur change relating to the 10.16.x/11.x version compatibility divide and that it’s something along the lines of a hook inside libSystem. Fixes a lot of sandboxed package builds under Big Sur.
2021-05-13Merge pull request #4798 from matthewbauer/relock-wait-for-build-slot-goalsEelco Dolstra
Relock wait for build slot goals
2021-05-13Merge pull request #4801 from matthewbauer/fix-tokenize-output-namesEelco Dolstra
Fix tokenize output names in DerivedPath
2021-05-12Fix tokenize output names in drvMatthew Bauer
This should fix the issue described in https://discourse.nixos.org/t/derivation-does-not-have-wanted-outputs-dev-out/12905. Specifically, we get an error of error: derivation '/nix/store/_.drv' does not have wanted outputs 'dev,out' when a path like /nix/store/_.drv!dev,out is sent to the daemon.
2021-05-12Relock wait for build slot goalsMatthew Bauer
When we don’t have enough free job slots to run a goal, we put it in the waitForBuildSlot list & unlock its output locks. This will continue from where we left off (tryLocalBuild). However, we need the locks to get reacquired when/if the goal ever restarts. So, we need to send it back through tryToBuild to get reqacquire those locks. I think this bug was introduced in https://github.com/NixOS/nix/pull/4570. It leads to some builds starting without proper locks.
2021-05-12DerivedPathWithHints -> BuiltPathregnat
Just a renaming for now
2021-05-12doc: mention Priority for substitutersLorenzo Manacorda
2021-05-10Merge pull request #4781 from NixOS/locally_cache_the_remote_realisationsEelco Dolstra
Add a realisations disk cache
2021-05-10Merge pull request #4787 from Ma27/builtins-ceil-floorEelco Dolstra
Implement `builtins.floor` and `builtins.ceil` using the C library functions internally