aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-06-22Enable/fix tests in nix-staticEelco Dolstra
pkgsStatic is apparently considered a cross environment, so checkPhase and installCheckPhase are disabled even when we ask for them.
2022-06-20Add another test for `--exclude` in `nix search`Fishhh
2022-06-13Merge pull request #6027 from Ma27/pure-replEelco Dolstra
repl: `--option pure-eval true` actually enables pure eval mode
2022-06-11fix sourcehut brach/tag resolving regressionGabriel Fontes
nixos/nix#6290 introduced a regex pattern to account for tags when resolving sourcehut refs. nixos/nix#4638 reafactored the code, accidentally treating the pattern as a regular string, causing all non-HEAD ref resolving to break. This fixes the regression and adds more test cases to avoid future breakage.
2022-06-07Merge pull request #6618 from afishhh/search-excludeEelco Dolstra
Add `-e`/`--exclude` flag to `nix search`
2022-06-07Use `grep -c` instead of `grep|wc -l` in some `nix search` testsFishhh
2022-06-07Add tests for `--exclude` flag in `nix search`Fishhh
2022-06-07Merge pull request #6598 from cole-h/update-flake-for-realEelco Dolstra
flake: update to 22.05
2022-06-07Fix 22.05 eval warningsEelco Dolstra
2022-06-02TypoEelco Dolstra
2022-06-02tests/flakes.sh: Fix some ignored breakageEelco Dolstra
2022-05-31repl: `--option pure-eval true` actually enables pure eval modeMaximilian Bosch
To quote Eelco in #5867: > Unfortunately we can't do > > evalSettings.pureEval.setDefault(false); > > because then we have to do the same in main.cc (where > pureEval is set to true), and that would allow pure-eval > to be disabled globally from nix.conf. Instead, a command should specify that it should be impure by default. Then, `evalSettings.pureEval` will be set to `false;` unless it's overridden by e.g. a CLI flag. In that case it's IMHO OK to be (theoretically) able to override `pure-eval` via `nix.conf` because it doesn't have an effect on commands where `forceImpureByDefault` returns `false` (i.e. everything where pure eval actually matters). Closes #5867
2022-05-31tests/nss-preload: move nix-fetch bindingCole Helbling
2022-05-25Handle EOFs in string literals correctlyEelco Dolstra
We can't return a STR token without setting a valid StringToken, otherwise the parser will crash. Fixes #6562.
2022-05-19fetchTree: Allow fetching plain filesTony Olagbaiye
Add a new `file` fetcher type, which will fetch a plain file over http(s), or from the local file. Because plain `http(s)://` or `file://` urls can already correspond to `tarball` inputs (if the path ends-up with a know archive extension), the URL parsing logic is a bit convuluted in that: - {http,https,file}:// urls will be interpreted as either a tarball or a file input, depending on the extensions of the path part (so `https://foo.com/bar` will be a `file` input and `https://foo.com/bar.tar.gz` as a `tarball` input) - `file+{something}://` urls will be interpreted as `file` urls (with the `file+` part removed) - `tarball+{something}://` urls will be interpreted as `tarball` urls (with the `tarball+` part removed) Fix #3785 Co-Authored-By: Tony Olagbaiye <me@fron.io>
2022-05-18Merge pull request #6544 from ncfavier/getFlake-no-write-lock-fileThéophane Hufschmitt
Do not attempt to write a lock file in builtins.getFlake
2022-05-18Do not attempt to write a lock file in builtins.getFlakeNaïm Favier
Fixes https://github.com/NixOS/nix/issues/6541
2022-05-13Integrate review changesEli Kogan-Wang
2022-05-11Add priority for nix profile installEli Kogan-Wang
2022-05-05Merge pull request #6489 from alexshpilkin/fix-6488Eelco Dolstra
nix: Add forgotten null check in AttrCursor::getListOfStrings()
2022-05-05Make sure that `nix build` works in `--impure` modeThéophane Hufschmitt
Regression test for <https://github.com/NixOS/nix/issues/6488>
2022-05-05Change json example to be originalthkoch2001
Closes: #3391
2022-05-03nix profile: Support overriding outputsEelco Dolstra
2022-05-03Allow selecting derivation outputs using 'installable!outputs'Eelco Dolstra
E.g. 'nixpkgs#glibc^dev,static' or 'nixpkgs#glibc^*'.
2022-05-03Merge pull request #6426 from edolstra/respect-outputs-to-installEelco Dolstra
nix: Respect meta.outputsToInstall, and use all outputs by default
2022-05-03Merge pull request #6465 from layus/fix-test-crashesThéophane Hufschmitt
tests: Distinguish crashes from expected failures
2022-05-02tests/lang: Distinguish crashes from expected failuresGuillaume Maudoux
2022-05-02Revert "tests: Distinguish crashes from expected failures"Guillaume Maudoux
This reverts commit 143b73f52dabb35cd56551c24caef95466bce488.
2022-05-02Merge pull request #4638 from orbekk/read_headEelco Dolstra
Resolve reference for remote git repositories (makes fetchGit work with non-'master' branch)
2022-05-02tests: Don't create tests/resultEelco Dolstra
https://hydra.nixos.org/log/lns780srkka4dv7r69mn4zfy6fdij4yr-nix-2.9.0pre20220428_4bb111c.drv
2022-04-29Test fetchGit with non-'master' remote repoKjetil Orbekk
2022-04-29Resolve reference for remote repositoryKjetil Orbekk
Resolves the HEAD reference from the remote repository instead of assuming "master".
2022-04-29tests: Distinguish crashes from expected failuresGuillaume Maudoux
2022-04-28Fix passing $OUT_PATHS to the post-build hookEelco Dolstra
Fixes #6446.
2022-04-26Add a test for outputsToInstallEelco Dolstra
2022-04-26nix: Respect meta.outputsToInstall, and use all outputs by defaultEelco Dolstra
'nix profile install' will now install all outputs listed in the package's meta.outputsToInstall attribute, or all outputs if that attribute doesn't exist. This makes it behave consistently with nix-env. Fixes #6385. Furthermore, for consistency, all other 'nix' commands do this as well. E.g. 'nix build' will build and symlink the outputs in meta.outputsToInstall, defaulting to all outputs. Previously, it only built/symlinked the first output. Note that this means that selecting a specific output using attrpath selection (e.g. 'nix build nixpkgs#libxml2.dev') no longer works. A subsequent PR will add a way to specify the desired outputs explicitly.
2022-04-22Merge remote-tracking branch 'origin/master' into nixbuildaddprintstorepathsThéophane Hufschmitt
2022-04-22Merge pull request #6218 from pennae/pos-symbol-tablesThéophane Hufschmitt
reduce the size of Attr from 3 pointers to 2 on 64 bit machines
2022-04-22Merge pull request #6436 from flox/tofile_allowThéophane Hufschmitt
fix: builtins.toFile adds path to allowedPaths
2022-04-21fix: builtins.toFile adds path to allowedPathsTom Bereknyei
The produced path is then allowed be imported or utilized elsewhere: ``` assert (43 == import (builtins.toFile "source" "43")); "good" ``` This will still fail on write-only stores.
2022-04-21replace most Pos objects/ptrs with indexes into a position tablepennae
Pos objects are somewhat wasteful as they duplicate the origin file name and input type for each object. on files that produce more than one Pos when parsed this a sizeable waste of memory (one pointer per Pos). the same goes for ptr<Pos> on 64 bit machines: parsing enough source to require 8 bytes to locate a position would need at least 8GB of input and 64GB of expression memory. it's not likely that we'll hit that any time soon, so we can use a uint32_t index to locate positions instead.
2022-04-21tests: remove 'ca-references' featureSergei Trofimovich
The feature was ctabilized in d589a6aa8a5d0c9f391400d7e0e209106e89c857.
2022-04-21Disable the selfref-gc test when the daemon is too oldregnat
2022-04-21nix: add (failing) selfreference test for multiple realizationsSergei Trofimovich
The test illustrates failure in issue #5320. Here derivation and it's built input have identical CA sotre path. As a result we generate extraneout reference to build input: $ make installcheck ... ran test tests/selfref-gc.sh... [PASS] ran test tests/ca/selfref-gc.sh... [FAIL] ... deleting '/tmp/.../tests/ca/selfref-gc/store/iqciq1mpg5hc7p6a52fp2bjxbyc9av0v-selfref-gc' deleting '/tmp/...tests/ca/selfref-gc/store/zh0kwpnirw3qbv6dl1ckr1y0kd5aw6ax-selfref-gc.drv' error: executing SQLite statement 'delete from ValidPaths where path = '/tmp/.../tests/ca/selfref-gc/store/fsjq0k146r85lsh01l0icl30rnhv7z72-selfref-gc';': constraint failed (in '/tmp/.../tests/ca/selfref-gc/var/nix/db/db.sqlite')
2022-04-20nix build: add --print-out-paths flagArtturin
has the same functionality as default nix-build $ nix-build . -A "bash" -A "bash.dev" -A "tinycc" /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 /nix/store/c49i1ggnr5cc8gxmk9xm0cn961z104dn-bash-5.1-p12-dev /nix/store/dbapb08862ajgaax3621fz8hly9fdah3-tcc-0.9.27+date=2022-01-11 $ nix-build . -A "bash" /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 $ $HOME/nixgits/nix/result/bin/nix build "nixpkgs#bash" "nixpkgs#bash.dev" "nixpkgs#tinycc" --print-out-paths /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 /nix/store/c49i1ggnr5cc8gxmk9xm0cn961z104dn-bash-5.1-p12-dev /nix/store/dbapb08862ajgaax3621fz8hly9fdah3-tcc-0.9.27+date=2022-01-11 $ $HOME/nixgits/nix/result/bin/nix build "nixpkgs#bash" --print-out-paths /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12
2022-04-20nix repl: make symlinks with the :bl commandckie
Requested by ppepino on the Matrix: https://matrix.to/#/!KqkRjyTEzAGRiZFBYT:nixos.org/$Tb32BS3rVE2BSULAX4sPm0h6CDewX2hClOTGzTC7gwM?via=nixos.org&via=matrix.org&via=nixos.dev This adds a new command, :bl, which works like :b but also creates a GC root symlink to the various derivation outputs. ckie@cookiemonster ~/git/nix -> ./outputs/out/bin/nix repl Welcome to Nix 2.6.0. Type :? for help. nix-repl> :l <nixpkgs> Added 16118 variables. nix-repl> :b runCommand "hello" {} "echo hi > $out" This derivation produced the following outputs: ./repl-result-out -> /nix/store/kidqq2acdpi05c4a9mlbg2baikmzik44-hello [1 built, 0.0 MiB DL] ckie@cookiemonster ~/git/nix -> cat ./repl-result-out hi
2022-04-19Fix 'nix fmt' testEelco Dolstra
2022-04-19Require formatters to be packagesEelco Dolstra
Because of 9b41239d8fdcc3fe50febe718c15833ebc224354, a formatter can no longer be a package *or* an app. So let's require it to be a package for now.
2022-04-19Merge branch 'issue-6075' of https://github.com/kamadorueda/nixEelco Dolstra
2022-04-19Fix compilation, style fixesEelco Dolstra