[PATCH] D72357: Fix llvm-objcopy when directory contains "bar".

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 01:24:17 PST 2020


jhenderson added a comment.

(taking the discussion out-of-line, so that it's easier to read and quote)

> I wonder if we could have lit stdout rewrite the RUN commands so "foo < x y z" is printed out as "Get-Content x | foo y z"?

FWIW, I don't think complicating lit to support one specific shell (PowerShell) is that great an idea, given there's a straightforward enough workaround for me (drop down to cmd). It's inconvenient but I can handle it where it is needed (but I wouldn't want it to be more widespread than necessary).

I actually find something like `yaml2obj %s | llvm-readobj --symbols -` (or similar) more inconvenient, since it means there's no object on disk that can be easily inspected to see what the problem is when maintaining the test. I don't think this is being suggested here though.

> Some GNU binutils (nm, objdump, size) have a default file name: "a.out", when no filename is specified. llvm-nm, llvm-objdump, llvm-size and llvm-dwarfdump learned this rule from GNU binutils. I have a weak preference not doing this, but I don't have a strong enough motivation to change it, and I feel someone may report bugs if LLVM binary utilities don't have the default file name.

We shouldn't change the behaviour of tools with regards to `a.out`. This was attempted last year by @abrachet and reverted after various objections and problems, since there are configure scripts out there that assume the name is that.

Checks like `# BAR: bar` should be avoided regardless of path issues, as they have too great a chance of matching something else spuriously (there are plenty of words in the English language that have "bar" as a substring). Changing to redirecting via stdin doesn't solve this. Using something like `barrr` is less of an issue, but providing the context of the `Name:` field name makes the test more robust and more readable in my opinion. The chance of "Name: bar" appearing in somebody's path is minimal at best, and is even less likely if you add the end of line {{$}} pattern to the check.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72357/new/

https://reviews.llvm.org/D72357





More information about the llvm-commits mailing list