nix: workaround an issue with crate2nix, change some errors to be more clear

This commit is contained in:
Yusuf Bera Ertan 2020-12-12 21:14:29 +03:00
parent c5a7db06fb
commit 9ecaba8552
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA
4 changed files with 11 additions and 4 deletions

View File

@ -14287,7 +14287,7 @@ rec {
{
name = "csv";
packageId = "csv";
optional = true;
# optional = true;
}
{
name = "directories-next";
@ -14396,7 +14396,7 @@ rec {
{
name = "structopt";
packageId = "structopt";
optional = true;
# optional = true;
}
{
name = "sum_type";

6
nix/Cargo.nix_patches.md Normal file
View File

@ -0,0 +1,6 @@
Apply these instructions after generating the `Cargo.nix` file.
- Find `veloren-common` crate in `Cargo.nix`:
- Comment the `optional = true;` line for "structopt" and "csv" dependencies.
- See [this issue](https://github.com/kolloch/crate2nix/issues/129) on `crate2nix` repository for more info.
- Note that the suggested workaround in the issue **does not** work for us.

View File

@ -192,6 +192,7 @@ To update `Cargo.nix` (and `crate-hashes.json`) using latest `Cargo.lock`, run:
```shell
crate2nix generate -f ../Cargo.toml
```
Then follow the instructions in the `Cargo.nix_patches.md` file.
### Rust toolchain

View File

@ -37,7 +37,7 @@ let
prettyRev = with sourceInfo;
if sourceInfo ? rev && sourceInfo ? lastModified
then builtins.substring 0 8 rev + "/" + utils.dateTimeFormat lastModified
else throw "Need revision + lastModified to determine version";
else throw "Need revision + lastModified to determine pretty revision";
tag = with sourceInfo;
if sourceInfo ? tag
@ -51,7 +51,7 @@ let
version =
if tag != "" then tag
else if prettyRev != "" then prettyRev
else throw "Need a tag or at least revision + lastModified in order to determine version";
else throw "Need a tag or pretty revision in order to determine version";
veloren-assets = pkgs.runCommand "makeAssetsDir" { } ''
mkdir $out