Skip to content

buildRustPackage: fix fetch-cargo-deps when no Cargo dependencies - #22735

Closed
dermetfan wants to merge 1 commit into
NixOS:masterfrom
dermetfan:fix-rust-no-deps
Closed

dermetfan wants to merge 1 commit into
NixOS:masterfrom
dermetfan:fix-rust-no-deps

Conversation

@dermetfan

@dermetfan dermetfan commented Feb 13, 2017 •

Copy link
Copy Markdown
Member
Motivation for this change

buildRustPackage fails for projects that declare no dependencies in Cargo.toml.

Try building this example project:

❯ nix-build release.nix -A build --arg nixpkgs '<nixpkgs>' --argstr system x86_64-linux
these derivations will be built:
  /nix/store/dw177b3in0rmfsx237jlzqimbjmcxrpk-ill-fetch.drv
  /nix/store/c4klqbmccg501naxznl48w24hpazgdc1-ill.drv
building path(s) ‘/nix/store/dy1dywfq2mh035z4v0phmx0kg7p066cw-ill-fetch’
unpacking sources
unpacking source archive /nix/store/q6b7iql14yafz8j2hqq3x4g6fzpdamxy-ill
source root is ill
installing
Fetching /tmp/nix-build-ill-fetch.drv-0/ill to /nix/store/dy1dywfq2mh035z4v0phmx0kg7p066cw-ill-fetch
Using rust registry from /nix/store/ri6jzyj02dw56zr5bk9yvaci6zr4g7vw-rustRegistry-2017-01-27-6a73a15
warning: custom registry support via the `registry.index` configuration is being removed, this functionality will not work in the future
mv: missing destination file operand after '/nix/store/dy1dywfq2mh035z4v0phmx0kg7p066cw-ill-fetch/registry/cache/HASH'
Try 'mv --help' for more information.
builder for ‘/nix/store/dw177b3in0rmfsx237jlzqimbjmcxrpk-ill-fetch.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/c4klqbmccg501naxznl48w24hpazgdc1-ill.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/c4klqbmccg501naxznl48w24hpazgdc1-ill.drv’ failed
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot

Copy link
Copy Markdown

@dermetfan, thanks for your PR! By analyzing the history of the files in this pull request, we identified @abbradar, @madjar and @wizeman to be potential reviewers.

@dermetfan

dermetfan commented Feb 13, 2017 •

Copy link
Copy Markdown
Member Author

Sorry, I made a mistake during testing, this fix does not work. However the issue should still be valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants