Skip to content

psub regression #4222

Closed
Closed

Description

@Darkshadow2

fish 2.6.0-247-g3e226f0

When psub was updated to use argparse, an old issue with using fifos was put back in place (see 5043b9d).

Activity

  1. krader1961 commented on Jul 17, 2017

    @krader1961
    Contributor

    Thanks for catching that. Obviously we have a gap in our unit tests since they should have caught the change. Can you share the code that brought the problem to light so we ensure our unit tests cover that case?

  2. krader1961 commented on Jul 17, 2017

    @krader1961
    Contributor

    FFS! The code "worked" before my argparse change because it was broken. See if you can spot the typo in one of the statements I changed from:

    if test use_fifo = 1
    

    to

    if not set -q _flag_file
    

    Those two statements should be equivalent but they're not because the original code was broken.

  3. krader1961 commented on Jul 17, 2017

    @krader1961
    Contributor

    So it was "fixed" by a17b9fd which added the missing dollar-sign. Then that was reverted (to the broken statement above) by 5043b9d when @faho realized the correction causes psub to use a fifo by default and fifo's don't actually work properly in this context. The right thing to do is to explicitly make using a file the default and provide an option for forcing the use of a fifo.

  4. Darkshadow2 commented on Jul 17, 2017

    @Darkshadow2
    ContributorAuthor

    Hmm, I'm not sure it would lend itself to a unit test. In my case, I'm using psub with less, and only noticed because less won't open a fifo by default. You may need to find some other command that opens a file but won't work with a fifo for the unit test.

    This is, (stripped down), the command:

    less (fish_indent --ansi < $__fish_datadir/functions/psub.fish | psub)

    This has less giving the error /var/folders/ky/_d4dmww16sn7pf37y99ckmz00000gn/T//.psub.ZL6VVZtAYS/psub.fifo is not a regular file (use -f to see it) (which, if I give less the -f argument, it does open). It also leaves a cat command sitting around in the background doing nothing (from psub).


    And yep, that's why I referenced that commit. I went looking for why it changed and came across those in the history.

  5. locked as resolved and limited conversation to collaborators on Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugregression

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions