1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00
Commit graph

12190 commits

Author SHA1 Message Date
Eelco Dolstra
4077aa43a8 ParsedURL: Remove base field 2025-01-07 14:52:00 +01:00
Eelco Dolstra
f705ce7f9a ParsedURL: Remove url field
This prevents a 'url' field that is out of sync with the other
fields. You can use to_string() to get the full URL.
2025-01-07 14:46:03 +01:00
Eelco Dolstra
ef2739b7c9 Example of referencing parent directories 2025-01-07 14:01:49 +01:00
Eelco Dolstra
0792152627 Rename Override -> OverrideTarget 2025-01-07 13:54:19 +01:00
Eelco Dolstra
e8c7dd9971 Rename allowRelative -> preserveRelativePaths 2025-01-07 13:44:08 +01:00
Eelco Dolstra
75cda2da7f
Document path values in inputs
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2025-01-07 13:40:18 +01:00
Jörg Thalheim
5a5a86949a makeParentCanonical: test case where parent is empty 2025-01-07 05:42:04 +00:00
Robert Hensing
ddbbf53767 fix: Resolve CLI parent symlinks before adding to store
Fixes https://github.com/NixOS/nix/issues/11941
2025-01-07 05:42:03 +00:00
Robert Hensing
c0b64f3377 refactor: Don't re-construct SourcePath unnecessarily 2025-01-07 05:42:03 +00:00
Robert Hensing
36563c69a4 fix: Handle symlinks and FIFOs in nix hash where possible
Fixes https://github.com/NixOS/nix/issues/11756
Fixes https://github.com/NixOS/nix/issues/11681
2025-01-07 05:42:03 +00:00
Robert Hensing
69853c067c Add makeParentCanonical() 2025-01-07 05:42:03 +00:00
Jörg Thalheim
6827768807
Merge pull request #12135 from NaN-git/parse-nul
correctly parse strings with null bytes and throw error
2025-01-06 22:53:02 +01:00
Jörg Thalheim
1eba904b79 nix/flake: fix build on windows 2025-01-05 20:16:12 +01:00
Jörg Thalheim
98d75de1ea windows: fix conditional compilation variable 2025-01-05 20:15:49 +01:00
Philipp Otterbein
a44e9dd1ea correctly parse strings with null bytes and throw error 2025-01-04 16:14:06 +01:00
Connor Baker
359a0840e2 packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
Mutsuha Asada
01c96f9fd5
libmain: fix ignoring empty lines in the print-build-logs option 2025-01-02 13:26:13 +09:00
Robert Hensing
4f3960ea26
Merge pull request #12127 from NaN-git/json-ser
toJSON: re-throw serialization exception
2024-12-31 21:41:38 +01:00
Philipp Otterbein
4a2310a3a0 toJSON: re-throw serialization exception 2024-12-31 20:33:28 +01:00
Martin Fischer
7a8a28629c feat(nix-instantiate): add --raw flag
The experimental `nix eval` command already supports a `--raw` flag.
This commit implements the same flag for the stable nix-instantiate command.

Until now instructions and scripts that didn't want to rely on experimental
features had to use workarounds such as:

    nix-instantiate --eval <something> | tr -d \"

(which also undesirably also removes double quotation marks within the string), or

    nix-instantiate --eval <something> | jq -j

(which undesirably depends on another package).

