This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Rewriting the path of sample profile file for --reproduce response.txt
ClosedPublic

Authored by hoy on Feb 5 2021, 5:57 PM.

Details

Summary

Rewritting the path of the sample profile file in response.txt to be relative to the repro tar.

Diff Detail

Event Timeline

hoy created this revision.Feb 5 2021, 5:57 PM
hoy requested review of this revision.Feb 5 2021, 5:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2021, 5:57 PM
hoy added a reviewer: wenlei.Feb 5 2021, 5:57 PM
MaskRay added inline comments.Feb 5 2021, 6:43 PM
lld/ELF/DriverUtils.cpp
182

move to the block below

lld/test/ELF/reproduce-lto.s
13

I don't think the output of tar is portable.

FileCheck %s --check-prefix=RSP < repro1/response.txt

hoy added inline comments.Feb 5 2021, 6:47 PM
lld/test/ELF/reproduce-lto.s
13

I'd like to check the path in response.txt matches the path in the tar ball, or at least it is a relative path. Not sure what is a good way. Maybe I can limit the test to Linux only.

MaskRay added inline comments.Feb 6 2021, 9:48 PM
lld/test/ELF/reproduce-lto.s
13

Perhaps xvf is fine...

hoy marked an inline comment as done.Feb 7 2021, 10:21 AM
hoy added inline comments.
lld/ELF/DriverUtils.cpp
182

Done.

lld/test/ELF/reproduce-lto.s
13

Yeah, since tvf is also there.

hoy updated this revision to Diff 321995.Feb 7 2021, 10:22 AM
hoy marked an inline comment as done.

Addressing MaskRay's comments.

MaskRay accepted this revision.Feb 8 2021, 2:43 PM
This revision is now accepted and ready to land.Feb 8 2021, 2:43 PM
thakis added a subscriber: thakis.Feb 11 2021, 1:14 PM

The extraction seems to makes this test fail on Windows: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8855568452346719664/+/steps/package_clang/0/stdout?format=raw

Not quite clear why. Maybe path name lengths or something. Can you take a look, and revert for now if it takes a while to fix?

hoy added a comment.Feb 11 2021, 1:16 PM

The extraction seems to makes this test fail on Windows: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8855568452346719664/+/steps/package_clang/0/stdout?format=raw

Not quite clear why. Maybe path name lengths or something. Can you take a look, and revert for now if it takes a while to fix?

Thanks for reporting this issue. I'll make the test limited to Linux only.

hoy added a comment.Feb 11 2021, 1:28 PM
In D96193#2558021, @hoy wrote:

The extraction seems to makes this test fail on Windows: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8855568452346719664/+/steps/package_clang/0/stdout?format=raw

Not quite clear why. Maybe path name lengths or something. Can you take a look, and revert for now if it takes a while to fix?

Thanks for reporting this issue. I'll make the test limited to Linux only.

So it looks like tar -xvf doesn't work on Windows:

tar: Record size = 10 blocks
repro1/response.txt
repro1/version.txt
repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/empty_profile.txt
tar: repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/empty_profile.txt: Could not create file: No such file or directory
repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/foo.o
tar: repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/foo.o: Could not create file: No such file or directory
tar: Error exit delayed from previous errors
 
note: command had no output on stdout or stderr
error: command failed with exit status: 2

I'm not sure how to disable the test on Windows only so I'm undoing the test changes.

In D96193#2558053, @hoy wrote:
In D96193#2558021, @hoy wrote:

The extraction seems to makes this test fail on Windows: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8855568452346719664/+/steps/package_clang/0/stdout?format=raw

Not quite clear why. Maybe path name lengths or something. Can you take a look, and revert for now if it takes a while to fix?

Thanks for reporting this issue. I'll make the test limited to Linux only.

So it looks like tar -xvf doesn't work on Windows:

tar: Record size = 10 blocks
repro1/response.txt
repro1/version.txt
repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/empty_profile.txt
tar: repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/empty_profile.txt: Could not create file: No such file or directory
repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/foo.o
tar: repro1/C/b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/lld/test/ELF/Output/reproduce-lto.s.tmp.dir/build1/foo.o: Could not create file: No such file or directory
tar: Error exit delayed from previous errors
 
note: command had no output on stdout or stderr
error: command failed with exit status: 2

I'm not sure how to disable the test on Windows only so I'm undoing the test changes.

Thanks. My guess it's due to path lengths. Since you only need the rsp file for your test, maybe extracting just that single file (tar xvf foo.tar myfile) will work?