-
Notifications
You must be signed in to change notification settings - Fork 325
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
use crate2nix for some of our rust crates #3686
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These function args are unused.
Still using that wireapp/rust-jwt-simple repository, but at least the latest version of the code, not a commit from Feb 10.
This needs crate2nix 0.11.0 (from a more recent nixpkgs checkout), but only during Cargo.nix recreation. Let's hope it's there the next time we update this file.
zebot
added
the
ok-to-test
Approved for running tests in CI, overrides not-ok-to-test if both labels exist
label
Nov 1, 2023
MangoIV
approved these changes
Nov 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current workflow for building rust crates is error-prone. It uses FOD, which can break in very subtle ways, and it's only visible when you either want to update the package, or some FOD got GC'ed from your store (or binary cache).
crate2nix allows a better workflow: given a source containing Cargo.toml and Cargo.lock, it can produce a
Cargo.nix
file (andcrate-hashes.json
), which will create per-crate-granularity nix derivation, allowing faster rebuilds of partial updates, as well as less flakyness when it comes to FODs.cryptobox
required some hacks, ascabal
(or our custom plumbing of calling cabal2Nix) expects a single output. I tried to work my way around this with emitting a pkg-config file, but couldn't get it to work, so now emit a single-output derivation (but the underlying build still uses crate2nix).libzauth-c
didn't build at all, it failed with [this errorI(https://stackoverflow.com/questions/73273886/why-do-i-get-prehashsignature-is-not-implemented-for-signature-error-when-usin). Instead of trying to push down certain feature flags, I tried bumping ourjwt-simple
pin to the most recent commit on this branch (we should be having multiple versions of this in flight anyways), and it built. 🎉mls-test-cli
doesn't work with crate2nix yet, due to a transitive build dependency being too crazy about#cfg
usage in itsCargo.toml
- I opened an upstream issue for that. Added a comment linking to the issue there.For
rusty_jwt_tools
, I can't even create aCargo.nix
. It seems like the workaround in wireapp/rusty-jwt-tools#54 (comment) is not sufficient for this mode of operation. We should really get a Cargo.lock file into the project root. Added a comment there, too.Checklist
changelog.d