Silvan Mosberger
46028ff764
doc: Fix fetchGit default name ( #9241 )
2023-10-26 07:05:48 +02:00
Silvan Mosberger
f269911641
Document builtins.substring negative length behavior ( #9226 )
2023-10-24 11:22:02 +02:00
John Ericson
765436e300
Add builtins.addDrvOutputDependencies
...
End goal: make `(mkDerivation x).drvPath` behave like a non-DrvDeep
context.
Problem: users won't be able to recover the DrvDeep behavior when
nixpkgs makes this change.
Solution: add this primop.
The new primop is fairly simple, and is supposed to complement other
existing ones (`builtins.storePath`, `builtins.outputOf`) so there are
simple ways to construct strings with every type of string context
element.
(It allows nothing we couldn't already do with `builtins.getContext` and `builtins.appendContext`, which is also true of those other two primops.)
This was originally in #8595 , but then it was proposed to land some doc
changes separately. So now the code changes proper is just moved to
this, and the doc will be done in that.
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.nore
github.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io
2023-10-23 12:49:14 -04:00
Eelco Dolstra
955bbe53c5
Merge pull request #9177 from edolstra/input-accessors
...
Backport FSInputAccessor and MemoryInputAccessor from lazy-trees
2023-10-23 11:42:04 +02:00
Eelco Dolstra
935c9981de
Remove fetchers::Tree and move tarball-related stuff into its own header
2023-10-20 19:56:52 +02:00
Eelco Dolstra
bcf5c31950
Add future FIXME
2023-10-20 16:58:33 +02:00
Eelco Dolstra
173abec0bc
coerceToPath(): Handle __toString, add tests
2023-10-20 13:06:44 +02:00
Eelco Dolstra
5be7705ddf
Remove stuff we don't need yet
2023-10-19 19:20:21 +02:00
Johannes Kirschbauer
9bc7b4f463
doc: generic closure supported key types ( #9183 )
...
* doc: generic closure supported key types
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-10-19 12:39:41 +00:00
Eelco Dolstra
06c57899e3
Remove FIXME
2023-10-19 14:22:05 +02:00
Eelco Dolstra
f16af08e83
Fix macOS compilation
2023-10-19 14:20:50 +02:00
Eelco Dolstra
12214fef09
InputAccessor::fetchToStore(): Support arbitrary ingestion methods
2023-10-19 14:19:10 +02:00
Yueh-Shun Li
5088e6563a
primops: add builtins.convertHash
...
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-10-19 00:58:56 +08:00
Yueh-Shun Li
e026f3e1ae
treewide: Reference HashFormat members with scope
...
Base* -> HashFormat::Base*
2023-10-19 00:56:41 +08:00
Yueh-Shun Li
aff177d860
Elaborate the "unknown hash algorithm" error
...
List the allowed hash formats
2023-10-19 00:38:32 +08:00
Eelco Dolstra
df73c6eb8c
Introduce MemoryInputAccessor and use it for corepkgs
...
MemoryInputAccessor is an in-memory virtual filesystem that returns
files like <nix/fetchurl.nix>. This removes the need for special hacks
to handle those files.
2023-10-18 17:38:11 +02:00
Eelco Dolstra
ea38605d11
Introduce FSInputAccessor and use it
...
Backported from the lazy-trees branch. Note that this doesn't yet use
the access control features of FSInputAccessor.
2023-10-18 17:37:32 +02:00
Eelco Dolstra
201c115c3e
Merge pull request #9151 from edolstra/stabilize-fetchTree
...
Stabilize fetchTree
2023-10-18 10:54:08 +02:00
Théophane Hufschmitt
c1a1766c46
Merge pull request #9169 from vkryachko/follow_cycle
...
Detect cycles in flake follows.
2023-10-18 07:34:03 +02:00
Eelco Dolstra
f62b5500ff
fetchTree: Require the flakes experimental feature for the URL syntax
2023-10-17 14:52:34 +02:00
Jacek Galowicz
54b350d517
Drop some moves that would happen anyway but forbid NRVO where appicable
2023-10-16 21:48:35 +01:00
Jacek Galowicz
abf7df2b37
Fix moves that accidentally copy anyway
2023-10-16 21:48:35 +01:00
Vladimir Kryachko
d6066c90f8
Don't convert InputPaths to strings prematurely.
2023-10-16 15:47:28 -04:00
Vladimir Kryachko
b3fd7db63f
Detect cycles in flake follows.
...
This change results in an error thrown as opposed to segfaulting due to
stack overflow.
Fixes #9144
2023-10-16 13:00:49 -04:00
Eelco Dolstra
4112dd1fc9
Mark fetchTree as stable
2023-10-13 16:45:08 +02:00
Eelco Dolstra
8eb4f735dc
fetchTree: Only use the registry if flakes are enabled
2023-10-13 14:34:32 +02:00
Eelco Dolstra
4ce7a53a9c
Update fetchTree docs
2023-10-13 14:34:32 +02:00
Eelco Dolstra
856fe13533
fetchTree cleanup
...
Two changes:
* The (probably unintentional) hack to handle paths as tarballs has
been removed. This is almost certainly not what users expect and is
inconsistent with flakeref handling everywhere else.
* The hack to support scp-style Git URLs has been moved to the Git
fetcher, so it's now supported not just by fetchTree but by flake
inputs.
2023-10-13 14:34:23 +02:00
Michal Sojka
db0d94560b
Document builtins.fetchTree
...
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Supersedes #6740
2023-10-13 14:24:10 +02:00
Valentin Gagarin
7642894a4e
reword documentation on lookup path resolution
2023-10-10 00:49:27 +02:00
John Ericson
838be5e4a0
Merge pull request #9114 from fricklerhandwerk/lookup-path
...
introduce lookup paths as a distinct language construct
2023-10-09 11:28:40 -04:00
Robert Hensing
aeea49609b
Merge pull request #8895 from hercules-ci/gc-before-stats
...
eval: Run a full GC before printing stats
2023-10-09 17:14:45 +02:00
John Ericson
3953901796
Merge pull request #9112 from fricklerhandwerk/restrict-eval-nix-path
...
describe the effect of `restrict-eval` in a more focused manner
2023-10-09 11:07:21 -04:00
John Ericson
a7a9386c96
Merge pull request #9111 from fricklerhandwerk/impure-constants
...
document that pure-eval also disables `builtins.nixPath`
2023-10-09 11:04:47 -04:00
John Ericson
217d863f7a
Merge branch 'master' into lookup-path
2023-10-09 10:54:54 -04:00
Robert Hensing
c32084a12c
printStats -> maybePrintStats
2023-10-09 16:34:35 +02:00
Valentin Gagarin
f00a5eb11b
introduce lookup paths as a distinct language construct
...
so far they did not really have a name, and were at best referred to as
"angle bracket syntax".
2023-10-07 04:44:09 +02:00
Valentin Gagarin
6305801626
reword and reformat description of builtins.import
2023-10-07 03:57:08 +02:00
Valentin Gagarin
2fe1ccf797
describe the effect of restrict-eval
in a more focused manner
2023-10-07 03:20:20 +02:00
Valentin Gagarin
a86a3e5e59
document that pure-eval also disables builtins.nixPath
2023-10-07 03:12:25 +02:00
Valentin Gagarin
a67cee965a
expand on interpolated expressions
2023-10-07 02:49:55 +02:00
Robert Hensing
f95364a803
eval: Run a full GC before printing stats
...
This makes the numbers more deterministic, especially when it comes
to the final heap size.
2023-10-06 00:21:05 +02:00
Robert Hensing
f8a3893e8d
pathExists: isDir when endswith /.
2023-09-30 02:35:26 +01:00
John Ericson
b912f3a937
Move flakeIdRegex{,S}
from libutil
to flakeref.{cc,hh
...
It isn't used, and doesn't belong in `libutil`.
2023-09-28 20:55:41 -04:00
John Ericson
cede94dbf7
builtins.fetchTree
: Mark experimental the new way
...
This helps ensure uniform docs/error message.
2023-09-28 20:51:25 -04:00
John Ericson
b7e712f9fd
Merge pull request #8509 from wentasah/fetch-tree-doc
...
Document fetchTree
2023-09-28 15:13:53 -04:00
Robert Hensing
13a9090ffc
Merge pull request #9047 from flox/tomberek.string_refactor
...
string Value refactor
2023-09-28 02:58:57 +01:00
Robert Hensing
16a6ea7249
Merge pull request #9049 from inclyc/users/inclyc/move-path
...
libexpr: construct ExprPath by move ctor, not copy cotr
2023-09-27 22:30:44 +01:00
Tom Bereknyei
399ef84420
refactor: use string accessors
...
Create context, string_view, and c_str, accessors throughout in order to
better support improvements to the underlying string representation.
2023-09-27 00:33:01 -04:00
Yingchi Long
5b902ce9d6
libexpr: construct ExprPath by move ctor, not copy cotr
2023-09-26 23:30:32 +08:00