Solène Rapenne
64951d9125
Update src/libstore/daemon.cc
...
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-01-26 09:34:25 +01:00
Solène Rapenne
a96156c58f
warnings: enhance the case of untrusted substituter for untrusted user
2023-01-26 09:34:25 +01:00
Guillaume Maudoux
734c5fdcd6
Fix 'destructor called on non-final ...' warning
...
clangStdenv compiles with a single warning:
```
warning: destructor called on non-final 'nix::PosAdapter' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
```
This fixes the warning by making the destructor of PosAdapter virtual,
deffering to the correct destructor from the concrete child classes.
This has no impact in the end, as none of these classes have specific
destructors.
Technicaly, it may be faster not to have this indirection, but as per
the warning, there is only one place where we have to delete abstract
PosAdapter values.
Not worth bikesheding I guess.
2023-01-24 16:37:50 +01:00
John Ericson
e68e8e3cee
Merge branch 'path-info' into ca-drv-exotic
2023-01-23 16:54:45 -05:00
John Ericson
4540e7b940
Don't add StorePathDescriptor
for now
...
We don't need it yet, we can add it back later.
2023-01-23 12:58:27 -05:00
Eelco Dolstra
f503ba1b8b
Merge pull request #7595 from cole-h/show-setting-value
...
nix/show-config: allow getting the value of a specific setting
2023-01-23 17:56:39 +01:00
John Ericson
c67e0cc58c
Merge remote-tracking branch 'upstream/master' into path-info
2023-01-23 11:47:20 -05:00
Robert Hensing
9b56683398
Merge pull request #7447 from aakropotkin/read-file-type
...
Read file type
2023-01-23 17:37:22 +01:00
Robert Hensing
0a9acefeb5
Merge pull request #7657 from obsidiansystems/fix-7655
...
Fix #7655
2023-01-23 15:42:59 +01: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
Alex Ameen
153ee460c5
primop: add readFileType, optimize readDir
...
Allows checking directory entry type of a single file/directory.
This was added to optimize the use of `builtins.readDir` on some
filesystems and operating systems which cannot detect this information
using POSIX's `readdir`.
Previously `builtins.readDir` would eagerly use system calls to lookup
these filetypes using other interfaces; this change makes these
operations lazy in the attribute values for each file with application
of `builtins.readFileType`.
2023-01-22 13:45:02 -06:00
John Ericson
0afdf4084c
Fix #7655
...
We had some local variables left over from the older (more
complicated) implementation of this function. They should all be unused,
but one wasn't by mistake.
Delete them all, and replace the one that was still in use as intended.
2023-01-21 23:55:06 -05:00
Guillaume Maudoux
a0642305ab
Use complete '__toString' attribute name
...
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-01-20 13:06:00 +01:00
Guillaume Maudoux
ee4b849b17
Fix unreachable error message
...
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-01-20 13:01:03 +01:00
Eric Wolf
4d50995eff
Fix url parsing for urls using file+
...
`file+https://example.org/test.mp4 ` should not be rejected with
`unexpected authority`.
2023-01-20 10:31:26 +01:00
Guillaume Maudoux
a9fa2c758b
Always display addErrorContext messages in (expanded) traces
2023-01-19 14:14:19 +01:00
Guillaume Maudoux
6228b6b950
Discuss re-entrant errors and design
2023-01-19 14:12:26 +01:00
Guillaume Maudoux
ca7c5e08c1
Add tests for error traces, and fixes
2023-01-19 14:10:56 +01:00
Guillaume Maudoux
e4726a0c79
Revert "Revert "Merge pull request #6204 from layus/coerce-string""
...
This reverts commit 9b33ef3879
.
2023-01-19 13:23:04 +01:00
Eelco Dolstra
0510aa40a3
Merge pull request #7631 from edolstra/output-names
...
OutputSpec: Allow all valid output names
2023-01-18 17:09:15 +01: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
Eelco Dolstra
01f268322a
Restore support for channel: URLs in fetchTarball
...
Fixes #7625 .
2023-01-18 12:57:03 +01:00
Robert Hensing
9b33ef3879
Revert "Merge pull request #6204 from layus/coerce-string"
...
This reverts commit a75b7ba30f
, reversing
changes made to 9af16c5f74
.
2023-01-18 01:34:07 +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
Taeer Bar-Yam
b2752a4f74
add comments
2023-01-17 08:28:56 -05:00
Théophane Hufschmitt
6bdf4edb77
Keep the default profile the same
...
It's used as the “system” profile in a bunch of places, so better not
touch it. Besides, it doesn't hurt to keep it since it's owned by root
any way, so it doesn't have the `chown` problem that the user profiles
had and that led to wanting to move them on the client-side.
2023-01-17 14:17:28 +01:00
Théophane Hufschmitt
c80621dbac
Don't try to migrate existing profiles
...
Doing so would be more dangerous than useful, better leave them as-is if
they already exist
2023-01-17 14:17:28 +01:00
Théophane Hufschmitt
0601050755
Migrate the old profiles to the new location
...
Make sure that we don’t just create the new profiles directory, but that
we also migrate every existing profile to it.
2023-01-17 14:17:28 +01:00
Théophane Hufschmitt
a5919f4754
Move the default profiles to the user’s home
...
Rather than using `/nix/var/nix/{profiles,gcroots}/per-user/`, put the user
profiles and gcroots under `$XDG_DATA_DIR/nix/{profiles,gcroots}`.
This means that the daemon no longer needs to manage these paths itself
(they are fully handled client-side). In particular, it doesn’t have to
`chown` them anymore (removing one need for root).
This does change the layout of the gc-roots created by nix-env, and is
likely to break some stuff, so I’m not sure how to properly handle that.
2023-01-17 14:17:28 +01:00
Eelco Dolstra
9a32f77a95
Merge pull request #7606 from hercules-ci/recognize-some-flake-attributes
...
flake check: Recognize well known community attributes
2023-01-17 13:27:30 +01:00
Robert Hensing
4e7592b593
flake check: Recognize well known community attributes
...
This avoids warning fatigue, making `nix flake check` more effective.
2023-01-16 20:16:45 +01:00
Eelco Dolstra
1df3d62c76
Merge pull request #7585 from NixOS/macos-disconnect
...
MonitorFdHup: Make it work on macOS again
2023-01-16 13:30:15 +01: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
7c82213813
Merge branch 'path-info' into ca-drv-exotic
2023-01-14 17:09:58 -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
Cole Helbling
1fc74afbba
nix/show-config: allow getting the value of a specific setting
...
Instead of needing to run `nix show-config --json | jq -r
'."warn-dirty".value'` to view the value of `warn-dirty`, you can now
run `nix show-config warn-dirty`.
2023-01-12 13:56:35 -08:00