Skip to content

Fix assign{Ips,Macs} #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GeoffreyFrogeye
Copy link

One is trivial, the other one is described more in details in its commit.

@reo101
Copy link
Owner

reo101 commented Apr 8, 2025

Great catches, thanks!

Could you link a source for the new integer behavior? Is it a commit/PR in upstream nix (with probably a cherry-pick to Lix, or something)?

@GeoffreyFrogeye
Copy link
Author

Sure! Here's the original bug report in Lix: https://git.lix.systems/lix-project/lix/issues/423 , which was then cherry-picked to Nix: NixOS/nix#11188 .

@reo101
Copy link
Owner

reo101 commented Apr 8, 2025

That's great, thank you! Could you also link to the upstream nix pr (11188) in a comment (or two) above the subtring calls, explaining why we're doing the cutoff? (I'd love to have it documented (a bit, at least) in the code itself. I'll swiftly merge afterwards. 😄

@reo101
Copy link
Owner

reo101 commented Apr 8, 2025

Maybe we should also wait out to see how the discussion at oddlama/nixos-extra-modules#1 (comment) goes 😄

@spacekitteh
Copy link

Relevant: NixOS/nix#13001

Half of SHA256 sums truncated to 16 chars actually go over 2^63,
which is beyond the range for hexToDec.
This fixes the integer overflow error in Lix 2.91+ and Nix 2.25+,
as well as undefined behaviour for versions below.
@GeoffreyFrogeye
Copy link
Author

@spacekitteh Woah, this is very cool to see proper bit shift implementations moving forward already!

It might still be a bit before this lands in stable, so I went ahead with @reo101 's great suggestion and added some comments in the code itself. I now realize you asked to specifically mention the PR, I noted the Lix/Nix versions. Hmm, people can still refer to the changelogs this way, which allows to keep the comments not too verbose either. But just say the word and I'll change it :)

I also added a warning about what still doesn't work as noted in oddlama/nixos-extra-modules#1 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants