John Ericson
c67e0cc58c
Merge remote-tracking branch 'upstream/master' into path-info
2023-01-23 11:47:20 -05:00
John Ericson
018e2571aa
Test store paths, with property tests
...
The property test in fact found a bug: we were excluding numbers!
2023-01-23 07:05:50 -05:00
John Ericson
685395332d
Better-scope Store
forward declarations
2023-01-23 07:05:50 -05:00
John Ericson
7fe308c2f8
Add rapidcheck
dependency for testing
...
Property tests are great!
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2023-01-23 07:05:50 -05:00
Eelco Dolstra
75c89c3e5e
Add test for OutputsSpec::Names
...
From @Ericson2314.
2023-01-18 16:34:37 +01:00
Eelco Dolstra
95cfd50d25
OutputSpec: Allow all valid output names
...
Fixes #7624 .
2023-01-18 14:14:29 +01:00
John Ericson
3965b0f75f
Try again to fix aarch64-linux build failure
...
f419ab48e6
was on the right track, but
there are a few more missing `raw()` calls to fix.
2023-01-17 09:14:17 -05:00
John Ericson
f419ab48e6
Try to fix build failure
...
Failure: https://hydra.nixos.org/build/205357257/nixlog/1
The problem seems to be trying to `std::visit` a derived class of
`std::variant`. Per
https://stackoverflow.com/questions/63616709/incomplete-type-stdvariant-used-in-nested-name-specifier
certain C++ standard library implementations allow this, but others do
not.
The solution is simply to call the `raw` method, which upcasts the
reference back to the `std::variant`.
2023-01-15 15:16:14 -05:00
John Ericson
b3d91239ae
Make ValidPathInfo
have plain StorePathSet
references like before
...
This change can wait for another PR.
2023-01-14 16:42:03 -05:00
John Ericson
056cc1c1b9
Merge remote-tracking branch 'upstream/master' into path-info
2023-01-14 14:27:28 -05:00
John Ericson
a416476217
Move ValidPathInfo
defintions to path-info.cc
...
Originally there was no `path-info.*`, then there was `path-info.hh`,
then there was `path-info.cc`, but only for new things. Moving this
stuff over makes everything consistent.
2023-01-13 15:39:19 -05:00
John Ericson
2e7be46e73
Move new ValidPathInfo
methods to path-info.cc
...
We'll move the old ones separately, so as not to clutter the diff.
2023-01-13 15:06:07 -05:00
Robert Hensing
fec527bba1
Merge pull request #7597 from tweag/move-implem-bit-to-implem-file
...
Move the `getBuildLog` implementation to its own implementation file
2023-01-13 20:16:33 +01:00
Robert Hensing
d21f54958e
Merge pull request #6815 from obsidiansystems/better-wanted-outputs
...
`OutputSpec` for `DerivationGoal` and `DerivedPath`, today's `OutputSpec` -> `ExtendedOutputSpec`
2023-01-13 16:03:12 +01:00
Théophane Hufschmitt
b8a0e9a9b8
Move the getBuildLog
implementation to its own implementation file
...
Keep the header minimal and clean
2023-01-13 11:05:44 +01:00
Théophane Hufschmitt
bdeb6de889
Merge pull request #7430 from tweag/ca/fix-nix-log
...
Ca/fix nix log
2023-01-13 11:00:56 +01:00
John Ericson
d8512653d4
Write more (extended) output spec tests
2023-01-12 22:05:55 -05:00
John Ericson
d29eb08563
Assert on construction that OutputsSpec::Names
is non-empty
2023-01-12 20:52:29 -05:00
John Ericson
e947aa5401
Unit test OuputsSpec::{union_, isSubsetOf}
2023-01-12 20:33:50 -05:00
John Ericson
31875bcfb7
Split OutputsSpec::merge
into OuputsSpec::{union_, isSubsetOf}
...
Additionally get rid of the evil time we made an empty
`OutputSpec::Names()`.
2023-01-12 20:20:27 -05:00
Valentin Gagarin
48b2a3a0d0
remove unncessary cast
2023-01-12 13:23:32 +01:00
John Ericson
0faf5326bd
Improve tests for OutputsSpec
2023-01-11 19:09:21 -05:00
John Ericson
5ba6e5d0d9
Remove default constructor from OutputsSpec
...
This forces us to be explicit.
It also requires to rework how `from_json` works. A `JSON_IMPL` is added
to assist with this.
2023-01-11 19:08:19 -05:00
John Ericson
114a6e2b09
Make it hard to construct an empty OutputsSpec::Names
...
This should be a non-empty set, and so we don't want people doing this
by accident. We remove the zero-0 constructor with a little inheritance
trickery.
2023-01-11 19:08:19 -05:00
John Ericson
ce2f91d356
Split OutputsSpec
and ExtendedOutputsSpec
, use the former more
...
`DerivedPath::Built` and `DerivationGoal` were previously using a
regular set with the convention that the empty set means all outputs.
But it is easy to forget about this rule when processing those sets.
Using `OutputSpec` forces us to get it right.
2023-01-11 18:57:18 -05:00
John Ericson
a7c0cff07f
Rename OutputPath
-> ExtendedOutputPath
...
Do this prior to making a new more limitted `OutputPath` we will use in
more places.
2023-01-11 18:55:29 -05:00
John Ericson
a8f45b5e5a
Improve OutputsSpec
slightly
...
A few little changes preparing for the rest.
2023-01-11 18:54:50 -05:00
Théophane Hufschmitt
a3ba80357d
Merge pull request #7543 from obsidiansystems/typed-string-context
...
Parse string context elements properly
2023-01-11 07:09:37 +01:00
Robert Hensing
34a1e0d29b
doc/manual: Introduce @docroot@ as a stable base for includable snippets
...
This way the links are clearly within the manual (ie not absolute paths),
while allowing snippets to reference the documentation root reliably,
regardless of at which base url they're included.
2023-01-10 22:30:41 +01:00
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
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
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
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
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
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
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
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
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