Skip to content
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

uint64 can exceed Nix integer range #185

Open
Scandiravian opened this issue Mar 28, 2025 · 3 comments
Open

uint64 can exceed Nix integer range #185

Scandiravian opened this issue Mar 28, 2025 · 3 comments
Assignees

Comments

@Scandiravian
Copy link

An integer in Nix is always signed, which can lead to issues when a number exceeds 2^63 - 1.

For instance, I ran nixos-facter on a Dell R760 server, which sets the value of an entry in hardware.memory_array_mapped_address to 18446741876833779712. This makes the nix configuration fail to build when anything references the report as JSON seems to be eagerly loaded by nix.

This is clearly an edge case, but would it be possible to use strings instead of uint64 in the output for these values?

@brianmcgee brianmcgee self-assigned this Mar 29, 2025
@brianmcgee
Copy link
Collaborator

🤔 I'll have a look a bit later this week.

@Scandiravian
Copy link
Author

Please let me know if there's anything I can do to help. I have some experience in Go and since this related to my work, I can spend a bit of time on it.

Do you know what an ideal solution to this would look like for you (if you think this should be fixed)? If you let me know I can look into implementing it

Thanks for all the work you're putting into this project - facter is an extremely useful tool for me!

@brianmcgee
Copy link
Collaborator

@Scandiravian, I'm glad to hear you find it helpful.

I will try to think through the implications for a bit today. I'll post my thoughts here.

Happy to review PRs if you want to implement the fix 🙏

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

No branches or pull requests

2 participants