aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-06-19refactor lambda formals handlingQyriad
Change-Id: Iebffd5436109da270ee870670a20f5ee7db9a204
2024-06-19libutil: BrotliDecompression{Sink -> Source}eldritch horrors
Change-Id: I9579dd08f7bd0f927bde9d3128515b0cee15f320
2024-06-18filetransfer: {up,down}load -> transfereldritch horrors
even the transfer function is not all that necessary since there aren't that many users, but we'll keep it for now. we could've kept both names but we also kind of want to use `download` for something else very soon Change-Id: I005e403ee59de433e139e37aa2045c26a523ccbf
2024-06-18libstore: fix queryValidPaths concurrencyJade Lovelace
The lock usage was obviously wrong so it was entirely serialized. This has the predicted speedups, the only question is whether it is sound because it's exposing a bunch of new code to actual concurrency. I did audit all the stores' queryPathInfoUncached implementations and they all look *intended* to be thread safe, but whether that is actually sound or not: lol lmao. I am highly confident in the s3 one because it is calling s3 sdk methods that are thread safe and has no actual state. Others are using Pool and look to be *supposed* to be thread safe, but unsure if they actually are. Change-Id: I0369152a510e878b5ac56c9ac956a98d48cd5fef
2024-06-18diff-closures: fix a use after freeJade Lovelace
Found by looking for interesting asan reports from the test suite. What happened here is that name got overwritten, but it was what actually held the backing memory for the thing it got overwritten by, which was a by-reference value coming out of std::regex. Due to absurd reasons I cannot seem to use a string_view iterator here, so I just copy the string with a longer lifetime instead. idk lol ==3796364==ERROR: AddressSanitizer: heap-use-after-free on address 0x503000014c61 at pc 0x74843523bf1d bp 0x7ffc68351330 sp 0x7ffc68350af0 READ of size 3 at 0x503000014c61 thread T0 0 0x74843523bf1c in __asan_memcpy (/nix/store/mzhqknx2mc94jdz4n320hn1lml86398y-clang-wrapper-17.0.6/resource-root/lib/linux/libclang_rt.asan-x86_64.so+0x159f1c) 1 0x6403cf6cbff4 in std::char_traits<char>::copy(char*, char const*, unsigned long) /nix/store/14c6s4xzhy14i2b05s00rjns2j93gzz4-gcc-13.2.0/include/c++/13.2.0/bits/char_traits.h:445:33 <...> 7 0x6403cf6cbff4 in std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>::str() const /nix/store/14c6s4xzhy14i2b05s00rjns2j93gzz4-gcc-13.2.0/include/c++/13.2.0/bits/regex.h:966:6 8 0x6403cf6cbff4 in std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>() const /nix/store/14c6s4xzhy14i2b05s00rjns2j93gzz4-gcc-13.2.0/include/c++/13.2.0/bits/regex.h:955:16 9 0x6403cf6cbff4 in nix::getClosureInfo[abi:cxx11](nix::ref<nix::Store>, nix::StorePath const&) /home/jade/lix/lix2/build/src/nix/diff-closures.cc:37:26 10 0x6403cf6cd70c in nix::printClosureDiff(nix::ref<nix::Store>, nix::StorePath const&, nix::StorePath const&, std::basic_string_view<char, std::char_traits<char>>) /home/jade/lix/lix2/build/src/nix/diff-closures.cc:54:25 11 0x6403cf873331 in CmdProfileDiffClosures::run(nix::ref<nix::Store>) /home/jade/lix/lix2/build/src/nix/profile.cc:479:17 <...> 0x503000014c61 is located 17 bytes inside of 21-byte region [0x503000014c50,0x503000014c65) freed by thread T0 here: 0 0x748435250470 in operator delete(void*) (/nix/store/mzhqknx2mc94jdz4n320hn1lml86398y-clang-wrapper-17.0.6/resource-root/lib/linux/libclang_rt.asan-x86_64.so+0x16e470) <...> 6 0x6403cf6cbda2 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::~basic_string() /nix/store/14c6s4xzhy14i2b05s00rjns2j93gzz4-gcc-13.2.0/include/c++/13.2.0/bits/basic_string.h:792:9 7 0x6403cf6cbda2 in nix::getClosureInfo[abi:cxx11](nix::ref<nix::Store>, nix::StorePath const&) /home/jade/lix/lix2/build/src/nix/diff-closures.cc:36:13 8 0x6403cf6cd70c in nix::printClosureDiff(nix::ref<nix::Store>, nix::StorePath const&, nix::StorePath const&, std::basic_string_view<char, std::char_traits<char>>) /home/jade/lix/lix2/build/src/nix/diff-closures.cc:54:25 <...> previously allocated by thread T0 here: 0 0x74843524fa38 in operator new(unsigned long) (/nix/store/mzhqknx2mc94jdz4n320hn1lml86398y-clang-wrapper-17.0.6/resource-root/lib/linux/libclang_rt.asan-x86_64.so+0x16da38) <...> 9 0x6403cf6cb68c in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::basic_string<std::basic_string_view<char, std::char_traits<char>>, void>(std::basic_string_view<char, std::char_traits<char>> const&, std::allocator<char> const&) /nix/store/14c6s4xzhy14i2b05s00rjns2j93gzz4-gcc-13.2.0/include/c++/13.2.0/bits/basic_string.h:784:4 10 0x6403cf6cb68c in nix::getClosureInfo[abi:cxx11](nix::ref<nix::Store>, nix::StorePath const&) /home/jade/lix/lix2/build/src/nix/diff-closures.cc:33:21 11 0x6403cf6cd70c in nix::printClosureDiff(nix::ref<nix::Store>, nix::StorePath const&, nix::StorePath const&, std::basic_string_view<char, std::char_traits<char>>) /home/jade/lix/lix2/build/src/nix/diff-closures.cc:54:25 12 0x6403cf873331 in CmdProfileDiffClosures::run(nix::ref<nix::Store>) /home/jade/lix/lix2/build/src/nix/profile.cc:479:17 <...> Change-Id: I9c408cf2a3d3155f9f7b2ad4848ee6c741331db0
2024-06-18store-api: fix/clarify capture lifetimes in copyPathsJade Lovelace
This seems to fix a use of stack after return. Change-Id: If690a6defb9a3225684685132cf78b227e271447
2024-06-18libstore: work around aws sdk log spam at debug levelJade Lovelace
aws-sdk-cpp spams logs about sending TLS data in the otherwise rather helpful debug logs. I've filed a PR upstream to stop it, but for now we can just fix their verbosity ourselves. Upstream-PR: https://github.com/aws/aws-sdk-cpp/pull/3003 Change-Id: I0c41a50d5f5958106836d6345843f4b05b9c8981
2024-06-18s3: delete obsolete ifdefsJade Lovelace
The versions checked for are so old that we can just drop support. Change-Id: Ib9cf136d1cb9a4a91a6613102c4fd15e1190363b
2024-06-18libutil: tidy Sync and fix its move constructorJade Lovelace
There was a previously-unused move constructor that just called abort, which makes no sense since it ought to just be `= delete` if you don't want one (commit history says it was Eelco doing an optimistic performance optimisation in 2016, so it probably would not pass review today). However, a Lock has some great reasons to be moved! You might need to unlock it early, for instance, or give it to someone else. So we change the move constructor to instead hollow out the moved-from object and make it unusable. Change-Id: Iff2a4c2f7ebd0a558c4866d4dfe526bc8558bed7
2024-06-18libfetchers: represent unfetched submodules consistentlyAlois Wohlschlager
Unfetched submodules are included as empty directories in archives, so they end up as such in the store when fetched in clean mode. Make sure the same happens in dirty mode too. Fortunately, they are already correctly represented in the ls-files output, so we just need to make sure to include the empty directory in our filter. Fixes: https://github.com/NixOS/nix/issues/6247 Change-Id: I60d06ff360cfa305d081b920838c893c06da801c
2024-06-17Merge changes from topic "protocol" into mainjade
* changes: libstore client: remove remaining dead code libstore: refuse to serialise ancient protocols libstore client: remove support for <2.3 clients libstore daemon: remove very old protocol support (<2.3) Delete old ValidPathInfo test, fix UnkeyedValidPathInfo Set up minimum protocol version
2024-06-17libexpr: add expr memory managementeldritch horrors
with the prepatory work done this mostly means turning plain pointers into unique_ptrs, with all the associated churn that necessitates. we might want to change some of these to box_ptrs at some point as well, but that would be a semantic change that isn't fully appropriate yet. Change-Id: I0c238c118617420650432f4ed45569baa3e3f413
2024-06-17libexpr: pass Exprs as references, not pointerseldritch horrors
almost all places where Exprs are passed as pointers expect the pointers to be non-null. pass them as references to encode this constraint in the type system as well (and also communicate that Exprs must not be freed). Change-Id: Ia98f166fec3c23151f906e13acb4a0954a5980a2
2024-06-17libexpr: store ExprConcatStrings elements as direct vectoreldritch horrors
storing a pointer only adds an unnecessary indirection at runtime. Change-Id: If06dd05effdf1ccb0df0873580f50c775608925d
2024-06-17libexpr: don't immediately throw parser errorseldritch horrors
now that destructors are hooked up we want to give the C skeleton every real chance to actually run them. since bison does not call destructors on values that have been passed to semantic actions even when an action causes an abort we will also have to delete some things manually still. Change-Id: Ia22bdaa9e969b74e17a6c496e35e6c2d86b7d750
2024-06-17libexpr: hook up bison destructors for state objectseldritch horrors
this doesn't help much yet since the state objects themselves also leak all memory they are given, but it is a first necessary step to properly managing parser memory. notably we have to clear $$ when returning from the parser since even the start symbol is subject to automatic deletion by the bison-generated parser before returning control to the call site Change-Id: I80245b0c747308e80923e7f18ce4e1a4898f93b0
2024-06-17mini-refactor "lambda.name or anonymous lambda" logicQyriad
Change-Id: I08d39c4ad5b967de526c0d5c5e6299256c7967f3
2024-06-17repl: implement tab completing :colon commandsQyriad
This uses a minor hack in which we check the rl_line_buffer global variable to workaround editline not including the colon in its completion callback. Fixes #361 Change-Id: Id159d209c537443ef5e37a975982e8e12ce1f486
2024-06-16libstore client: remove remaining dead codeJade Lovelace
Change-Id: I1764b3878439ff7b20ff64bd4efcf03070bb0e5e
2024-06-16libstore: refuse to serialise ancient protocolsJade Lovelace
We don't want to deal with these at all, let's stop doing so. (marking this one as the fix commit since its immediate predecessors aren't the complete fix) Fixes: https://git.lix.systems/lix-project/lix/issues/325 Change-Id: Ieea1b0b8ac0f903d1e24e5b3e63cfe12eeec119d
2024-06-16libstore client: remove support for <2.3 clientsJade Lovelace
Change-Id: I71c2e8ca644b6187e0084f35e82f3316c9d425b0
2024-06-16libstore daemon: remove very old protocol support (<2.3)Jade Lovelace
Change-Id: Ic05f478a659c199a66fe78ae05d357d317ac41b0
2024-06-16Delete old ValidPathInfo test, fix UnkeyedValidPathInfoJade Lovelace
The UnkeyedValidPathInfo test was testing an ancient version but not the current version. Doesn't make much sense to me. Change-Id: Ib476a4297d9075f2dcd31a073b3e7b149b2189af
2024-06-16Set up minimum protocol versionJade Lovelace
Change-Id: Ibb931109a8328cfb22964542ab53644cc4181f9e
2024-06-17Merge "Merge pull request #10799 from hercules-ci/safer-tab-completion" into ↵jade
main
2024-06-17Merge changes I9cf007c8,I9b9ba058 into mainjade
* changes: releng: fix broken manifest from 2.90-rc1 Change the sqlite missing valid path message to say it's the db
2024-06-16Merge "build: correctly propagate changes to Lix source to manual" into mainQyriad
2024-06-16releng: fix broken manifest from 2.90-rc1Jade Lovelace
Well that is embarrassing. I think the proper thing is to just quickly ship a -rc2, so I will open a backport of this. $ curl https://releases.lix.systems/manifest.nix # This file was generated by releng/create_release.xsh in Lix { aarch64-linux = "/nix/store/mrbknq000af7iaqhk53bnpk1fvfrc1xp-lix-2.90.0-rc1"; aarch64-darwin = "/nix/store/z1bdccwsk34iv491aygh0mm1lgpf7yy1-lix-2.90.0-rc1"; x86_64-darwin = "/nix/store/xqvfpdhzck44v6kyhgi9f8v0xybksb6a-lix-2.90.0-rc1"; x86_64-linux = "/nix/store/h2ml0nx4477r84y82jgm8y80jpr72gqw-lix-release-tarballs"; } Change-Id: I9cf007c850c2faf995a3a9d92457517b8501d1a1
2024-06-16Merge changes I81e76796,Iba319126 into mainArtemis Tosini
* changes: libutil: Set boost defines for FreeBSD meson.build: Allow undefined symbols on FreeBSD
2024-06-15Change the sqlite missing valid path message to say it's the dbJade Lovelace
I meant to edit https://gerrit.lix.systems/c/lix/+/1161 but apparently clicked the wrong button somehow. Oops. Change-Id: I9b9ba058ec9206d3c8abe125d91dc554cced52fe
2024-06-16Merge changes I07d2da41,I864d7340,I86612c64 into mainjulia
* changes: Change error messages about 'invalid paths' to 'path does not exist'. Add a clearer error message for InvalidPathError during evaluation Harmonise the Store::queryPathInfoUncached interface
2024-06-16Merge "docs: expand importNative/exec example (#10803)" into mainjade
2024-06-16Merge pull request #10799 from hercules-ci/safer-tab-completionRobert Hensing
Add repl completion test (cherry picked from commit 1e2b26734b4da101247678aec405c9dcfdc33f98) Change-Id: Ic3de39e71960a05a8676190b1ec9a7f0bb6057f5 Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
2024-06-16Change error messages about 'invalid paths' to 'path does not exist'.julia
Fixes #270. Change-Id: I07d2da41498cfdf324a03af40533044d58c97c7e
2024-06-16Add a clearer error message for InvalidPathError during evaluationjulia
Part of #270, #271 Change-Id: I864d7340f26d3c0f9c45db7b6b545face38d8294
2024-06-16Harmonise the Store::queryPathInfoUncached interfacejulia
This: - Consistently returns `nullptr` for a non-existent store path, instead of a mix of `nullptr` and throwing exceptions. - If a store returns "bad" store paths in response to a request (e.g. incorrect hash or name), don't cache this result. This removes some duplication of code at the cache-access layer of queryPathInfo() checking this, and ­allows us to provide more specific errors. Part of #270. Change-Id: I86612c6499b1a37ab872c712c2304d6a3ff19edb
2024-06-16build: correctly propagate changes to Lix source to manualQyriad
This adds the nix executable as an input argument to the custom targets that build the manual (HTML, and the man pages), so that changes to things like src/nix/nix.md cause the correct rebuilds Change-Id: Iffaa2c14acbfc721caef7b8cae9b53ecd365f26d
2024-06-16libutil: Set boost defines for FreeBSDArtemis Tosini
FreeBSD uses libunwind unwind.h, which does not require `_GNU_SOURCE` to expose `_Unwind_Backtrace`. Tell Boost that. Change-Id: I81e767967b1458118b86d212b5552d4d0a1200d9
2024-06-16meson.build: Allow undefined symbols on FreeBSDArtemis Tosini
The linker cannot find environ while linking libutil. Fix build by allowing undefined symbols Change-Id: Iba319126284d48454b50db40d3aadf37e0339668
2024-06-15version: update to 2.91-dev for mainJade Lovelace
This commit constitutes the branch-off for 2.91. The parent of this commit will be the branch point for release-2.90. Change-Id: I7f047545df29a9cff93346137c865dcbf1415488
2024-06-15releng: automatically add to the summary pageJade Lovelace
Also delete the obsolescent maintainers/release-notes script that is unmaintained. Change-Id: I3f4a75d790e8e00e970358ca8f32e8295c91aac3
2024-06-15release: release notes for 2.90.0Jade Lovelace
For now we just need to put the release notes in the final spot. We will have to fix the date on both 2.90 and 2.91 branches, but such as it is. Release created with releng/create_release.xsh Closes: https://git.lix.systems/lix-project/lix/issues/318 Change-Id: I38e79b40e7f632c8a286f2f09865a84dc93eca90
2024-06-14version: update to 2.90.0-rc2Jade Lovelace
Change-Id: I7cfa8414fa937de940b1598cc300497ce2d47635
2024-06-14release: merge release 2.90.0-rc1 back to mainlineJade Lovelace
This merge commit returns to the previous state prior to the release but leaves the tag in the branch history. Release created with releng/create_release.xsh Change-Id: I92296a1746b54a081004fe2bb23e9e37fd33b3e5
2024-06-14release: 2.90.0-rc1 "Vanilla Ice Cream"2.90.0-rc1Jade Lovelace
Release produced with releng/create_release.xsh Change-Id: Ib8df5ea5096d47b25f74988447146c1b5072b869
2024-06-15Merge changes from topic "releng" into mainjade
* changes: releng: add sha256 for the manual tarball releng: fix upload of multiarch images to forgejo releng: fix git checking releng: fix logging inside interactive xonsh releng: support multiple systems version: update to 2.90.0-rc1
2024-06-13releng: add sha256 for the manual tarballJade Lovelace
Whoops. Change-Id: Ic6f8cdcb074d679e9b1fc3323c106cc853328dcc
2024-06-13releng: fix upload of multiarch images to forgejoJade Lovelace
Forgejo appears to immediately delete registry content that is overwritten. This means that we are forced to delete our previous workaround of making a temporary tag and use a new, more absurd workaround of making an entire temporary image that we basically only need to create to get its hash. However, on the plus side, the new workaround doesn't create garbage tags to begin with, which means that we don't have to deal with GitHub not implementing the standardized tag delete endpoint and instead only implementing a proprietary one. Upstream-Bug: https://github.com/containers/skopeo/issues/2354 Change-Id: I220e7ce9a17fd230c38882f12c009a166dcc9336
2024-06-13releng: fix git checkingJade Lovelace
Change-Id: I82ddd918311b48e596adb807b81221973113fe7a
2024-06-13releng: fix logging inside interactive xonshJade Lovelace
I don't know when this broke, it seems like it happened since the 24.05 upgrade, so xonsh 0.15. What happened is that xonsh was trying to intercept log output, which explodes if you have the logger survive past one command input. This is, however, impossible to avoid if you are trying to use logging when you import releng from inside xonsh for interactive use! The error below is because the memory handler backing the stdout/stderr of the one command that's just been run was closed after the command completed. Change-Id: I2be642aebf93da9818d08ff8b97c2e72ba5ac581 --- Logging error --- Traceback (most recent call last): File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/logging/__init__.py", line 1113, in emit stream.write(msg + self.terminator) File "/nix/store/34951j60xcsw6zj4v8lsaf491acv0by3-python3-3.11.9-env/lib/python3.11/site-packages/xonsh/base_shell.py", line 183, in write self.mem.write(s) ValueError: I/O operation on closed file. Call stack: File "/nix/store/xgdp1p1gv8ni1awnkzyqasnn6gz5wlvx-xonsh-0.15.1/bin/xonsh", line 8, in <module> sys.exit(main()) File "/nix/store/34951j60xcsw6zj4v8lsaf491acv0by3-python3-3.11.9-env/lib/python3.11/site-packages/xonsh/main.py", line 470, in main sys.exit(main_xonsh(args)) File "/nix/store/34951j60xcsw6zj4v8lsaf491acv0by3-python3-3.11.9-env/lib/python3.11/site-packages/xonsh/main.py", line 514, in main_xonsh shell.shell.cmdloop() File "/nix/store/34951j60xcsw6zj4v8lsaf491acv0by3-python3-3.11.9-env/lib/python3.11/site-packages/xonsh/ptk_shell/shell.py", line 406, in cmd loop line = self.singleline(auto_suggest=auto_suggest) File "/nix/store/34951j60xcsw6zj4v8lsaf491acv0by3-python3-3.11.9-env/lib/python3.11/site-packages/xonsh/ptk_shell/shell.py", line 374, in sin gleline line = self.prompter.prompt(**prompt_args) File "/nix/store/34951j60xcsw6zj4v8lsaf491acv0by3-python3-3.11.9-env/lib/python3.11/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1 026, in prompt return self.app.run( File "/nix/store/34951j60xcsw6zj4v8lsaf491acv0by3-python3-3.11.9-env/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 1002, in run return asyncio.run(coro) File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/asyncio/runners.py", line 189, in run with Runner(debug=debug) as runner: File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/asyncio/runners.py", line 59, in __enter__ self._lazy_init() File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/asyncio/runners.py", line 137, in _lazy_init self._loop = events.new_event_loop() File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/asyncio/events.py", line 810, in new_event_loop return get_event_loop_policy().new_event_loop() File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/asyncio/events.py", line 699, in new_event_loop return self._loop_factory() File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/asyncio/unix_events.py", line 64, in __init__ super().__init__(selector) File "/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/lib/python3.11/asyncio/selector_events.py", line 54, in __init__ logger.debug('Using selector: %s', selector.__class__.__name__) Message: 'Using selector: %s' Arguments: ('EpollSelector',) Change-Id: I90959809129aaf96aad4577599031688599ed85e