Merge branch 'cargo-override' into 'master'

Cargo.nix override instead of requiring manual intervention

See merge request veloren/veloren!1647
This commit is contained in:
Imbris 2021-03-05 17:04:29 +00:00
commit 726cfcb8c9
3 changed files with 10 additions and 8 deletions

View File

@ -1,6 +0,0 @@
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,7 +192,6 @@ 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

@ -73,7 +73,16 @@ let
callPackage ./Cargo.nix {
defaultCrateOverrides = with common; with crateDeps;
defaultCrateOverrides // {
veloren-common = _: {
veloren-common = oldAttrs: {
# see: https://github.com/kolloch/crate2nix/issues/129
dependencies =
map
(dep:
if dep.name == "csv" || dep.name == "structopt"
then builtins.removeAttrs dep [ "optional" ]
else dep)
oldAttrs.dependencies;
# Disable `git-lfs` check here since we check it ourselves
# We have to include the command output here, otherwise Nix won't run it
DISABLE_GIT_LFS_CHECK = utils.isGitLfsSetup common.gitLfsCheckFile;