Co-authored-by: Silvan Mosberger <silvan.mosberger@tweag.io>
2024-12-31 16:36:49 +01:00
Robert Hensing
61c3559116
Merge pull request #12115 from trofi/libcmd-lowdown-1.4-support
libcmd: update to support lowdown-1.4 API
2024-12-30 20:13:42 +01:00
Sergei Trofimovich
edbfe863ce libcmd: update to support lowdown-1.4 API
Upstream change
bab1d75079
moved a few fields from `lowdown_opts` toa  new `lowdown_opts_term`
struct. As a result the build started failing as:

    nix-cmd> [2/17] Compiling C++ object libnixcmd.so.p/markdown.cc.o
    nix-cmd> FAILED: libnixcmd.so.p/markdown.cc.o
    nix-cmd> g++ -Ilibnixcmd.so.p -I. -I.. -I/nix/store/b0bnrk5lacxbpgxgnc28r8q3wcazrgxj-nix-util-2.26.0pre-dev/include/nix -I/nix/store/cxnynq9ykyj4xxv6wf6dw7r0aw5x6n9k-libarchive-3.7.7-dev/include -I/nix/store/bfgjwkcb8snkizx578rzdahi75m8zyh4-nlohmann_json-3.11.3/include -I/nix/store/3sx8bq3sip6j2nv1m5xx4gbdp33v7iy6-nix-store-2.26.0pre-dev/include/nix -I/nix/store/sih2dgqzvsbv7p510lkfmas7s7wbsl4j-nix-fetchers-2.26.0pre-dev/include/nix -I/nix/store/68p8s20fsiiakj7nys7grbaixfnhsdzs-nix-expr-2.26.0pre-dev/include/nix -I/nix/store/gw7wknhzhfzzj9zww2kyi5xrzgf1ndki-boehm-gc-8.2.8-dev/include -I/nix/store/3jwb9j4vnsk5saq3wfyyp9il3mhs41l9-nix-flake-2.26.0pre-dev/include/nix -I/nix/store/8nwjvmq7m48v8g646jrxkikv6x47bc3m-nix-main-2.26.0pre-dev/include/nix -I/nix/store/rb0hzsw5wc1a7daizhpj824mbxlvijrq-lowdown-1.4.0-dev/include -I/nix/store/m388ywpk53fsp8r98brfd7nf1f5sskv0-editline-1.17.1-dev/include -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++2a -include config-util.hh -include config-store.hh -include config-expr.hh -include config-main.hh -include config-cmd.hh -Wdeprecated-copy -Werror=suggest-override -Werror=switch -Werror=switch-enum -Werror=unused-result -Wignored-qualifiers -Wimplicit-fallthrough -Wno-deprecated-declarations -O3 -fPIC -pthread -std=c++2a -std=c++2a -std=c++2a -std=c++2a -std=c++2a -std=c++2a -MD -MQ libnixcmd.so.p/markdown.cc.o -MF libnixcmd.so.p/markdown.cc.o.d -o libnixcmd.so.p/markdown.cc.o -c ../markdown.cc
    nix-cmd> ../markdown.cc: In function 'std::string nix::doRenderMarkdownToTerminal(std::string_view)':
    nix-cmd> ../markdown.cc:28:5: error: 'lowdown_opts' has no non-static data member named 'cols'
    nix-cmd>    28 |     };
    nix-cmd>       |     ^

The change adds version-based conditional to support both pre-1.4 and
1.4 forms of the initialization.

Closes: https://github.com/NixOS/nix/issues/12113
2024-12-29 21:49:27 +00:00
Philipp Otterbein
1e2cace5f1 fix documentation of substring 2024-12-28 23:40:25 +01:00
mergify[bot]
8a3fc27f1b
Merge pull request #12110 from knotapun/patch-1
Make `readFileType` doc string consistent
2024-12-28 12:35:39 +00:00
Jörg Thalheim
b3eab028df
Merge pull request #12066 from NaN-git/utf-8
try to calculate width of UTF-8 encoded characters
2024-12-28 12:15:35 +01:00
Philipp Otterbein
92e30955b9 try to calculate character width 2024-12-28 12:01:32 +01:00
Parker Jones
cf69c99f3e
Make readFileType doc string consistent
The primitive `readFileType p` has a list of acceptable types, and so does `readDir path`

This edit makes the formatting of the list consistent between themselves, and other parts of the documentation.
2024-12-27 01:11:36 -05:00
Yaroslav Bolyukin
4a91e627a7
fix: ignore symlinks in fsync-store-paths
Fixes: https://github.com/NixOS/nix/issues/12099
2024-12-25 02:41:20 +01:00
Eelco Dolstra
9223d64ac6 Remove dead code 2024-12-23 16:03:13 +01:00
Eelco Dolstra
f72752c0dc
Merge pull request #12089 from Mic92/delete-path
filesystem/deletePath: remove unnecessary quotes from error message
2024-12-20 16:28:25 +01:00
Cole Helbling
b978fa8450 libstore: fixup unformatted uri when S3 getObject fails 2024-12-19 11:16:34 -08:00
Jörg Thalheim
a8e1b4757e filesystem/deletePath: remove unnecessary quotes from error message
Paths are already quoted:

error:
       … while fetching the input 'path:/nix/store/rs2s2ca7xs87v82aps54m1p3sqrfz6c8-source'

       error: chmod '"/nix/store/rs2s2ca7xs87v82aps54m1p3sqrfz6c8-source"': Read-only file system
2024-12-19 18:37:22 +01:00
Eelco Dolstra
8534c4222c Merge remote-tracking branch 'origin/master' into relative-flakes 2024-12-18 21:09:27 +01:00
Leandro Reina
7756b2286d Merge remote-tracking branch 'upstream/master' into lfs 2024-12-18 18:18:45 +01:00
Leandro Reina
b1663fa3fb Re-introduce git_attr_get_ext 2024-12-18 18:00:45 +01:00
mergify[bot]
3f3feae33e
Merge pull request #12071 from Mic92/clang-tidy
Prepare nix to run with clang-tidy
2024-12-17 21:53:35 +00:00
Jörg Thalheim
6848154b2e regex-combinators: fix linter error when adding string_view and string 2024-12-17 22:00:34 +01:00
Jörg Thalheim
eda331e53f libutil/windows: only define headers/code if we are actually on windows
all those includes otherwise break linters.
2024-12-17 22:00:34 +01:00
Jörg Thalheim
b338140931 fix missing includes in various headers 2024-12-17 22:00:34 +01:00
Eelco Dolstra
33852ead6b Optimisation 2024-12-17 12:56:14 +01:00
Eelco Dolstra
b9f60faab5 Fix macOS build 2024-12-17 12:56:14 +01:00
Eelco Dolstra
7ba933e989 Cache calls to GitRepo::getWorkdirInfo()
A command like `nix flake metadata` was causing about 4 calls to
getWorkdirInfo(), which is slow for large repos (even when they're not
dirty).
2024-12-17 12:56:14 +01:00
Eelco Dolstra
f469bc2ae4 Cache result of Input::getFingerprint()
The fingerprint calculation can be expensive (especially for dirty Git
trees) so we need to cache it.
2024-12-17 12:56:14 +01:00
Eelco Dolstra
d044a05197 Don't fingerprint dirty repos with submodules for now
Fixes nixpkgsLibTests.
2024-12-17 12:56:14 +01:00
Eelco Dolstra
331bf3e261 Git fetcher: Calculate a fingerprint for dirty workdirs
This restores evaluation caching for dirty Git workdirs.
2024-12-17 12:56:14 +01:00
Jason Yundt
51463d2280 Fix flake.lock/flake.nix mix-up
src/nix/flake.md describes the format of flake.lock files. Before this
change, it said that the original field was “The original input
specification from `flake.lock`[…]” The original input specification is
in flake.nix, not flake.lock.
2024-12-16 13:55:41 -05:00
Eelco Dolstra
08361f031d EvalState::realiseContext(): Allow access to the entire closure
Fixes #11030.
2024-12-16 16:16:36 +01:00
Eelco Dolstra
b167e2c415 Work around clang/libc++ issue 2024-12-16 14:58:39 +01:00
Eelco Dolstra
d2e1d4916a lookupInFlakeCache(): Fix O(n) time lookup 2024-12-16 14:58:39 +01:00
Eelco Dolstra
d1f20e3510 Make FetchedFlake a struct 2024-12-16 14:58:25 +01:00