r321997 - Avoid assumption that lit tests are writable. NFC
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 8 09:39:35 PST 2018
Hi David (and the list this time!),
If X is readonly, then after `cp X Y`, Y is also readonly. The `cat`
version doesn't propagate permissions.
The environment for lit tests isn't really spelled out, but relying on the
input files being +w doesn't seem obviously reasonable.
Google's internal runner puts them on a readonly filesystem, and has hacks
to deal with tests like this.
These hacks are causing me some pain, so I'm experimenting with removing
them. (Can give more details internally).
I don't have a great plan for keeping this from regressing - obviously only
the stuff that llvm-lit enforces can govern what gets checked in upstream.
That said, there are other cases (like writing outside of %T) where
google's runner is stricter, and fixing these upstream seems to be mostly
working.
Cheers, Sam
On Mon, Jan 8, 2018 at 5:05 PM, David Blaikie <dblaikie at gmail.com> wrote:
> I'm sure it's something obvious I don't understand here, but maybe someone
> else doesn't either & could benefit from it:
>
> What exactly does this change do? In what important way is "cp X Y"
> different from "cat X > Y"?
>
> On Mon, Jan 8, 2018 at 7:06 AM Sam McCall via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> Author: sammccall
>> Date: Mon Jan 8 07:05:01 2018
>> New Revision: 321997
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=321997&view=rev
>> Log:
>> Avoid assumption that lit tests are writable. NFC
>>
>> Modified:
>> cfe/trunk/test/ARCMT/releases-driver.m
>> cfe/trunk/test/ARCMT/releases-driver.m.result
>> cfe/trunk/test/ARCMT/with-arc-mode-modify.m
>> cfe/trunk/test/ARCMT/with-arc-mode-modify.m.result
>> cfe/trunk/test/PCH/verify_pch.m
>> cfe/trunk/test/VFS/real-path-found-first.m
>>
>> Modified: cfe/trunk/test/ARCMT/releases-driver.m
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/rel
>> eases-driver.m?rev=321997&r1=321996&r2=321997&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/test/ARCMT/releases-driver.m (original)
>> +++ cfe/trunk/test/ARCMT/releases-driver.m Mon Jan 8 07:05:01 2018
>> @@ -1,5 +1,5 @@
>> // RUN: %clang_cc1 -fblocks -fsyntax-only -fobjc-arc -x objective-c
>> %s.result
>> -// RUN: cp %s %t
>> +// RUN: cat %s > %t
>> // RUN: %clang_cc1 -arcmt-modify -triple x86_64-apple-macosx10.6 -x
>> objective-c %t
>> // RUN: diff %t %s.result
>> // RUN: rm %t
>>
>> Modified: cfe/trunk/test/ARCMT/releases-driver.m.result
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/rel
>> eases-driver.m.result?rev=321997&r1=321996&r2=321997&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/test/ARCMT/releases-driver.m.result (original)
>> +++ cfe/trunk/test/ARCMT/releases-driver.m.result Mon Jan 8 07:05:01
>> 2018
>> @@ -1,5 +1,5 @@
>> // RUN: %clang_cc1 -fblocks -fsyntax-only -fobjc-arc -x objective-c
>> %s.result
>> -// RUN: cp %s %t
>> +// RUN: cat %s > %t
>> // RUN: %clang_cc1 -arcmt-modify -triple x86_64-apple-macosx10.6 -x
>> objective-c %t
>> // RUN: diff %t %s.result
>> // RUN: rm %t
>>
>> Modified: cfe/trunk/test/ARCMT/with-arc-mode-modify.m
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/wit
>> h-arc-mode-modify.m?rev=321997&r1=321996&r2=321997&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/test/ARCMT/with-arc-mode-modify.m (original)
>> +++ cfe/trunk/test/ARCMT/with-arc-mode-modify.m Mon Jan 8 07:05:01 2018
>> @@ -1,5 +1,5 @@
>> // RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
>> -// RUN: cp %s %t
>> +// RUN: cat %s > %t
>> // RUN: %clang_cc1 -arcmt-modify -fsyntax-only -fobjc-arc -x objective-c
>> %t
>> // RUN: diff %t %s.result
>> // RUN: rm %t
>>
>> Modified: cfe/trunk/test/ARCMT/with-arc-mode-modify.m.result
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/wit
>> h-arc-mode-modify.m.result?rev=321997&r1=321996&r2=321997&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/test/ARCMT/with-arc-mode-modify.m.result (original)
>> +++ cfe/trunk/test/ARCMT/with-arc-mode-modify.m.result Mon Jan 8
>> 07:05:01 2018
>> @@ -1,5 +1,5 @@
>> // RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
>> -// RUN: cp %s %t
>> +// RUN: cat %s > %t
>> // RUN: %clang_cc1 -arcmt-modify -fsyntax-only -fobjc-arc -x objective-c
>> %t
>> // RUN: diff %t %s.result
>> // RUN: rm %t
>>
>> Modified: cfe/trunk/test/PCH/verify_pch.m
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/verif
>> y_pch.m?rev=321997&r1=321996&r2=321997&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/test/PCH/verify_pch.m (original)
>> +++ cfe/trunk/test/PCH/verify_pch.m Mon Jan 8 07:05:01 2018
>> @@ -2,7 +2,7 @@
>> // RUN: rm -rf %t
>> // RUN: mkdir -p %t/usr/include
>> // RUN: echo '// empty' > %t/usr/include/sys_header.h
>> -// RUN: cp %s %t.h
>> +// RUN: cat %s > %t.h
>> //
>> // Precompile
>> // RUN: %clang_cc1 -isystem %t/usr/include -x objective-c-header
>> -emit-pch -o %t.pch %t.h
>>
>> Modified: cfe/trunk/test/VFS/real-path-found-first.m
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/VFS/real-
>> path-found-first.m?rev=321997&r1=321996&r2=321997&view=diff
>> ============================================================
>> ==================
>> --- cfe/trunk/test/VFS/real-path-found-first.m (original)
>> +++ cfe/trunk/test/VFS/real-path-found-first.m Mon Jan 8 07:05:01 2018
>> @@ -7,7 +7,7 @@
>> // REQUIRES: shell
>> // RUN: rm -rf %t %t-cache %t.pch
>> // RUN: mkdir -p %t/SomeFramework.framework/Modules
>> -// RUN: cp %S/Inputs/some_frame_module.map
>> %t/SomeFramework.framework/Modules/module.modulemap
>> +// RUN: cat %S/Inputs/some_frame_module.map >
>> %t/SomeFramework.framework/Modules/module.modulemap
>> // RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g"
>> %S/Inputs/vfsoverlay.yaml > %t.yaml
>>
>> // Build
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180108/2e551d26/attachment.html>
More information about the cfe-commits
mailing list