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

clean up Nix flake using zon2nix #1395

Merged
merged 2 commits into from
Oct 1, 2023
Merged

clean up Nix flake using zon2nix #1395

merged 2 commits into from
Oct 1, 2023

Conversation

figsoda
Copy link
Contributor

@figsoda figsoda commented Aug 9, 2023

now updating the nix flake just needs one command (zon2nix > deps.nix) and we are no longer relying on the magic that stopped comments from working

closes #1024

also reverts #1265 and updated the comment, as comments are now allowed

@figsoda
Copy link
Contributor Author

figsoda commented Aug 19, 2023

fixed merge conflicts

@figsoda
Copy link
Contributor Author

figsoda commented Aug 23, 2023

cc @Techatrix @leecannon

@SuperAuguste
Copy link
Member

Sorry for the late reply! We don't actually have any maintainers who are Nix users as far as I'm aware so this fell through the cracks.

@acristoffers sorry to bug you but you really seem to know your nix - at a glimpse this looks correct, just want to make sure I'm not missing anything; could you leave a review if you have time? :)

@acristoffers
Copy link
Contributor

@figsoda did what I wanted to do since the beginning but never got to it because I didn't want to manage the dependency tree myself (which it seem zig is not going to have, it's going to be flat). So thanks @figsoda for the project and for cleaning up the mess of ((((functions)))) I had to use to do it in nix with less manual interference :)

@acristoffers
Copy link
Contributor

And no problem pinging me @SuperAuguste :)

@figsoda
Copy link
Contributor Author

figsoda commented Sep 23, 2023

resolved merge conflicts

@figsoda
Copy link
Contributor Author

figsoda commented Sep 23, 2023

Sorry for the late reply! We don't actually have any maintainers who are Nix users as far as I'm aware so this fell through the cracks.

No worries

@Techatrix
Copy link
Member

We don't actually have any maintainers who are Nix users as far as I'm aware

Actually, I do use NixOS as my operating system but I do not have the necessary expertise to review this PR.
But I do think that ideally there should not be any need manually manage zig dependencies with zon2nix. If there are helpers like rustPlatform.buildRustPackage, then where is something like buildZigPackage?

@figsoda
Copy link
Contributor Author

figsoda commented Sep 23, 2023

Actually, I do use NixOS as my operating system but I do not have the necessary expertise to review this PR. But I do think that ideally there should not be any need manually manage zig dependencies with zon2nix. If there are helpers like rustPlatform.buildRustPackage, then where is something like buildZigPackage?

Unfortunately build.zig.zon uses a different hash format compared to the ones nix support, so to use these dependencies with nix, one has to either keep track of one FOD hash (like cargoHash / fetchCargoTarball) that needs to be manually updated, or the approach zon2nix takes, since the importCargoLock equivalent in zig is not possible due to the differences in hashing algorithms.

@acristoffers
Copy link
Contributor

At least 1 approving review is required by reviewers with write access.

Well, that's not me 🙃

@figsoda
Copy link
Contributor Author

figsoda commented Sep 29, 2023

resolved merge conflicts

@SuperAuguste SuperAuguste merged commit bec9b61 into zigtools:master Oct 1, 2023
3 checks passed
@figsoda figsoda deleted the zon branch October 1, 2023 13:21
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.

Builtin dependency system will break nix flake.
4 participants