buck2: init at unstable-2023-05-17#232471
Conversation
b38cb2e to
ff546fd
Compare
Initialize buck2 at "unstable-2023-05-17". Add "nickgerace" to maintainers. Signed-off-by: Nick Gerace <nickagerace@gmail.com>
figsoda
left a comment
There was a problem hiding this comment.
Using rust nightly from external sources is not allowed due to the dependency on import-from-derivation
Instead, you can try adding RUSTC_BOOTSTRAP = true;, that can sometimes get around the nightly requirement using stable rust.
Consider using nix-update-script for passthru.updateScript, it will also handle updating outputHashes.
The bugs in nixpkgs-mozilla might be fixed in fenix, so if you wan to package buck2 out of tree, this can be an option.
|
Thank you @figsoda for the notes! I have questions and will go one by one.
Ah that explains why I needed
I'll try it, but am a bit concerned since upstream
Noted! That's great! Since there are no docs for it, is there a method you recommend for how to use and configure it?
I'm a bit confused. I should only pursue using fenix if I want to package buck2 outside of tree? Does "tree" refer to |
This is probably because there can potentially be breaking changes between nightly versions, not that it only works with one specific date. Though, do note that
The only alternative is to patch buck2 to be compatible with stable rust, which is probably not the easiest job.
You can add this right above passthru.updateScript = nix-update-script { };
Yes & Yes. Fenix is an alternative to mozilla's rust overlay and will also require IFD (which isn't allowed) to be used in nixpkgs. |
|
The use of What might be better in the very short term is to instead just contribute a package to the upstream Eventually we'll have to bite the bullet on this package though, because if something else that we want to package starts requiring |
There was a problem hiding this comment.
As of right now, I've found that the core buck2 codebase also rejects any non-sanctioned compiler, during compile time; see the following build.rs file: https://github.com/facebook/buck2/blob/c038ed271cca720bee43374e0c3883c59a625728/app/buck2_core/build.rs#L14-L55
I'm afraid going against the grain here by patching this out seems to clearly go against the explicit wishes of the dev team, and I don't think that's a place we want to be; so for now I'm going to tag this PR as being on hold and requiring changes.
I'll look into adding a package to the upstream flake instead as a short term mitigation for flake users, at least. I have also opened an issue to track using the stable rust compiler, which will alleviate these issues upstream; see facebook/buck2#265
|
Thank you @figsoda. I appreciate the replies and agree @thoughtpolice that using the toolchain that buck2 authors require is a requirement. I'll look into what you've shared. Speaking of which, hello @thoughtpolice! Thanks again for the work you've done with buck2-nix. I don't want to stray too far off topic because this is nixpkgs PR, so I may follow up in your repository or the facebook/buck2 repository as needed. Agreed on the use of I'll follow your tracking issue and can also help with the flake too. Thanks for posting that! As an aside, reindeer is built on stable Rust, so I will likely post a similar PR to this one here. I believe we will not run into the same issue there. As a result of all of this discussion, I am going to close this PR. I think a draft would drift quickly due to both buck2 and nix/nixpkgs itself moving quickly, and since closed PRs are indexable, we should be good should/once the opportunity arises to add buck2. Thank you both! |
2234: Add reindeer to our nix flake (ENG-1463) r=nickgerace a=nickgerace ## Relevant Issues and PRs - `buck2` with stable Rust: facebook/buck2#265 - `buck2` package request in nixpkgs: NixOS/nixpkgs#226677 - `buck2` PR for nixpkgs (closed due to inability to add it): NixOS/nixpkgs#232471 - `reindeer` package request in nixpkgs: NixOS/nixpkgs#232693 - `reindeer` PR for nixpkgs (merged): NixOS/nixpkgs#232699 ## GIF <img src="https://media4.giphy.com/media/7NTs0UJDuYz0k/giphy.gif"/> Co-authored-by: Nick Gerace <nick@systeminit.com>
Description of changes
This PR adds buck2 with the ability to auto update. A big thanks to @thoughtpolice for the inspiration on where to start as well as from the folks at @DeterminateSystems on advice on how to handle the difficult bits here.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Additional checks
nix-build -A buck2to produce the artifacts testedpkgs/development/tools/build-managers/buck2/update.shmanually with varying changes todefault.nixupon each run to simulate update scenariosAdditional notes
rustChannelOf({...}).rust-srcfromrust-overlay.nixerrors. mozilla/nixpkgs-mozilla#304Potential Issues
Needed to pass(EDIT: fixed)--allow ifdfornixpkgs-review prto be successfulbuck2is not a service