Commit graph

14558 commits

Author SHA1 Message Date
Valentin Gagarin a78f929065 fix anchor link 2023-06-21 09:43:22 +02:00
Valentin Gagarin 71317162c5 use more self-descriptive section headings 2023-06-20 13:44:43 +02:00
Ben Radford 6ae35534b7
Support opening local store with database on read-only filesystem (#8356)
Previously it was not possible to open a local store when its database is on a read-only filesystem. Obviously a store on a read-only filesystem cannot be modified, but it would still be useful to be able to query it.

This change adds a new read-only setting to LocalStore. When set to true, Nix will skip operations that fail when the database is on a read-only filesystem (acquiring big-lock, schema migration, etc), and the store database will be opened in immutable mode.

Co-authored-by: Ben Radford <benradf@users.noreply.github.com>
Co-authored-by: cidkidnix <cidkidnix@protonmail.com>
Co-authored-by: Dylan Green <67574902+cidkidnix@users.noreply.github.com>
Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-06-20 11:34:09 +02:00
Silvan Mosberger 3910430b9d
Add more links in nix-build documentation (#8545)
* Add more links in nix-build documentation


Co-authored-by: John Ericson <git@JohnEricson.me>
2023-06-19 21:00:49 +02:00
Robert Hensing 3ee86307ab
Merge pull request #8547 from obsidiansystems/proto-cleanup-prep
Make a few changes in prepartion for deeper cleanup of the remote protocols
2023-06-19 20:56:24 +02:00
John Ericson 3859cf6b21 Remove unused #include from local-derivation-goal.cc
These were never needed for this file, and date back to before this was
split from `derivation-goal.cc`.
2023-06-19 12:18:04 -04:00
John Ericson 9f69b7dee9 Create worker_proto::{Read,Write}Conn
Pass this around instead of `Source &` and `Sink &` directly. This will
give us something to put the protocol version on once the time comes.

To do this ergonomically, we need to expose `RemoteStore::Connection`,
so do that too. Give it some more API docs while we are at it.
2023-06-19 12:08:23 -04:00
John Ericson 4e8b495ad7 Likewise namespace and enum struct-ify ServeCommand
The motivation is exactly the same as for the last commit. In addition,
this anticipates us formally defining separate serialisers for the serve
protocol.
2023-06-19 12:08:23 -04:00
John Ericson 95eae0c002 Put worker protocol items inside a WorkerProto struct
See API docs on that struct for why. The pasing as as template argument
doesn't yet happen in that commit, but will instead happen in later
commit.

Also make `WorkerOp` (now `Op`) and enum struct. This led us to catch
that two operations were not handled!

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-06-19 12:08:23 -04:00
John Ericson 469d06f9bc Split out worker protocol template definitions from declarations
This is generally a fine practice: Putting implementations in headers
makes them harder to read and slows compilation. Unfortunately it is
necessary for templates, but we can ameliorate that by putting them in a
separate header. Only files which need to instantiate those templates
will need to include the header with the implementation; the rest can
just include the declaration.

This is now documenting in the contributing guide.

Also, it just happens that these polymorphic serializers are the
protocol agnostic ones. (Worker and serve protocol have the same logic
for these container types.) This means by doing this general template
cleanup, we are also getting a head start on better indicating which
code is protocol-specific and which code is shared between protocols.
2023-06-19 11:45:59 -04:00
Eelco Dolstra f5e620bf2b
Merge pull request #8483 from edolstra/save-root
restoreMountNamespace(): Restore the original root directory
2023-06-19 12:54:05 +02:00
Eelco Dolstra 49288d6e40
Merge pull request #8542 from NixOS/maintainers-draft-prs
maintainers: add note on marking PRs as draft
2023-06-19 12:47:06 +02:00
Eelco Dolstra 0a80db5112
Merge pull request #8541 from NixOS/contributing-good-first-issues
CONTRIBUTING.md: add link to "good first issues"
2023-06-19 12:46:42 +02:00
Valentin Gagarin b6e74ea5a8
maintainers: add note on marking PRs as draft
as discussed with maintainers team
2023-06-19 10:55:34 +02:00
Valentin Gagarin 966e5dc991
CONTRIBUTING.md: add link to "good first issues" 2023-06-19 10:39:19 +02:00
Eelco Dolstra 8f6255b86a
Merge pull request #8524 from amjoseph-nixpkgs/pr/doc/linkify-allowed-uris
src/libexpr/eval.hh: add link for allowed-uris option
2023-06-19 06:59:07 +02:00
John Ericson c404623a1d
Clean up a few things related to profiles (#8526)
- Greatly expand API docs

- Clean up code in misc ways

  - Instead of a complicated single loop on generations, do different
    operations in successive subsequent steps.

  - Avoid `ref` in one place where `&` is fine

  - Just return path instead of mutating an argument in `makeName`

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-06-19 04:04:59 +00:00
Valentin Gagarin 7bf17f8825
Add description for file system objects (#8500)
While this is not actually a notion in the implementation, it is
explicitly described in the thesis and quite important for understanding
how the store works.

Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-06-18 23:45:08 -04:00
John Ericson 60d81b5163
Merge pull request #8472 from NixOS/nix-language-purpose
Refine wording on the purpose of the Nix language
2023-06-18 23:38:05 -04:00
Adam Joseph 6b06e97bde src/libexpr/eval.hh: add link for allowed-uris option
This commit adds a link to the documentation for `--option
allowed-uris` where that option is mentioned while describing
`restrict-eval`.
2023-06-18 23:36:32 -04:00
Domen Kožar 3b0d8fd796
Merge pull request #8534 from ncfavier/ci
ci: bump install-nix-action, don't fail fast
2023-06-17 16:53:50 +01:00
Naïm Favier b931d83550
ci: bump install-nix-action, don't fail fast 2023-06-17 15:05:10 +02:00
Christina Sørensen 741f7837f8
Fix wikipedia links (#8533) 2023-06-17 09:06:17 +00:00
Eelco Dolstra e503eadafc
Merge pull request #8477 from edolstra/tarball-flake-redirects
Tarball flake improvements
2023-06-16 18:03:50 +02:00
Eelco Dolstra b1ed9b4b0c
Apply suggestions from code review
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-06-16 16:48:37 +02:00
Eelco Dolstra cab03fb779 Add docs 2023-06-16 15:58:42 +02:00
Eelco Dolstra 713836112c
Merge pull request #8517 from hercules-ci/fix-build-hook-error-for-lib-users
Fix build hook error for libstore library users
2023-06-16 13:20:50 +02:00
Eelco Dolstra 09320140b5
Merge pull request #8525 from tweag/fix-i686-build
Don't assume the type of string::size_type
2023-06-16 13:15:46 +02:00
Théophane Hufschmitt b2247ef4f6 Don't assume the type of string::size_type
The code accidentally conflated `std::string::size_type` and `long unsigned int`.
This was fine on 64bits machines where they are apparently the same in
practice, but not on 32bits. Fix that by using `std::string::size_type`
everywhere.
2023-06-15 21:24:14 +02:00
Robert Hensing d2696cdd1e Fix build hook error for libstore library users
A library shouldn't require changes to the caller's argument handling,
especially if it doesn't have to, and indeed we don't have to.

This changes the lookup order to prioritize the hardcoded path to nix
if it exists. The static executable still finds itself through /proc
and the like.
2023-06-15 14:32:00 +02:00
John Ericson e672d52f7c
Merge pull request #8512 from scarf005/install-show-uid
build: show UID and GID in welcome message
2023-06-15 13:49:44 +02:00
John Ericson 71e53c0c6a
Merge pull request #8522 from amjoseph-nixpkgs/pr/allowed-uris/typo
src/libexpr/eval.hh: fix typo
2023-06-15 13:20:42 +02:00
scarf 80451b762d
style: use plurals in uid ranges
Co-authored-by: John Ericson <git@JohnEricson.me>
2023-06-15 14:47:18 +09:00
Adam Joseph 098fbf6273 src/libexpr/eval.hh: fix typo
The option name is `allowed-uris`, not `allowed-uri`.
2023-06-14 21:47:58 -07:00
John Ericson 2e47e53953
Merge pull request #8521 from fricklerhandwerk/issue-templates
docs issue template: move checklist down
2023-06-15 03:47:31 +02:00
John Ericson d11faa01b5
Merge pull request #8520 from fricklerhandwerk/rename-antiquote-tests
Rename files referring to antiquotation
2023-06-15 03:44:42 +02:00
Valentin Gagarin c3c4076342 make domain-specificity more specific
also slightly reword the purpose statement to introduce (and explain)
derivations right away.
2023-06-15 03:08:07 +02:00
Valentin Gagarin 520491607e docs issue template: move checklist down
it's annoying to write issues with the checklist in the way, and the
proposal is more important.
2023-06-15 02:31:49 +02:00
Valentin Gagarin c453719d6e rename files referring to antiquotation
since we renamed this to string interpolation, file names should be
fixed up as well
2023-06-15 02:29:31 +02:00
scarf 4b487317c3
style: use mathematical interval notation 2023-06-15 08:52:34 +09:00
John Ericson 946cd9e3f9
Merge pull request #8351 from obsidiansystems/delete-profiles-tests-docs
Expanding tests and docs relating to deleting profiles
2023-06-15 01:47:21 +02:00
John Ericson ca9f544160
Merge pull request #8516 from wentasah/remove-registerprimop
Remove RegisterPrimOp constructor without support for documentation
2023-06-15 01:13:46 +02:00
John Ericson 5b7e285727 Improve nix-collect-garbage docs
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-06-14 19:01:08 -04:00
John Ericson b55f26c65f Improve nix-env --delete-generations docs
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-06-14 19:01:08 -04:00
John Ericson d4a2ced9cb Split out nix-collect-garbage -d test to new file
Good for test parallelism, and separation of concerns (core GC vs
profiles deleting).
2023-06-14 19:01:07 -04:00
John Ericson ca5752d4fa Add another case to the nix-collect-garbage -d test 2023-06-14 19:01:07 -04:00
Valentin Gagarin a1cf16563f
Fixup description of substituters (#8291)
Introduce what substituters "are" in the configuration option entry.
Remove arbitrary line breaks for easier editing in the future.
Link glossary some more.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: John Ericson <git@JohnEricson.me>
2023-06-14 20:49:58 +00:00
Michal Sojka a0c4d58549 Remove RegisterPrimOp constructor without support for documentation
The remaining constructor RegisterPrimOp::RegisterPrimOp(Info && info)
allows specifying the documentation in .args and .doc members of the
Info structure.

Commit 8ec1ba0210 removed all uses of the removed constructor in the
nix binary. Here, we remove the constructor completely as well as its
use in a plugin test. According to #8515, we didn't promis to maintain
compatibility with external plugins.

Fixes #8515
2023-06-14 22:37:52 +02:00
John Ericson 05eb06a1de
Merge pull request #8490 from flox/stdin_handling
fix: Do not apply default installables when using --stdin
2023-06-14 20:41:22 +02:00
John Ericson 37bffbc28f
Merge pull request #8488 from Mic92/update-requirements
nix actually needs c++20 now
2023-06-14 20:37:52 +02:00