Eelco Dolstra
1e1a8e8ad1
Merge pull request #11058 from hercules-ci/more-nix-shell
...
Make `#!nix-shell` arguments and options relative to script
2024-07-17 21:52:34 +02:00
Eelco Dolstra
621c23bbea
Merge pull request #11113 from NixOS/doc-comment-unordered-map
...
Doc comments: use std::unordered_map
2024-07-17 16:50:48 +02:00
Robert Hensing
d0e9878389
Remove unused boost include and split out std-hash.hh
...
Splitting it out immediately answers questions like [this],
without increasing the number of compilation units.
I did consider using boost::hash_combine instead, but it doesn't seem
to be quite as capable, accepting only two arguments.
[this]: https://github.com/NixOS/nix/pull/11113#discussion_r1679991573
2024-07-16 22:31:25 +02:00
Eelco Dolstra
3d8fa9f668
Pos::getSnippetUpTo(): Fix warning
2024-07-16 16:34:13 +02:00
Eelco Dolstra
9c6678da0e
Merge pull request #11092 from DeterminateSystems/hash-SourcePath
...
Use std::unordered_map for the EvalState caches
2024-07-16 11:06:43 +02:00
Robert Hensing
61a4d3d45c
getSnippetUpTo: Return optional
...
This makes it possible to certain discern failures from empty
snippets, which I think is an ok review comment.
Maybe it should do so for swapped column indexes too, but I'm not
sure.
I don't think it matters in the grand scheme. We don't even have
a real use case for `nullopt` now anyway.
Since we don't have a use case, I'm not applying this logic to
higher level functions yet.
2024-07-15 20:10:45 +02:00
Robert Hensing
d4f576b0b2
nix repl: Render docs for attributes
2024-07-15 19:56:40 +02:00
Robert Hensing
e5af7cbeb9
libutil: Add Pos::getSnippetUpTo(Pos)
2024-07-15 18:41:11 +02:00
Eelco Dolstra
550b3479cf
Include the accessor in the SourcePath hash
2024-07-15 15:46:30 +02:00
Robert Hensing
7e604f716c
concatStrings: Give compiler access to definition for inlining
...
... at call sites that are may be in the hot path.
I do not know how clever the compiler gets at these sites.
My primary concern is to not regress performance and I am confident
that this achieves it the easy way.
2024-07-14 12:20:45 +02:00
Robert Hensing
97e01107ec
dropEmptyInitThenConcatStringsSep -> concatStringSep: empty separator
...
When the separator is empty, no difference is observable.
Note that concatStringsSep has centralized definitions. This adds the
required definitions. Alternatively, `strings-inline.hh` could be
included at call sites.
2024-07-14 12:10:39 +02:00
Robert Hensing
d40fdb5711
dropEmptyInitThenConcatStringsSep: Update doc and deprecate
2024-07-14 11:50:20 +02:00
Robert Hensing
1c97718146
dropEmptyInitThenConcatStringsSep: Allow it to drop items again
...
It's usually harmless, if it occurs at all.
2024-07-13 03:06:24 +02:00
Robert Hensing
9ca42d5da2
dropEmptyInitThenConcatStringsSep -> concatStringSep: setting value was already harmed
...
Considering that `value` was probably parsed with tokenizeString
prior, it's unlikely to contain empty strings, and we have no
reason to remove them either.
2024-07-13 03:06:24 +02:00
Robert Hensing
4029426ca8
dropEmptyInitThenConcatStringsSep -> concatStringSep: tokens from tokenizeString are not empty
2024-07-13 03:06:24 +02:00
Robert Hensing
0fe3525223
illegal configuration line -> syntax error in configuration line
...
The law has nothing to do with this, although I do feel like a
badass when I mess with the config.
I'm a conf artist.
2024-07-13 03:06:24 +02:00
Robert Hensing
3b77f13451
dropEmptyInitThenConcatStringsSep -> concatStringSep: experimental features do not render as empty strings
2024-07-13 03:06:24 +02:00
Robert Hensing
a681d354e7
Add fresh concatStringsSep without bug
...
The buggy version was previously renamed to
dropEmptyInitThenConcatStringsSep
2024-07-13 03:06:24 +02:00
Robert Hensing
79eb0adf9d
dropEmptyInitThenConcatStringSep: Check that we don't drop...
...
... initial empty strings.
The tests pass, which is encouraging.
2024-07-13 03:05:50 +02:00
Robert Hensing
1a8defd06f
Refactor: rename C++ concatStringsSep -> dropEmptyInitThenConcatStringsSep
2024-07-13 03:05:50 +02:00
John Ericson
bc83b9dc1f
Remove comparator.hh
and switch to <=>
in a bunch of places
...
Known behavior changes:
- `MemorySourceAccessor`'s comparison operators no longer forget to
compare the `SourceAccessor` base class.
Progress on #10832
What remains for that issue is hopefully much easier!
2024-07-12 14:54:18 -04:00
Eelco Dolstra
cdc23b67a6
Provide std::hash<SourcePath>
2024-07-12 17:54:27 +02:00
Robert Hensing
8df041cbc6
Solve unused header warnings reported by clangd
2024-07-12 15:37:54 +02:00
Robert Hensing
f070d68c32
Add BaseError assignment operators
...
The move assignment was implicitly generated and used in
src/libstore/build/goal.cc:90:22:
90 | this->ex = std::move(*ex);
Clang warns about this generated method being deprecated, so making
them explicit fixes the warning.
2024-07-12 14:25:16 +02:00
Eelco Dolstra
61080554ab
SymbolStr: Remove std::string conversion
...
This refactoring allows the symbol table to be stored as something
other than std::strings.
2024-07-11 17:43:10 +02:00
Robert Hensing
4fd8f19ecf
Fix build to use CanonPath in new FSO sinks
2024-07-11 12:14:48 +02:00
Robert Hensing
86420753ec
Merge remote-tracking branch 'upstream/master' into support-hardlinks-in-tarballs
2024-07-11 11:43:02 +02:00
Robert Hensing
d942d505ca
Merge remote-tracking branch 'upstream/master' into more-nix-shell
2024-07-10 16:19:18 +02:00
John Ericson
d8850618b6
Merge pull request #11059 from rhendric/rhendric/reference-manual
...
docs: merge builtin-constants into builtins
2024-07-07 21:47:33 -04:00
Ryan Hendrickson
95890b3e1d
docs: merge builtin-constants into builtins
2024-07-07 15:57:23 -04:00
Robert Hensing
f5b59fbc64
Fix and extend nix-shell baseDir test
2024-07-07 00:23:22 +02:00
Robert Hensing
0729f0a113
packaging: Pass version directly
2024-07-06 17:52:57 +02:00
John Ericson
ff9b6d0e1f
Merge pull request #11037 from fricklerhandwerk/document-config-parsing
...
use self-descriptive name for config file parser, document
2024-07-05 15:21:26 -04:00
Robert Hensing
ddff76f667
Merge pull request #10973 from NixOS/meson-libexpr
...
Meson build for libexpr libflake, external C API, unit tests
2024-07-05 20:27:12 +02:00
Eelco Dolstra
8f280d72ff
Merge pull request #11019 from DeterminateSystems/fix-failed-to-open-archive
...
Tarball fetcher: Fix handling of cached tarballs
2024-07-05 17:10:02 +02:00
Eelco Dolstra
e7e070d36b
Document
2024-07-05 16:29:16 +02:00
Valentin Gagarin
c66079f1e8
use self-descriptive name for config file parser, document
...
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-07-04 10:36:48 +02:00
siddhantCodes
976c05879f
factor duplicate code into util function append
2024-07-04 11:09:23 +05:30
John Ericson
30de61f16d
Merge pull request #11018 from siddhantk232/canonpath-fs-sink
...
Use `CanonPath` in `fs-sink.hh`
2024-07-03 10:36:18 -04:00
Eelco Dolstra
79ed3df8f8
Tarball fetcher: Fix handling of cached tarballs
...
Fixes a regression introduced in
5a9e1c0d20
where downloading a cached
file causes the error "Failed to open archive (Unrecognized archive
format)".
2024-07-03 14:14:20 +02:00
siddhantCodes
2cf24a2df0
fix tests and minor changes
...
- use the iterator in `CanonPath` to count `level`
- use the `CanonPath::basename` method
- use `CanonPath::root` instead of `CanonPath{""}`
- remove `Path` and `PathView`, use `std::filesystem::path` directly
2024-07-03 17:43:55 +05:30
John Ericson
4d6bc61b8d
Fix things
2024-07-02 09:26:22 -04:00
John Ericson
513f6b9718
meson: Prelink links to avoid missing C++ initializers
...
This is the same as what the old build system did in
7eca8a16ea
, done for the same reasons.
2024-07-02 09:26:22 -04:00
John Ericson
479befa76d
More fixes
2024-07-02 09:26:22 -04:00
John Ericson
6a0582d9fd
Rename file to avoid reserved name
2024-07-02 09:26:22 -04:00
John Ericson
0b539dea4a
Improve boost hacks
2024-07-02 09:26:22 -04:00
John Ericson
8399bd6b8f
Dedup
2024-07-02 09:26:21 -04:00
John Ericson
8198888bc4
More dedup
2024-07-02 09:23:25 -04:00
John Ericson
d6f57f3260
More dedup
2024-07-02 09:23:25 -04:00
John Ericson
c88f83b471
More dedup
2024-07-02 09:23:25 -04:00