[llvm] r364673 - [llvm-ar] Document response file support in --help
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 18:50:18 PDT 2019
OK, I'll revert and try to reland.
On Fri, Jun 28, 2019 at 4:54 PM <douglas.yung at sony.com> wrote:
>
> Hi Sam,
>
> The test you added is failing when run on Windows:
>
> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/26661/steps/test/logs/stdio
>
> FAIL: LLVM :: tools/llvm-ar/response-file.test (46663 of 50627)
> ******************** TEST 'LLVM :: tools/llvm-ar/response-file.test' FAILED ********************
> Script:
> --
> : 'RUN: at line 1'; touch C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-a.txt C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-b.txt C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-c.txt
> : 'RUN: at line 2'; echo "rcs C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp.a C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-a.txt C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-b.txt C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-c.txt" > C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-response
> : 'RUN: at line 3'; rm -f C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp.a
> : 'RUN: at line 4'; c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\llvm-ar.exe @C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-response
> : 'RUN: at line 5'; c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\llvm-ar.exe t C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp.a | c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\filecheck.exe C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\test\tools\llvm-ar\response-file.test
> --
> Exit Code: 1
>
> Command Output (stdout):
> --
> $ ":" "RUN: at line 1"
> $ "touch" "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-a.txt" "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-b.txt" "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-c.txt"
> $ ":" "RUN: at line 2"
> $ "echo" "rcs C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp.a C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-a.txt C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-b.txt C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-c.txt"
> $ ":" "RUN: at line 3"
> $ "rm" "-f" "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp.a"
> $ ":" "RUN: at line 4"
> $ "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\llvm-ar.exe" "@C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\test\tools\llvm-ar\Output\response-file.test.tmp-response"
> # command output:
>
> OVERVIEW: LLVM Archiver
>
> USAGE: llvm-ar [options] [-]<operation>[modifiers] [relpos] [count] <archive> [files]
> llvm-ar -M [<mri-script]
>
> OPTIONS:
> --format - Archive format to create
> =default - default
> =gnu - gnu
> =darwin - darwin
> =bsd - bsd
> --plugin=<string> - Ignored for compatibility
> --help - Display available options
> --version - Display the version of this program
> @<file> - read options from <file>
>
> OPERATIONS:
> d - delete [files] from the archive
> m - move [files] in the archive
> p - print [files] found in the archive
> q - quick append [files] to the archive
> r - replace or insert [files] into the archive
> s - act as ranlib
> t - display contents of archive
> x - extract [files] from the archive
>
> MODIFIERS:
> [a] - put [files] after [relpos]
> [b] - put [files] before [relpos] (same as [i])
> [c] - do not warn if archive had to be created
> [D] - use zero for timestamps and uids/gids (default)
> [i] - put [files] before [relpos] (same as [b])
> [l] - ignored for compatibility
> [L] - add archive's contents
> [N] - use instance [count] of name
> [o] - preserve original dates
> [P] - use full names when matching (implied for thin archives)
> [s] - create an archive index (cf. ranlib)
> [S] - do not build a symbol table
> [T] - create a thin archive
> [u] - update only [files] newer than archive contents
> [U] - use actual timestamps and uids/gids
> [v] - be verbose about actions taken
>
> # command stderr:
> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\llvm-ar.exe: error: C:ps4-buildslave2llvm-clang-lld-x86_64-scei-ps4-windows10pro-fastllvm.objtesttoolsllvm-arOutputresponse-file.test.tmp-a.txt: no such file or directory.
>
>
> error: command failed with exit status: 1
>
> From the output, it appears that the path separators used in the response file need to be escaped. If I alter the response file that is created to have paths like C:\\\\foo\\bar instead of C:\foo\bar, then the test seems to work. I suspect this is a bug in how llvm-ar is parsing paths in response files on Windows. Can you take a look?
>
> Douglas Yung
>
> -----Original Message-----
> From: llvm-commits <llvm-commits-bounces at lists.llvm.org> On Behalf Of Sam Clegg via llvm-commits
> Sent: Friday, June 28, 2019 11:48
> To: llvm-commits at lists.llvm.org
> Subject: [llvm] r364673 - [llvm-ar] Document response file support in --help
>
> Author: sbc
> Date: Fri Jun 28 11:48:05 2019
> New Revision: 364673
>
> URL: http://llvm.org/viewvc/llvm-project?rev=364673&view=rev
> Log:
> [llvm-ar] Document response file support in --help
>
> Also a test for this.
>
> Differential Revision: https://reviews.llvm.org/D63836
>
> Added:
> llvm/trunk/test/tools/llvm-ar/response-file.test
> Modified:
> llvm/trunk/tools/llvm-ar/llvm-ar.cpp
>
> Added: llvm/trunk/test/tools/llvm-ar/response-file.test
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/response-file.test?rev=364673&view=auto
> ==============================================================================
> --- llvm/trunk/test/tools/llvm-ar/response-file.test (added)
> +++ llvm/trunk/test/tools/llvm-ar/response-file.test Fri Jun 28 11:48:05 2019
> @@ -0,0 +1,9 @@
> +RUN: touch %t-a.txt %t-b.txt %t-c.txt
> +RUN: echo "rcs %t.a %t-a.txt %t-b.txt %t-c.txt" > %t-response
> +RUN: rm -f %t.a
> +RUN: llvm-ar @%t-response
> +RUN: llvm-ar t %t.a | FileCheck %s
> +
> +CHECK: a.txt
> +CHECK-NEXT: b.txt
> +CHECK-NEXT: c.txt
>
> Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=364673&r1=364672&r2=364673&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
> +++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Fri Jun 28 11:48:05 2019
> @@ -78,6 +78,7 @@ OPTIONS:
> --plugin=<string> - Ignored for compatibility
> --help - Display available options
> --version - Display the version of this program
> + @<file> - read options from <file>
>
> OPERATIONS:
> d - delete [files] from the archive
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list