Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildRustPackage: fix erroneous hard-coded source path #81203

Closed
wants to merge 1 commit into from
Closed

buildRustPackage: fix erroneous hard-coded source path #81203

wants to merge 1 commit into from

Conversation

dnaq
Copy link
Contributor

@dnaq dnaq commented Feb 27, 2020

When using the new cargo fetcher dependencies are validated against the
lockfile in the source project. Unfortunately the code that does the
validation assumes that the source of the package is in the source
directory, which it doesn't have to be. This breaks any package that
keeps its source in another directory.

The fix is to use $sourceRoot instead of source.

This affects #79975, since some crates won't be able to use buildRustPackage until this patch is merged.

Motivation for this change

Failure to build rust crates using the new cargo fetcher.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

When using the new cargo fetcher dependencies are validated against the
lockfile in the source project. Unfortunately the code that does the
validation assumes that the source of the package is in the `source`
directory, which it doesn't have to be. This breaks any package that
keeps its source in another directory.

The fix is to use `$sourceRoot` instead of `source`.
Copy link
Contributor

@bhipple bhipple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, you are the fourth person to hit this, when there's an open PR already fixing it :(

See here for details:
#79975 (comment)

I'll try to ask around and find someone with commit rights who can merge #80262, which I think supersedes your fix here.

@dnaq
Copy link
Contributor Author

dnaq commented Mar 1, 2020

Fixed by #80262

@dnaq dnaq closed this Mar 1, 2020
@dnaq dnaq deleted the buildRustPackage-source-path-bugfix branch March 1, 2020 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants