3 ms·
There are a few references to NixOS on the code/issues.[0] I wonder what Meta's use case is for NixOS. [0] https://github.com/facebook/buck2/search?q=nixos&typ
by 1MachineElf 3y ago
There are a few references to NixOS on the code/issues.[0] I wonder what Meta's use case is for NixOS.
[0] https://github.com/facebook/buck2/search?q=nixos&type=issues https://github.com/facebook/buck2/search?q=nixos&type=issues
- ndmitchell 3y agoThese were from an open source contributor - out the box Buck2 doesn't really have support for Nix. But because the rules are flexible, you can write your own version of Nix-aware Buck2.
- aseipp 3y agoThat person creating the issues was me. I simply know of Neil's work, was a user of his previous build system Shake, and we ran in some similar circles in the past -- so when I saw buck2's source initially get released a few months ago on GitHub, I just started using it immediately and giving feedback long before the initial release. Nobody at Meta uses NixOS for production work, from my understanding. Actually, the current tip of trunk for buck2 can't build on NixOS right now with buildRustPackage due to a problem with prost. I should probably file a root cause issue about that soon...
- yencabulator 3y agoEDIT: nevermind, I couldn't get it to build due to a prost issue, gave up and did `cargo build` instead. I misremembered. crane.dev with nightly-2023-03-15 from oxalica/rust-overlay built here okay (after I figured out all the BUCK2_BUILD_PROTOC, missing Cargo.lock, etc tricks). I did have some weird trouble with trying to import buck2 into my flake as a non-flake input, with complaints about "failed to resolve patches" for prost, but putting the flake.nix into the buck2 source tree worked.
- aseipp 3y agoJust using `cargo build` will work as you've seen, but building a Nix package won't work right now. If you're still keeping up with this thread, though, I have code in this repository to build a copy of buck2 with Nix -- it's several weeks out of date at this point though: - https://github.com/thoughtpolice/buck2-nix/tree/main/buck/nix/buck2 https://github.com/thoughtpolice/buck2-nix/tree/main/buck/ni... You should mostly be able to just 'callPackage' that and have it work if you have rust-overlay applied. Check the corresponding 'flake.nix' if you need it. The prost issue with buildRustPackage is preventing an upgrade, so ideally the minor patches to prost can get upstreamed, but I need to (again) file a ticket about moving this along.