Commit graph

14805 commits

Author SHA1 Message Date
John Ericson
7e1cfa97c6 Make derivation primop code for fixed output more concise 2023-01-06 12:52:16 -05:00
John Ericson
848b0832b5 Merge branch 'path-info' into ca-drv-exotic 2023-01-06 12:39:14 -05:00
John Ericson
9cfa78e58a Optimize ValidPathInfo construction a bit better 2023-01-06 12:26:15 -05:00
John Ericson
6a168254ce Use named field initialization for references 2023-01-06 12:24:20 -05:00
John Ericson
85ceaadbfd Merge branch 'path-info' into ca-drv-exotic 2023-01-06 11:19:20 -05:00
John Ericson
8623143921 Make formatting consistent 2023-01-06 11:18:14 -05:00
John Ericson
989b8065b4 Merge branch 'path-info' into ca-drv-exotic 2023-01-06 10:56:22 -05:00
John Ericson
e9fc1e4fdb Merge remote-tracking branch 'upstream/master' into path-info 2023-01-06 10:35:20 -05:00
Eelco Dolstra
3172c51baf
Merge pull request #7498 from fricklerhandwerk/path+string
refactor documentation of operators, document `+` for strings and paths
2023-01-06 13:46:31 +01:00
Théophane Hufschmitt
8d88c3b347
Merge pull request #7307 from hercules-ci/derivation-goal-improve-comment
libstore/derivation-goal: Elaborate a TODO for performance concern
2023-01-06 13:07:57 +01:00
Eelco Dolstra
420ccecc1e
Merge pull request #7557 from NixOS/fix-7529
On macOS with auto-uid-allocation and sandboxing, use the correct gid
2023-01-06 12:35:55 +01:00
Théophane Hufschmitt
1a4a02cff9
Merge pull request #7559 from ncfavier/no-check-modules
Don't check NixOS modules
2023-01-05 21:53:46 +01:00
Naïm Favier
f1ee4ece80
Don't check NixOS modules
NixOS modules can be paths. Rather than dig further down into the layer
violation, don't check anything specific to NixOS modules.
2023-01-05 18:23:30 +01:00
Eelco Dolstra
d02c5a41da
Merge pull request #7500 from akhildevelops/patch-1
Updated docs to delete build users and group
2023-01-05 17:25:06 +01:00
Eelco Dolstra
3a98107170
Merge pull request #7542 from edolstra/gc-deadlock
Fix deadlock between auto-GC and addTempRoot()
2023-01-05 17:08:23 +01:00
Eelco Dolstra
0fe2b222d5
Merge pull request #7539 from tweag/fix-nix-why-depends--derivation
Fix `nix why-depends --derivation`
2023-01-05 15:32:04 +01:00
Valentin Gagarin
e57165b85a bring back table, extract annotations
this makes the table less unwieldy, and leaves enough space for
extensive explanations.
2023-01-05 15:16:16 +01:00
Valentin Gagarin
7da59e94ae add links to documentation for data types 2023-01-05 14:15:01 +01:00
Valentin Gagarin
7b2b9e3648 use more self-explanatory placeholder names 2023-01-05 14:15:01 +01:00
Valentin Gagarin
969e5ad5bf add semantics of overloaded + operator 2023-01-05 14:15:01 +01:00
Valentin Gagarin
63b640e0c2 reword descriptions of operators
add notes on semantics where appropriate
2023-01-05 14:15:01 +01:00
Valentin Gagarin
e07448ba6b convert table to subsections
this form is much easier to maintain (also with minimal diffs), and
allows for more details on each operator.

this change a purely mechanical transformation, without changing any contents.
2023-01-05 14:15:01 +01:00
Valentin Gagarin
caebe4112e reorder columns
this is for a simpler transformation into a series of subsections
2023-01-05 14:15:01 +01:00
Eelco Dolstra
4e84b532ed On macOS with auto-uid-allocation and sandboxing, use the correct gid
macOS doesn't have user namespacing, so the gid of the builder needs
to be nixbld. The logic got "has sandboxing enabled" confused with
"has user namespaces".

Fixes #7529.
2023-01-05 04:58:55 -08:00
Eelco Dolstra
d644b45615
Merge pull request #7551 from NixOS/macos-sandbox-files
Include macOS sandbox files in the Nix binary
2023-01-05 13:34:17 +01:00
Eelco Dolstra
6991e558dd Move macOS sandbox files to sr/libstore/build 2023-01-04 04:50:45 -08:00
Eelco Dolstra
609a7dc059 Include macOS sandbox files in the Nix binary
This basically reverts 6e5165b773.
It fixes errors like

  sandbox-exec: <internal init prelude>:292:47: unable to open sandbox-minimal.sb: not found

when trying to run a development Nix installed in a user's home
directory.

Also, we're trying to minimize the number of installed files
to make it possible to deploy Nix as a single statically-linked
binary.
2023-01-04 04:36:07 -08:00
Alexandre Thomas
49e058f1cf Fix Nix installation on older versions of fish
The `fish_add_path` function is only available for fish 3.2.0 or newer,
and not on older versions.
This commit adds an alternative way to update the PATH when
`fish_add_path` does not exist.
2023-01-03 21:14:01 +01:00
Naïm Favier
3c968191f1
move unsafeDiscardReferences out of outputChecks
It's not a check.
2023-01-03 18:53:01 +01:00
Eelco Dolstra
d4d1ca8b11 nix --version: Print the data directory 2023-01-03 08:30:49 -08:00
Naïm Favier
15f7fa59be
unsafeDiscardReferences
Adds a new boolean structured attribute
`outputChecks.<output>.unsafeDiscardReferences` which disables scanning
an output for runtime references.

    __structuredAttrs = true;
    outputChecks.out.unsafeDiscardReferences = true;

This is useful when creating filesystem images containing their own embedded Nix
store: they are self-contained blobs of data with no runtime dependencies.

Setting this attribute requires the experimental feature
`discard-references` to be enabled.
2023-01-03 17:19:16 +01:00
Eelco Dolstra
28d5b5cd45 Fix deadlock between auto-GC and addTempRoot()
Previously addTempRoot() acquired the LocalStore state lock and waited
for the garbage collector to reply. If the garbage collector is in the
same process (as it the case with auto-GC), this would deadlock as
soon as the garbage collector thread needs the LocalStore state lock.

So now addTempRoot() uses separate Syncs for the state that it
needs. As long at the auto-GC thread doesn't call addTempRoot() (which
it shouldn't), it shouldn't deadlock.

Fixes #3224.
2023-01-03 15:20:21 +01:00
Eelco Dolstra
224b56f10e Move creation of the temp roots file into its own function
This also moves the file handle into its own Sync object so we're not
holding the _state while acquiring the file lock. There was no real
deadlock risk here since locking a newly created file cannot block,
but it's still a bit nicer.
2023-01-03 14:51:23 +01:00
Valentin Gagarin
9cb1610257 define the terms "realise" and "valid" for store paths
add links to the glossary definition where the terms are used
2023-01-03 13:53:53 +01:00
Eelco Dolstra
15341334b5
Merge pull request #7516 from NixOS/dependabot/github_actions/zeebe-io/backport-action-1.0.1
Bump zeebe-io/backport-action from 0.0.9 to 1.0.1
2023-01-03 12:44:42 +01:00
Eelco Dolstra
ae31b5f50f
Merge pull request #7497 from rski/master
src/libstore: Print the reason opening the DB failed
2023-01-03 12:44:14 +01:00
Eelco Dolstra
a75b7ba30f
Merge pull request #6204 from layus/coerce-string
Add context to better locate runtime coercions
2023-01-02 22:35:23 +01:00
Eelco Dolstra
d33d15a48b Put the --show-trace hint in the logical place 2023-01-02 20:53:58 +01:00
Eelco Dolstra
c548e35498 Don't use state.positions[noPos]
This caused traces 'at «none»:0: (source not available)'.
2023-01-02 20:53:58 +01:00
Eelco Dolstra
6b69652385 Merge remote-tracking branch 'origin/master' into coerce-string 2023-01-02 20:53:39 +01:00
Théophane Hufschmitt
8cac451fce Fix why-depends for CA derivations (again)
This has the same goal as b13fd4c58e81b2b2b0d72caa5ce80de861622610,but
achieves it in a different way in order to not break
`nix why-depends --derivation`.
2023-01-02 17:42:22 +01:00
Théophane Hufschmitt
6a90ef072c Increase the test coverage of why-depends
- Test with `--derivation`
- Actually test with ca-derivations (was suuposedly done, but not
  activated because of a missing line in `local.mk`)
2023-01-02 16:09:03 +01:00
Théophane Hufschmitt
105d74eb81 Revert "Fix why-depends for CA derivations"
This reverts commit b13fd4c58e.
2023-01-02 15:44:04 +01:00
Théophane Hufschmitt
9af16c5f74
Merge pull request #5941 from hercules-ci/optimize-intersectAttrs
Optimize intersectAttrs performance
2023-01-02 15:22:38 +01:00
Théophane Hufschmitt
9c05b80db0
Merge pull request #7426 from tianyuanhao/master
Avoid poly_user_note_set twice
2023-01-02 15:15:47 +01:00
Théophane Hufschmitt
34a31b33f1
Merge pull request #7278 from fricklerhandwerk/antiquotation
antiquotation -> string interpolation
2023-01-02 15:03:45 +01:00
Théophane Hufschmitt
a654ae8269
Merge pull request #7066 from fricklerhandwerk/architecture-overview
manual: architecture overview
2023-01-02 14:42:01 +01:00
Valentin Gagarin
e0c4a95611 antiquotation -> string interpolation
as proposed by @mkaito[1] and @tazjin[2] and discussed with @edolstra
and Nix maintainers

[1]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270076332
[2]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270201979

Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2023-01-02 14:38:57 +01:00
Eelco Dolstra
80a0f77e49
Merge pull request #7470 from obsidiansystems/simplify-tests-slightly
Make `./mk/run-test.sh` work by itself; add `mk/debug-test.sh`
2023-01-02 14:14:30 +01:00
Théophane Hufschmitt
fb8fc6fda6
Merge pull request #7478 from hercules-ci/make-sure-initNix-called
libstore: Make sure that initNix has been called
2023-01-02 14:12:49 +01:00