Skip to content

fish: suppress expected warnings in fish init on NixOS #27236

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

Closed
wants to merge 1 commit into from

Conversation

therealpxc
Copy link
Contributor

Motivation for this change

it fixes the cosmetic issues related to #27195 by suppressing a specific, expected error message only when necessary

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@mention-bot
Copy link

@therealpxc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jgillich, @rnhmjoj and @Profpatsch to be potential reviewers.

Copy link
Contributor

@0xABAB 0xABAB left a comment

Choose a reason for hiding this comment

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

I really hate to be that guy, but this solution does not match the requirements I specified.

Now, it might be that others want to approve it, but all the issues resulting from this will be on them.

Why do you implement this, while it so clearly doesn't meet the requirements?

@Mic92
Copy link
Member

Mic92 commented Jul 8, 2017

Thanks for your effort to fix this issue. I decided to merge the other pull request for the reason given here: #27227 (comment)

@Mic92 Mic92 closed this Jul 8, 2017
# `fenv` should not attempt to modify $_, but it seems to do so when
# used to run the bash `source` builtin. We don't need to hear about it,
# either.
set warnings_filter_pattern $warnings_filter_pattern"|"'|^set: Tried to change the read-only variable “_”$'
Copy link
Member

Choose a reason for hiding this comment

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

ok, I did not considered this one on the first spot. I will also look into it.

Copy link
Member

Choose a reason for hiding this comment

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

would it not be easier to just use:

fenv 'source ${config.system.build.setEnvironment}; unset _'

instead here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think something like that would work, if only because fenv doesn't correctly detect and address erased variables. If fenv did that, it would detect a change and still attempt to set (because $_ is always see to something initially). Should we go for it anyway?

@therealpxc
Copy link
Contributor Author

I'm glad a solution was merged, even if I'm partial to the one I made just because I made it. It was good to be part of the discussion and to see fish support become smoother on NixOS. :-)

@0xABAB
Copy link
Contributor

0xABAB commented Jul 8, 2017

@therealpxc Your solution is superior to the one currently merged. Perhaps @Mic92 will reconsider.

I think @Mic92 is also optimizing for likeability in order to make the number of Nixpkgs contributors grow. It's difficult to say what's optimal behavior, but I would rather set the bar higher and be as consistent as possible.

Thanks for playing regardless.

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.

None yet

4 participants