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

aliases: helpful 'fetchFromGithub' typo message #79854

Merged
merged 1 commit into from Feb 28, 2020

Conversation

alyssais
Copy link
Member

People keep asking for help on IRC because they’ve got the name wrong.

@infinisil
Copy link
Member

Not sure if this is the right solution for this. It might be possible for it to automatically throw such an error, I'll take a look at implementing this now.

@worldofpeace
Copy link
Contributor

worldofpeace commented Feb 11, 2020

@alyssais I did this ALL THE TIME when I first used NixOS, and I had to add a texteditor snippet to just never need to type it 😄

@Synthetica9
Copy link
Member

Not sure if this is the right solution for this. It might be possible for it to automatically throw such an error, I'll take a look at implementing this now.

@infinisil You mean in Nix?

@infinisil
Copy link
Member

@Synthetica9 In nixpkgs, the callPackage function can detect missing arguments and search for similar ones in that case. Seems to work, currently working on similarity search :)

@infinisil
Copy link
Member

And implemented! See #79877

@emilazy
Copy link
Member

emilazy commented Feb 12, 2020

I think it'd be a good idea to land this as a simple interim solution since #79877 seems mildly controversial, and simply revert it in that PR if people agree it's a reasonable approach.

@danbst
Copy link
Contributor

danbst commented Feb 16, 2020

I wish it was not an error, but a valid alias.

Maybe even rethink fetch* idiom. For example, put all fetchers into one collection:

fetch = {
  url = fetchUrl;
  zip = fetchZip;
  github = fetchFromGitHub;
  ...
};

{ stdenv, fetch, ... }:
stdenv.mkDerivation {
  srcs = [ 
    (fetch.url {
     ...
     })
    (fetch.github {
     ...
     })
  ];

@alyssais
Copy link
Member Author

I wish it was not an error, but a valid alias.

Then we’d get PRs from people with code that worked locally but didn’t work on OfBorg, because it (rightfully) doesn’t follow aliases.

@alyssais
Copy link
Member Author

@infinisil go ahead and revert when you get it working the better way :)

@alyssais alyssais merged commit dddcfac into NixOS:master Feb 28, 2020
@alyssais alyssais deleted the fetchFromGithub branch February 28, 2020 14:38
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

7 participants