Skip to content

buildRustPackage fails for projects with no dependencies in Cargo.toml #22737

Open

Description

@dermetfan

Issue description

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

see #22735

Steps to reproduce

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

Technical details

  • System: 17.03pre100522.01fef3f (Gorilla)
  • Nix version:nix-env (Nix) 1.11.6
  • Nixpkgs version: 17.03pre100522.01fef3f

Activity

  1. mmahut commented on Aug 11, 2019

    @mmahut
    Member

    Are there any updates to this issue, please?

  2. Deluvi commented on Oct 31, 2019

    @Deluvi

    I have just tested on the sample hello world that Cargo provides with cargo init, buildRustPackage was able to perform the build just fine. This has probably been fixed at some point.

  3. stale commented on Jun 1, 2020

    @stale

    Thank you for your contributions.
    This has been automatically marked as stale because it has had no activity for 180 days.
    If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
    Here are suggestions that might help resolve this more quickly:

    1. Search for maintainers and people that previously touched the
      related code and @ mention them in a comment.
    2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
      irc.freenode.net.
  4. added
    2.status: stale
    on Jun 1, 2020
  5. liff commented on May 9, 2022

    @liff
    Contributor

    I think this still happens. The elfcat package fails to build (from Hydra):

    unpacking sources
    unpacking source archive /nix/store/y61ycffrys6xjvgfhhhi8s2fidaz43ga-source
    source root is source
    patching sources
    configuring
    no configure script, doing nothing
    building
    There is no dependency to vendor in this project.
    Traceback (most recent call last):
      File "/nix/store/9cqhrbp7v53q98ly12gzpsqck1cxzqvp-cargo-vendor-normalise/bin/.cargo-vendor-normalise-wrapped", line 42, in <module>
        main()
      File "/nix/store/9cqhrbp7v53q98ly12gzpsqck1cxzqvp-cargo-vendor-normalise/bin/.cargo-vendor-normalise-wrapped", line 17, in main
        assert list(data.keys()) == ["source"]
    AssertionError
    

    It has cargoSha256 = null so I imagine this was working earlier and then regressed.

  6. removed
    2.status: stale
    on May 9, 2022
  7. liff commented on May 11, 2022

    @liff
    Contributor

    Bisected to dc93e10. Looks like the way cargo vendor works changed between 1.58 and 1.59.

    ❯ rustup run 1.58.1 cargo vendor
    To use vendored sources, add this to your .cargo/config.toml for this project:
    
    [source.vendored-sources]
    directory = "vendor"
    ❯ rustup run 1.59.0 cargo vendor
    There is no dependency to vendor in this project.
    

    The cargo-vendor-normalise script always expects the first kind of output.

  8. added
    2.status: stale
    on Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.status: stale

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions