Skip to content

Conversation

@DavidSpickett
Copy link
Collaborator

@DavidSpickett DavidSpickett commented Oct 21, 2025

%t is currently documented as:
temporary file name unique to the test

https://llvm.org/docs/CommandGuide/lit.html#substitutions

Which I take to mean if the path is a/b/c/tempfile, then %t would be tempfile. It is not, it's the whole path.

(which is hinted at by %basename_t, but why would you read that if you didn't need to use it)

As seen in #164396 this can create confusion when people use it as if it were just the file name.

Make it clear in the docs that this is a unique path, which can be used to make files or folders.

%t is currently documented as:
temporary file name unique to the test

Which I take to mean if the path is a/b/c/tempfile, then
%t would be tempfile. It is not, it's the whole path.

(which is hinted at by %basename_t, but why would you read
that if you didn't need to use it)

As seen in llvm#164396 this can create confusion when people use
it as if it were just the file name.

Make it clear in the docs that this is the path of a file.
@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-testing-tools

Author: David Spickett (DavidSpickett)

Changes

%t is currently documented as:
temporary file name unique to the test

https://llvm.org/docs/CommandGuide/lit.html#substitutions

Which I take to mean if the path is a/b/c/tempfile, then %t would be tempfile. It is not, it's the whole path.

(which is hinted at by %basename_t, but why would you read that if you didn't need to use it)

As seen in #164396 this can create confusion when people use it as if it were just the file name.

Make it clear in the docs that this is the path of a file.


Full diff: https://github.com/llvm/llvm-project/pull/164397.diff

1 Files Affected:

  • (modified) llvm/docs/CommandGuide/lit.rst (+1-1)
diff --git a/llvm/docs/CommandGuide/lit.rst b/llvm/docs/CommandGuide/lit.rst
index 70daae46170cd..89adb003832ef 100644
--- a/llvm/docs/CommandGuide/lit.rst
+++ b/llvm/docs/CommandGuide/lit.rst
@@ -628,7 +628,7 @@ TestRunner.py:
  %{fs-src-root}          root component of file system paths pointing to the LLVM checkout
  %{fs-tmp-root}          root component of file system paths pointing to the test's temporary directory
  %{fs-sep}               file system path separator
- %t                      temporary file name unique to the test
+ %t                      the path of a temporary file unique to the test
  %basename_t             The last path component of %t but without the ``.tmp`` extension (deprecated, use ``%{t:stem}`` instead)
  %%                      %
  %/s                     %s but ``\`` is replaced by ``/``

Copy link
Member

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

Copy link
Collaborator

@c-rhodes c-rhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also LGTM cheers, although looks like the description needs updating to drop the mention it's a file (since it's just a path that becomes a file or directory depending on what you do with it):

Make it clear in the docs that this is the path of a file.

@DavidSpickett
Copy link
Collaborator Author

Since this is about wording, I'll leave this open for a day or two and see if anyone else chimes in.

@DavidSpickett DavidSpickett merged commit ed87795 into llvm:main Oct 24, 2025
11 checks passed
@DavidSpickett DavidSpickett deleted the lit-doc-t branch October 24, 2025 09:05
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
%t is currently documented as:
temporary file name unique to the test

https://llvm.org/docs/CommandGuide/lit.html#substitutions

Which I take to mean if the path is a/b/c/tempfile, then %t would be
tempfile. It is not, it's the whole path.

(which is hinted at by %basename_t, but why would you read that if you
didn't need to use it)

As seen in llvm#164396 this can create confusion when people use it as if it
were just the file name.

Make it clear in the docs that this is a unique path, which can be used
to make files or folders.
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
%t is currently documented as:
temporary file name unique to the test

https://llvm.org/docs/CommandGuide/lit.html#substitutions

Which I take to mean if the path is a/b/c/tempfile, then %t would be
tempfile. It is not, it's the whole path.

(which is hinted at by %basename_t, but why would you read that if you
didn't need to use it)

As seen in llvm#164396 this can create confusion when people use it as if it
were just the file name.

Make it clear in the docs that this is a unique path, which can be used
to make files or folders.
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
%t is currently documented as:
temporary file name unique to the test

https://llvm.org/docs/CommandGuide/lit.html#substitutions

Which I take to mean if the path is a/b/c/tempfile, then %t would be
tempfile. It is not, it's the whole path.

(which is hinted at by %basename_t, but why would you read that if you
didn't need to use it)

As seen in llvm#164396 this can create confusion when people use it as if it
were just the file name.

Make it clear in the docs that this is a unique path, which can be used
to make files or folders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants