[PATCH] D54328: Added 'cd -' built in to lit

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 14:50:36 PST 2018


rnk added a comment.

In https://reviews.llvm.org/D54328#1297688, @joerg wrote:

> As I said: because it makes it harder to rerun parts of the test interactively. Which is a good enough reason to forbid `cd -` as well as any directory stack operations, IMO.


Is your objection that you would prefer that tests remain written as `(cd dir && dosomething)`, and not use `cd -`? If so, I think it would be better to comment on the reviews that migrate the tests from one pattern to another. `cd -` is a generally available bash feature that any test author could use anywhere. It's really up to the individuals owners writing and maintaining tests as to whether they care more about using subshells vs. having their test run on Windows.

My understanding is that implementing the full set of features offered by subshells is pretty out of scope for lit. To be faithful, we'd really need to start launching a shell process that updates its real CWD, environment, stdout, stdin, etc. The goal of the python lit shell is to be fast on Windows, and launching those extra processes works against that goal. I would be in favor of adding a limited amount of subshell handling, but just adding `cd -` seems like a reasonable shortcut to me.


Repository:
  rL LLVM

https://reviews.llvm.org/D54328





More information about the llvm-commits mailing list