-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
reth: 0.2.0-beta.6 -> 1.0.1 #530
base: main
Are you sure you want to change the base?
Conversation
pkgs/reth/default.nix
Outdated
buildInputs = lib.optionals stdenv.isDarwin [ | ||
darwin.apple_sdk.frameworks.Security | ||
]; | ||
cargoExtraArgs = "--no-default-features" + (if stdenv.system != "x86_64-darwin" then " --features jemalloc" else ""); |
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.
There has been >1000 commits since 0.2.0-beta.6. It is entirely possible this is no longer required, however I have no way to test x86_64-darwin.
If we don't like the the addition of the crane dependency, I think once NixOS/nixpkgs#326365 is merged I should be able to refactor this to use |
@scottbot95 I would prefer to wait instead to use |
Sure that sounds reasonable to me. I will update once my change has been merged to nixpkgs. That will also require I update the |
@scottbot95 just include it on this one as it's tied to this specific work. |
@scottbot95 given the upstream PR for |
Unfortunate, but that sounds reasonable to me. FWIW I have a local branch where I'm targeting my fork of nixpkgs and I have confirmed that it builds cleanly using |
@scottbot95 is there anything else to account for or can I proceed with merging the PR? |
@aldoborrero I successfully used this commit to sync a holesky node so I think we should be good unless you care about bottoming out whatever the darwin issues are. Those might just go away when we switch back to |
@scottbot95 would you mind fixing the conflict? |
Rebased against main |
acb1df4
to
21a7082
Compare
Sorry for taking a while to look at this. I think the issue is the |
21a7082
to
1139c94
Compare
Hmm still failing... I think this will require someone who actually understands darwin at all to resolve. |
@brianmcgee would you be kind to test it on your Mac? |
Can we consider dropping darwin support for now for reth? If someone actually needs it, maybe they can also figure out what is wrong with the build command. |
I think this makes sense, @aldoborrero @selfuryon ? |
It does. Let's proceed without |
Reth recently had their 1.0, production-read release. This PR updates reth to the latest 1.0.1 release.
Considerations
I had to make several potentially controversial changes in order to get reth to build. Specifically two new flake inputs where added, rust-overlay and crane
rust-overlay
Reth requires Rust 1.79.0, this required pulling in the rust-overlay flake as even nixpkgs-unstable only has 1.78.0.
crane
The nixpkgs native
rustPlatform.buildRustPackage
is fairly rudimentary and doesn't play nicely with Rusts incremental compilation (it will re-download and rebuild your ENTIRE dependency closure every time the nix derivation is built). This is partially Rust's fault (since a package can change how it's dependencies are compiled), however the crane flake was designed to help improve this situation and reduce re-compile times. Crane also turned out to be required for testing as described below.Testing
Reth has an extensive testing suite. These tests don't require nextest, however we only want to run the unit tests which is difficult to do with
cargo test
(would require a significant number of--skip
args), but can easily be accomplished by providing-E '!kind(test)'
to thenextest
invocation. Additionally some "unit" tests require I/O access that is not compatible with the nix sandbox requiring us to skip several specific tests. Innextest
this looks like-E '!kind(test) - test(tests::test_exex)'
.Unfortunately, when passing arguments via
rustPlatform.buildRustPackage
, nix tries to be "help" and will shell escape all arguments passed in. This completely breaks the-E
args because it contains special characters that need to be included as-is to the actual call tocargo nextest run
. There would be a workaround for this, simply havepreCheck
script that directly modifiescargoTestFlags
, however unfortunately there is a bug in nixpkgs here where despitecargoTestFlags
being an array, only the first element of that array is included in the final call (${cargoTestFlags}
instead of the correct${cargoTestFlags[@}}
.I have opted to use
nextest
since that is the officially supported testing platform with Reth and also executes >x3 faster thancargo test
. This forced me to use crane due to the inability to properly pass in args to thecargo nextest run
call withrustPlatform.buildRustPackage