Hardcoding absolutely filenames into the workflow is bad practice - it makes it very hard to run two versions of it, run the same workflow with different data, share the workflow etc. similarly to how we'd all frown at hardcoding absolute file paths into a Makefile.
I feel like the problem is not as much $BASE idea, but multiple filesystems, and the right solution would be to add support for multiple filesystems into $BASE, for example:
BASE=/tmp (sets base for local file system)
BASE=hdfs://localhost:8028/tmp (sets base for HDFS file system)
a <- hdfs:b (translated into /tmp/a <- hdfs://localhost:8028/tmp/b)
To make this work nicely with workflows that don't run across multiple filesystems, we might need to add another variable to indicate the base filesystem. For example:
BASE=hdfs://localhost:8028/tmp
hdfs:a <- hdfs:b (inconvenient)
BASE_FS=hdfs
a <- b (same)
Having said that, this particular example doesn't actually need extended use of "!" even if we want to treat all filenames as absolute, because Drake could identify these filenames as absolute (i.e. starting with "/" for local, or filesystem prefix "hdfs:/"). This looks like a bug/oversight which can be easily fixed.
The intention of "!" is not to allow specifying absolute paths, but specifying off-base path, which can be relative to CWD. But since absolute paths can be detected automatically, describing it as "off-base" is not optimal - it seems better to describe is as CWD-base (rather than off-base), and say that whenever a filename is prepended with "!", it's relative to CWD rather than BASE. Since the default BASE is CWD, this should make no difference in this case. And it only works with local filesystems, so we could issue an error in other cases.
Let me know what you think.
Yours,
Artem.