aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-21Merge pull request #5479 from NixOS/selfref-caThéophane Hufschmitt
Fix the removal of ca-induced self-references
2022-04-21Merge pull request #6324 from trofi/selfref-ca-indexThéophane Hufschmitt
ca: add sqlite index on `RealisationsRefs(realisationReference)`
2022-04-21Make sure to delete all the realisation refsregnat
Deleting just one will only work in the test cases where I didn’t bother creating too many of them :p
2022-04-21ca: add sqlite index on `RealisationsRefs(realisationReference)`Sergei Trofimovich
Without the change any CA deletion triggers linear scan on large RealisationsRefs table: sqlite>.eqp full sqlite> delete from RealisationsRefs where realisationReference IN ( select id from Realisations where outputPath = 1234567890 ); QUERY PLAN |--SCAN RealisationsRefs `--LIST SUBQUERY 1 `--SEARCH Realisations USING COVERING INDEX IndexRealisationsRefsOnOutputPath (outputPath=?) With the change it gets turned into a lookup: sqlite> CREATE INDEX IndexRealisationsRefsRealisationReference on RealisationsRefs(realisationReference); sqlite> delete from RealisationsRefs where realisationReference IN ( select id from Realisations where outputPath = 1234567890 ); QUERY PLAN |--SEARCH RealisationsRefs USING INDEX IndexRealisationsRefsRealisationReference (realisationReference=?) `--LIST SUBQUERY 1 `--SEARCH Realisations USING COVERING INDEX IndexRealisationsRefsOnOutputPath (outputPath=?)
2022-04-21Disable the selfref-gc test when the daemon is too oldregnat
2022-04-21tests: remove 'ca-references' featureSergei Trofimovich
The feature was ctabilized in d589a6aa8a5d0c9f391400d7e0e209106e89c857.
2022-04-21Fix the gc with indirect self-references via the realisationsregnat
If the derivation `foo` depends on `bar`, and they both have the same output path (because they are CA derivations), then this output path will depend both on the realisation of `foo` and of `bar`, which themselves depend on each other. This confuses SQLite which isn’t able to automatically solve this diamond dependency scheme. Help it by adding a trigger to delete all the references between the relevant realisations. Fix #5320
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-21Make the default SQLiteError constructor publicThéophane Hufschmitt
Otherwise the clang builds fail because the constructor of `SQLiteBusy` inherits it, `SQLiteError::_throw` tries to call it, which fails. Strangely, gcc works fine with it. Not sure what the correct behavior is and who is buggy here, but either way, making it public is at the worst a reasonable workaround
2022-04-21Merge pull request #6430 from NixOS/missing-realisation-error-messageEelco Dolstra
Fix the error message in case of a missing realisation
2022-04-21Fix the error message in case of a missing realisationThéophane Hufschmitt
Don’t say that the derivation is CA as it might happen on a non-ca derivation too. Technically we could always recover _something_ for a purely input-addressed derivation (like we already do when the `ca-derivations` xp feature isn’t enabled), but it seems better to consistently fail − the end-result wouldn’t really make sense anyways in most cases.
2022-04-20Merge pull request #3720 from obsidiansystems/fix-url-formatThéophane Hufschmitt
Avoid `fmt` when constructor already does it
2022-04-20Actually, solve this in a lighter-weight wayJohn Ericson
The templating is very superficial
2022-04-20Move templated functions to `sqlite-impl.hh`John Ericson
This ensures that use-sites properly trigger new monomorphisations on one hand, and on the other hand keeps the main `sqlite.hh` clean and interface-only. I think that is good practice in general, but in this situation in particular we do indeed have `sqlite.hh` users that don't need the `throw_` function.
2022-04-20Merge remote-tracking branch 'upstream/master' into fix-url-formatJohn Ericson
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-20Merge pull request #6425 from yorickvP/fix-6424Théophane Hufschmitt
Add custom to_json and from_json functions for ExperimentalFeature
2022-04-20Add custom to_json and from_json functions for ExperimentalFeatureYorick van Pelt
nix show-config --json was serializing experimental features as ints. nlohmann::json will automatically use these definitions to serialize and deserialize ExperimentalFeatures. Strictly, we don't use the from_json instance yet, it's provided for completeness and hopefully future use.
2022-04-20Merge pull request #6419 from ckiee/repl-build-symlinkEelco Dolstra
nix repl: make symlinks with the :bl command
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-19Bump versionEelco Dolstra
2022-04-19Fix 'nix fmt' testEelco Dolstra
2022-04-19Move rl-next.md to rl-2.8.mdEelco 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-19Merge pull request #6128 from ncfavier/fix-completionEelco Dolstra
Shell completion improvements
2022-04-19Fix compilation, style fixesEelco Dolstra
2022-04-19Merge branch 'make-flake-show-more-lenient-on-apps' of ↵Eelco Dolstra
https://github.com/flox/nix
2022-04-19Merge pull request #6415 from aakropotkin/doc.connect-timeout.defaultEelco Dolstra
doc: document nix.conf connect-timeout default
2022-04-19Merge pull request #6404 from edolstra/unify-flake-attr-evalEelco Dolstra
Make InstallableFlake::toValue() and toDerivation() behave consistently
2022-04-19Merge pull request #6418 from rycee/doc/tgz-tarballEelco Dolstra
Add .tgz as tarball extension in documentation
2022-04-19Avoid `fmt` when constructor already does itJohn Ericson
There is a correctnes issue here, but #3724 will fix that. This is just a cleanup for brevity's sake.
2022-04-18Add .tgz as tarball extension in documentationRobert Helgesson
Support for the `tgz` shorthand was added in 52f5fa948a4784b6a9b707770f4beee6a8674dee.
2022-04-17doc: rephrase connect-timeout help messageAlex Ameen
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-04-17doc: document nix.conf connect-timeout defaultAlex Ameen
2022-04-15Merge branch 'master' into debug-exploratory-PRBen Burdette
2022-04-15Merge pull request #6323 from erikarvstedt/eval-read-onlyEelco Dolstra
`nix eval`: Add option `--read-only`
2022-04-14fix: ensure apps are apps and packages are packagesTom Bereknyei
2022-04-14Merge pull request #6387 from Uthar/fixEelco Dolstra
assert hash types for Git and Mercurial
2022-04-14feat: include openssh in docker imageJairo Llopis
When leveraging remote builders or cache in CI workloads, sometimes you need to configure nix to connect via SSH to a remote server. It is the case for example when using nixbuild.net. By including `openssh` package, CI should be able to reach remote builders when configured i.e. with environment variables.
2022-04-14Make InstallableFlake::toValue() and toDerivation() behave consistentlyEelco Dolstra
In particular, this means that 'nix eval` (which uses toValue()) no longer auto-calls functions or functors (because AttrCursor::findAlongAttrPath() doesn't). Fixes #6152. Also use ref<> in a few places, and don't return attrpaths from getCursor() because cursors already have a getAttrPath() method.
2022-04-13Merge pull request #6213 from NixOS/dependabot/github_actions/actions/checkout-3Eelco Dolstra
Bump actions/checkout from 2 to 3
2022-04-13Bump actions/checkout from 2 to 3dependabot[bot]
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
2022-04-13Merge pull request #6401 from ↵Eelco Dolstra
NixOS/dependabot/github_actions/cachix/install-nix-action-17 build(deps): bump cachix/install-nix-action from 16 to 17
2022-04-12assert hash types for Git and MercurialKasper Gałkowski
2022-04-11build(deps): bump cachix/install-nix-action from 16 to 17dependabot[bot]
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 16 to 17. - [Release notes](https://github.com/cachix/install-nix-action/releases) - [Commits](https://github.com/cachix/install-nix-action/compare/v16...v17) --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11Merge pull request #6392 from danpls/fix-actualUrl-mercurialEelco Dolstra
libfetchers: Fix assertion (Mercurial)
2022-04-11Merge pull request #6384 from ↵Eelco Dolstra
mschwaig/confirm-multi-user-install-without-systemd installer: ask for confirmation on multi-user install without systemd
2022-04-11Merge pull request #6380 from thufschmitt/fix-double-slahsh-in-uriEelco Dolstra
Allow empty path segments in urls
2022-04-11Merge pull request #6391 from danpls/replace-regexEelco Dolstra
libfetchers: Replace regex to clarify intent