Closed chives101 closed 1 year ago
@chives101 I seem to have a rather strange encoding issue when I run it with ./result/bin/grin --testnet
. It works if I do cargo build
and ./target/debug/grin --testnet
so it seems it's something with the build.
@phyro iirc this might be something related with libncurses.
@phyro Is it tested with the latest repo? I did a force push that updated the nixpkgs dependency which was pretty outdated.
I just tested the repo, works fine for me. BTW, you can do a local test by entering the project folder and do nix build
after applying the PR.
@phyro I did a fresh build on debian bullseye, I couldn't reproduce your issue though.
on nixos 22.11 it worked for me although it's weird that @phyro is getting these characters. I recall having the same problem but i've fixed it by installing newer ncurses or some other package. Will try to reproduce the problem.
@pkariz It is weird, because flake is supposed to be hermetic. Guess it's not that airtight after all.
@chives101 apologies that I didn't get back to you. I tried it again with the latest changes and I get the same. It seems @pkariz can't test this right now. My suggestion is to take the incremetal improvement appoach and merge it in. The current solution seems to work at least for those that are on nixos and some others (debian above) and this itself is valuable. It's also my observation that quite a few people in the Rust community like Nix so we'll likely get more people to chime in and patch it over time.
I'll wait a bit in case someone disagrees with merging, otherwise I'll go ahead and merge it.
Thanks for your contribution @chives101 ! I'm not around my PC to test the grin-wallet PR again after the changes until next week, but will do that then. :+1:
@phyro It's fine, it's nothing. I'm pretty sure there's more I can do :D
Motivation
This PR enables power users to easily and reliably build the project from source code.
Expectation
A user with the nix package manager installed can build the project with the following command:
nix build github:mimblewimble/grin
and expect the resulting binaries in
./result/bin
.Testing
If flake hasn't been enabled, use
nix build --extra-experimental-features 'nix-command flakes'
in place ofnix build
.A test run for this PR can be achieved using my forked repo with the following command:
nix build github:chives101/grin/flake
and expect a binary at./result/bin/grin
.Or by entering the project folder and do
nix build
after applying the PR.Dev notes
This PR is the result of a simple adaptation of the code from this blog post:
https://www.tweag.io/blog/2022-09-22-rust-nix/