这是indexloc提供的服务,不要输入任何密码
Skip to content

Cancel command when dependencies change? #513

@bojidar-bg

Description

@bojidar-bg

I'm using Tup for building a static website, and a few of the jobs are a lot slower compared to others (e.g. generating a PDF file vc copying a few HTML files as-is).
Unfortunately, while typing, I tend to habitually press save, which in turn would fire off the slow tasks, and tup would buffer any later updates until they are all completed. This tends to get in the way when I'm iterating on a file quickly.

So, to alleviate that issue, I would like to be able to tell Tup to send a SIGINT to a command if it sees that its dependencies have changed, since it is going to need to run that command again once it's completed anyway.
I would imagine this would also be useful to others who have a Tup monitor running with autoupdate, since there's limited utility to have a full build completed if it's already outdated once it's done.

Implementation-wise, I could see this being either:

  • a .tup/options option, e.g. monitor.cancel_updates or updater.cancel_on_change
  • a per-command option, e.g. : interruptible foreach foo.c bar.c | foo.h |> gcc -c %f -o %o |> %B.o
  • or perhaps, if a bit of compatibility breakage is considered worth it, the default Tup behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions