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

cargo-edit: fix Darwin build #100289

Merged
merged 2 commits into from Oct 13, 2020
Merged

cargo-edit: fix Darwin build #100289

merged 2 commits into from Oct 13, 2020

Conversation

happysalada
Copy link
Contributor

Motivation for this change

Latest version was not building on darwin

Things done

Originally my intent was only to change things on darwin platform.
It appears though that libz was missing as a dependency.
Also in a lot of recent rust builds, cc crate attempts to run xcbuild.
I also run nixfmt, so some format has changed a little bit.

  • 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.

buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.Security ];
nativeBuildInputs = [
pkg-config
xcbuild # the cc crate attempts to run xcbuild
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be necessary once staging is merged in master:

#97000

Maybe add a reference + comment that this should be removed once that PR lands?

Also, the xcbuild dependency should (probably) be conditional so that's only used on Darwin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushed a fix, let me know if that works for you.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! I have pushed a change that makes the formatting a little more canonical. While at it, I tacked on another commit that passes the Security framework in the preferred manner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!
I didn't know that was the prefered manner. Will keep it in mind for next time.

Comment on lines 29 to 35
description =
"A utility for managing cargo dependencies from the command line";
homepage = "https://github.com/killercup/cargo-edit";
license = with licenses; [ asl20 /* or */ mit ];
license = with licenses; [
asl20 # or
mit
];
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes necessary? Did nixpkgs-fmt make them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I just ran the formatter.

Copy link
Contributor

Choose a reason for hiding this comment

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

Strange, I don't get that formatting with nixpkgs-fmt.

Copy link
Contributor

@danieldk danieldk left a comment

Choose a reason for hiding this comment

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

Should be good to go once ofborg is also happy.

@danieldk danieldk merged commit 7ab3951 into NixOS:master Oct 13, 2020
@happysalada happysalada deleted the cargo-edit branch April 28, 2023 19:58
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