John Ericson
da64f026dd
Make clear that StorePathWithOutputs is a deprecated type
...
- Add a comment
- Put `OutputsSpec` in a different header (First part of #6815 )
- Make a few stray uses of it in new code use `DerivedPath` instead.
2023-01-10 11:27:19 -05:00
Eelco Dolstra
59cc920cc0
Add a FIXME
2023-01-10 15:20:30 +01:00
Eelco Dolstra
7f1af270dd
Clean up toDerivedPaths() logic
2023-01-10 15:08:46 +01:00
Eelco Dolstra
1123c42f90
Apply suggestions from code review
...
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2023-01-10 14:57:35 +01:00
Eelco Dolstra
b4dc68f0be
Show string in error message
2023-01-10 14:56:03 +01:00
Eelco Dolstra
b80e4b57da
ExtraInfo -> ExtraPathInfo
2023-01-10 14:52:49 +01:00
Eelco Dolstra
8e923bf4c5
Merge remote-tracking branch 'origin/master' into fix-7417
2023-01-10 14:35:06 +01:00
Will Bush
05b13aff3d
Fix typo in example for builtin function map
2023-01-06 23:04:43 -06:00
John Ericson
81727f85cb
Merge branch 'path-info' into ca-drv-exotic
2023-01-06 15:45:34 -05:00
John Ericson
46e942ff9e
Do big rename to clean up code
...
- `PathReferences` -> `References`
- `PathReferences<StorePath>` -> `StoreReference`
- `references` -> `others`
- `hasSelfReference` -> `self`
And get rid of silly subclassing
2023-01-06 15:36:05 -05:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Valentin Gagarin
9cdf8ededb
remove redundant re-definition of store derivations
2023-01-02 13:37:59 +01:00
Théophane Hufschmitt
cfd6c7fc9b
Merge pull request #7485 from fricklerhandwerk/doc-store-derivation
...
define "store derivation"
2023-01-02 13:26:41 +01:00
Théophane Hufschmitt
b3285c7722
Merge pull request #7351 from NaN-git/fix-mkString
...
cleanup eval.hh/eval.cc
2023-01-02 11:41:52 +01:00
Théophane Hufschmitt
e8a3e58171
Merge pull request #7521 from ncfavier/migration-deadlock
...
Release shared lock before acquiring exclusive lock
2023-01-02 11:08:43 +01:00
Steven Shaw
84b0893725
Fix error message
2023-01-01 12:37:43 +10:00
Eelco Dolstra
8c52f8ea9d
Merge pull request #7524 from ncfavier/sandbox-paths-closure
...
doc: sandbox-paths computes closures
2022-12-29 19:45:51 +01:00
Eelco Dolstra
8227fe819e
Merge pull request #7504 from edolstra/nix-develop-personality
...
nix develop: Set personality
2022-12-29 19:42:45 +01:00
Naïm Favier
d5d2f50ebb
doc: sandbox-paths computes closures
2022-12-28 17:09:20 +01:00
Naïm Favier
81c3f99b36
Release shared lock before acquiring exclusive lock
...
In principle, this should avoid deadlocks where two instances of Nix are
holding a shared lock on big-lock and are both waiting to get an
exclusive lock.
However, it seems like `flock(2)` is supposed to do this automatically,
so it's not clear whether this is actually where the problem comes from.
2022-12-27 15:58:14 +01:00
Robert Hensing
336908cf4c
Optimize intersectAttrs performance
...
Always traverse the shortest set.
2022-12-24 14:51:05 +01:00
Robert Hensing
aba6eb348e
libstore: Make sure that initNix has been called
...
Prevent bugs like https://github.com/cachix/cachix/pull/477
2022-12-24 14:39:30 +01:00