Skip to content

--list-all spends time globbing for sources. #1322

@StefanBRas

Description

@StefanBRas

task --list-all is computing something even though it seems like it shouldn't to show the list of tasks.

It's an problem because autocompletion relies on --list-all so right now it's not usable for me.

It takes ~2 seconds (user time, 12 system) to run --list-all.

Not directly related, but it seems to be some interaction with globbing for sources and using for in commands that makes it take a long time to run in general.

Given this task file

version: '3'
tasks:
  default:
    sources:
    - dev/*.json
    cmds:
      - for: sources
        cmd: echo {{ dir .ITEM }}

It takes again 2 seconds ish, but

version: '3'
tasks:
  default:
    sources:
    - "dev/*.json"
    cmds: 
    - "echo hey"

is instant.

It's difficult to recreate, because it's only for some folders it takes a long time. I think it's related to #225.

  • Task version: v3.28.0 (h1:PGYGwevlGQdYrqhO6lLCYylC7YuGoQLlVwHkO42gf0I=)
  • Operating system: macOS ventura 13.5
  • Experiments enabled: No

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: loopsChanges related to looping over tasks/commands.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions