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

yarn: add yarnpkg bin alias output #44133

Merged
merged 1 commit into from Jul 31, 2018
Merged

Conversation

nicknovitski
Copy link
Contributor

Motivation for this change

Because the hadoop project also provides a binary yarn, the yarn project added this alias to help people with both hadoop and yarn installed. Some scripts in the wild use this alias for the same reason.

With this change, those scripts are usable with the nixpkgs yarn package.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@@ -15,6 +15,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/{bin,libexec/yarn/}
cp -R . $out/libexec/yarn
makeWrapper $out/libexec/yarn/bin/yarn.js $out/bin/yarn
makeWrapper $out/libexec/yarn/bin/yarn.js $out/bin/yarnpkg
Copy link
Member

Choose a reason for hiding this comment

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

Would symlinks work for both cases?

@matthewbauer
Copy link
Member

matthewbauer commented Jul 28, 2018

I am thinking we should just move to using nodePackages.yarn & get rid of this one altogether. nodePackages.yarn runs yarn's package.json which sets up this symlink automatically.

@Mic92
Copy link
Member

Mic92 commented Jul 29, 2018

cc @offlinehacker who added this package in the first place.

@nicknovitski
Copy link
Contributor Author

@matthewbauer I agree, and I tried to make that change earlier in the year (#35063).

Updated to simply symlink. The wrappers work fine, but I don't see why they'd be necessary.

@matthewbauer
Copy link
Member

Ok, sorry hadn't seen that. For now this seems fine then. We probably want to fix the nodePackages thing though so that patches work correctly.

Because the hadoop project also provides a binary `yarn`, the yarn project [added this alias to help people with both hadoop and yarn installed](yarnpkg/yarn#673 (comment)).  Some scripts in the wild use this alias for the same reason.
@nicknovitski
Copy link
Contributor Author

Updated to fix merge conflict.

@matthewbauer matthewbauer merged commit a89857b into NixOS:master Jul 31, 2018
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

4 participants