Update Lix to latest revision #8

Closed
ma27 wants to merge 5 commits from ma27:lix-update into main
Member

cc @delroth @leo60228

cc @jade who authored the related Lix change. Would be nice if you could double-check if I didn't mess anything up in e92ac734e6 :)

cc @delroth @leo60228 cc @jade who authored the related Lix change. Would be nice if you could double-check if I didn't mess anything up in e92ac734e6 :)
ma27 added 2 commits 2024-09-26 13:03:49 +00:00
Flake lock file updates:

• Updated input 'lix':
    'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=02eb07cfd539c34c080cb1baf042e5e780c1fcc2' (2024-09-01)
  → 'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=31954b51367737defbae87fba053b068897416fb' (2024-09-26)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/6e99f2a27d600612004fbd2c3282d614bfee6421' (2024-08-30)
  → 'github:NixOS/nixpkgs/759537f06e6999e141588ff1c9be7f3a5c060106' (2024-09-25)
Since ca1dc3f70bf98e2424b7b2666ee2180675b67451, the NAR parser has moved
the preallocate & receive steps into the file handle class to remove the
assumption that only one file can be handled at a time.
jade reviewed 2024-09-26 17:03:23 +00:00
jade left a comment
Owner

i mean there's really nothing wrong with this code but there's a couple things you could make a bit better

i mean there's really nothing wrong with this code but there's a couple things you could make a bit better
@ -12,0 +18,4 @@
public:
MyFileHandle(NarMemberData * memberData, uint64_t size) : memberData(memberData)
{
expectedSize = size;
Owner

should be in the initializer above rather than in the function itself

should be in the initializer above rather than in the function itself
ma27 marked this conversation as resolved
@ -12,0 +19,4 @@
MyFileHandle(NarMemberData * memberData, uint64_t size) : memberData(memberData)
{
expectedSize = size;
hashSink = std::make_unique<HashSink>(HashType::SHA256);
Owner

does this actually have to be behind a pointer? only reason i can see that it would is being big but i don't think it's big.

edit: oh, it might be the reset() maybe? so that it becomes null and crashes if you put extra data in it?

does this actually have to be behind a pointer? only reason i can see that it would is being big but i don't think it's big. edit: oh, it might be the reset() maybe? so that it becomes null and crashes if you put extra data in it?
Author
Member

I guess we can leave that as-is then, correct @jade?

I guess we can leave that as-is then, correct @jade?
Owner

yeah you can leave it alone, it's fine.

yeah you can leave it alone, it's fine.
jade marked this conversation as resolved
@ -32,2 +60,3 @@
std::unique_ptr<FileHandle> createRegularFile(const Path & path, uint64_t size, bool executable) override
{
curMember = &members.insert_or_assign(prefix + path, NarMemberData {
auto memberData = &members.insert_or_assign(prefix + path, NarMemberData {
Owner

probably should be auto * right?

or you could refactor it into being a reference now that the field doesn't need to be reassigned; either way.

probably should be `auto *` right? or you could refactor it into being a reference now that the field doesn't need to be reassigned; either way.
ma27 marked this conversation as resolved
Author
Member

i mean there's really nothing wrong with this code but there's a couple things you could make a bit better

To be clear, that's also helpful for me!

I mostly do C++ because I'm interested in hacking on Lix & Hydra, so getting input on how to do things better is very valuable to me. Thank you!

I'll try to get back to you this weekend for that.

> i mean there's really nothing wrong with this code but there's a couple things you could make a bit better To be clear, that's also helpful for me! I mostly do C++ because I'm interested in hacking on Lix & Hydra, so getting input on how to do things better is very valuable to me. Thank you! I'll try to get back to you this weekend for that.
ma27 added 1 commit 2024-10-06 17:44:46 +00:00
* Turn `NarMemberData` in `MyFileHandle` into a reference.
* `expectedSize` now uses an initializer.
* Used `std::make_unique` instead of `std::unique_ptr(new ...)` as
  suggested by clangd.
Owner

(ah fyi the reason ours was using the constructor and new instead of make_unique is that it was a private constructor and so the template couldn't call it. not the case here; doesn't strictly need to be the case because it's unrealistic anyone would call that constructor when they shouldn't, so you can just leave it as-is)

(ah fyi the reason ours was using the constructor and new instead of make_unique is that it was a private constructor and so the template couldn't call it. not the case here; doesn't strictly need to be the case because it's unrealistic anyone would call that constructor when they shouldn't, so you can just leave it as-is)
Author
Member
cc @vriska @yu-re-ka @raito
ma27 added 2 commits 2024-10-07 16:07:24 +00:00
Flake lock file updates:

• Updated input 'lix':
    'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=31954b51367737defbae87fba053b068897416fb' (2024-09-26)
  → 'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=ed9b7f4f84fd60ad8618645cc1bae2d686ff0db6' (2024-10-05)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/759537f06e6999e141588ff1c9be7f3a5c060106' (2024-09-25)
  → 'github:NixOS/nixpkgs/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6' (2024-10-06)
The Finally part is a destructor, so using `ignoreExceptionInDestructor`
seems to be the correct choice here.
jade approved these changes 2024-10-07 16:53:22 +00:00
Member

Thanks, I pushed these changes to the main branch with some rearrangements of the commit (squashed the "address review-comments" into the previous commit etc)

Thanks, I pushed these changes to the main branch with some rearrangements of the commit (squashed the "address review-comments" into the previous commit etc)
yu-re-ka closed this pull request 2024-10-07 17:24:35 +00:00
ma27 deleted branch lix-update 2024-10-07 17:38:55 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/hydra#8
No description provided.