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

fish: Fix regression due to changes in nixpkgs. #1703

Merged
merged 1 commit into from
Jan 9, 2021

Conversation

meck
Copy link
Contributor

@meck meck commented Jan 7, 2021

Description

Fix for changes in nixpkgs fish plugin organisation on unstable:

NixOS/nixpkgs@d94921d

fixes #1701 #1702

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

@meck meck requested a review from rycee as a code owner January 7, 2021 13:54
@@ -343,7 +343,7 @@ in {
# if we haven't sourced the general config, do it
if not set -q __fish_general_config_sourced

set -p fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions
set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d
Copy link
Member

Choose a reason for hiding this comment

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

Would this break users not tracking the latest unstable?
If so, how about using pkgs.fish-foreign-env or pkgs.fishPlugins.foreign-env?

Copy link
Member

Choose a reason for hiding this comment

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

Then it would need to be if pkgs ? fish-foreign-env then "${pkgs.fish-foreign-env}/share/fish-foreign-env/functions" else "${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d", since the directory providing the function changed as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

pkgs.fish-foreign-env still exists (NixOS/nixpkgs@d94921d#diff-29ed0f5fda84c91253503c1664d60a194a324e29518d472adf846f30b8db52e3R161), so branching by pkgs ? fish-foreign-env seems not to work.

Copy link
Member

Choose a reason for hiding this comment

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

Then:

Suggested change
set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d
set --prepend fish_function_path ${if pkgs ? fishPlugins && pkgs.fishPlugins ? foreign-env then "${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d" else "${pkgs.fish-foreign-env}/share/fish-foreign-env/functions"}

Copy link
Member

@rycee rycee Jan 9, 2021

Choose a reason for hiding this comment

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

Did anybody try the diff proposed by @cole-h? If it works then we can include it but otherwise I think it should be OK to merge as-is since I think it is reasonable to assume that HM follows Nixpkgs master as closely as possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll report on it later today. I agree simply tracking master is ok but if it's this simple to keep backwards compatibility, maybe it's fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wanted to try this out but I realized there's no home.imports or similar which is how I replace nixos modules. What's the most straightforward way for me to test this patch?

Copy link
Member

@berbiche berbiche Jan 9, 2021

Choose a reason for hiding this comment

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

You can set programs.home-manager.path = ~/path/to/cloned/home-manager and apply the modification locally.
This won't work when using flake (I think).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks to rycee's help I can now confirm that cole-h's suggestion works. The h-m manual makes a point of mentioning backward-compatibility for modules in this case the price for that is a branch : )

@rycee
Copy link
Member

rycee commented Jan 7, 2021

Force-pushed commit with updated commit message. I can't judge if this is mergeable or not.

@cole-h
Copy link
Member

cole-h commented Jan 7, 2021

It's mergeable if we don't mind breaking users who don't update nix{os,pkgs}-unstable and h-m unstable in lockstep.

@toonn
Copy link
Contributor

toonn commented Jan 8, 2021

Isn't the current situation broken for anyone who tracks nixpkgs-unstable close enough, regardless of how often they update h-m?

@meck
Copy link
Contributor Author

meck commented Jan 8, 2021

Isn't the current situation broken for anyone who tracks nixpkgs-unstable close enough, regardless of how often they update h-m?

I think so, the issue is someone updating HM without updating nixpkgs...

@toonn
Copy link
Contributor

toonn commented Jan 8, 2021

It's not clear to me why this would be backwards-incompatible for users who don't update channels in lock-step, could someone explain the problem? @cole-h's test covers the case where h-m is updated but nixpkgs isn't, doesn't it?

@rycee rycee merged commit e835812 into nix-community:master Jan 9, 2021
@rycee
Copy link
Member

rycee commented Jan 9, 2021

Thanks all! Merged to master with @cole-h's proposed change included.

timokau added a commit to timokau/nixpkgs that referenced this pull request Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fish: Unknown command: fenv
6 participants