A target that always runs but does not invalidate its dependents

Hi,

I have a situation in which I have a target that needs to always run (something needs to be compiled externally using Stan). Now I don’t want the targets that depend on it to be triggered to run every time I run tar_make(). Instead, I would like these dependents to be triggered only if the a particular file is changed.

For example, consider the following targets:

  tar_target(util_stan_file, here("stan", "util.stan"), format = "file"),
  tar_target(pfs_functions_file, here("stan", "pfs_functions.stan"), format = "file"),
  tar_target(pfs_functions, cmdstan_expose_pfs_functions(util_stan_file, pfs_functions_file), cue = tar_cue("always")),
  tar_target(dependent, pfs_functions$foo(123)),

I don’t want that last target (dependent) to be re-run unless the dependencies of pfs_functions change (the first two targets, two files), not if pfs_functions changes.

Is there a way to do that?

Thanks,
Karim