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

Reading from files in while loops broken since 3.39.0 #1965

Open
andrewimeson opened this issue Dec 17, 2024 · 0 comments
Open

Reading from files in while loops broken since 3.39.0 #1965

andrewimeson opened this issue Dec 17, 2024 · 0 comments
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@andrewimeson
Copy link

Description

This was originally reported in #1865 , but it looks like it got closed prematurely. The issue was reproducible in the upstream mvdan/sh interpreter (see mvdan/sh#1099) and was fixed at least as far as the simple case of directly invoking the interpreter goes. The issue still persists in Task, despite Task updating to the v3.10.0 release of Sh with the fix (#1874).

This first broke in Task v3.39.0, and is still broken in v3.40.1

Version

v3.40.1

Operating system

macOS

Experiments Enabled

No response

Example Taskfile

---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: 3
tasks:
  test:
    desc: Reproduce issue
    cmds:
      - |
        echo hi
        $_ --version

        # Works
      - |
        echo "hi pipe" | while read -r line; do
            echo "$line"
        done

        # Hangs
      - |
        echo "hi file" > hi.txt

        while read -r line; do
            echo "$line"
        done < hi.txt

        echo "done"

  clean:
    desc: Clean files
    cmds:
      - |
        rm hi.txt
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

2 participants