This is an archive of the discontinued LLVM Phabricator instance.

[ELF][test] Add reproduce test for dependent libraries
ClosedPublic

Authored by andrewng on Apr 7 2020, 9:32 AM.

Diff Detail

Event Timeline

andrewng created this revision.Apr 7 2020, 9:32 AM

Thanks. Probably add [test] to the title because there is no code change.

lld/test/ELF/reproduce-deplibs.s
12

-o /dev/null

14

cmp may be better for comparison between binary files.

andrewng updated this revision to Diff 255736.Apr 7 2020, 11:04 AM
andrewng retitled this revision from [ELF] Add reproduce test for dependent libraries to [ELF][test] Add reproduce test for dependent libraries.

Updated to address review comments.

andrewng marked 2 inline comments as done.Apr 7 2020, 11:10 AM
andrewng added inline comments.
lld/test/ELF/reproduce-deplibs.s
14

The other reproduce tests make use of diff, so I've just followed their lead. However, cmp probably is more appropriate for the binary files. Perhaps we should change them all to use cmp instead of diff where applicable?

MaskRay added inline comments.Apr 7 2020, 12:04 PM
lld/test/ELF/reproduce-deplibs.s
2

Can you also delete shell and check whether harbomaster (pre-merge testing) complains?

14

Yeah, I've noticed that. diff -> cmp should be fine.

Out of curiosity, how did you notice that reproduce-deplibs.s should be tested as well?

andrewng marked 2 inline comments as done.Apr 7 2020, 2:02 PM
andrewng added inline comments.
lld/test/ELF/reproduce-deplibs.s
2

I can try deleting shell but will need to add it back to prevent potential testing issues on Windows related to paths being too long when the reproduce TAR file is extracted. That's the reason why all the reproduce tests that extract the TAR file include shell.

14

I will change to cmp, although diff is a lit built-in command, so that might explain its usage elsewhere.

We have some legacy downstream regression tests which we are gradually migrating to lit. That's why we noticed that this coverage was missing.

andrewng updated this revision to Diff 255800.Apr 7 2020, 2:05 PM

Updated to address review comments.

MaskRay accepted this revision.Apr 7 2020, 2:40 PM

I don't know much about lit internals but the existing REQUIRES: shell made me wonder why it is needed. Feel free to keep it or not at your discretion.

This revision is now accepted and ready to land.Apr 7 2020, 2:40 PM
ruiu added inline comments.Apr 7 2020, 9:31 PM
lld/test/ELF/reproduce-deplibs.s
2

So basically you want to run this test on non-windows machine right?

UNSUPPORTED: system-windows

should express the intention more clearly.

jhenderson added inline comments.Apr 8 2020, 1:08 AM
lld/test/ELF/reproduce-deplibs.s
2

It might be worth a comment too saying WHY it's not supported on Windows, because that restriction isn't obvious at first glance.

13

Idle musing, feel free to ignore: I wonder whether we really need to check that the archive in the tar file is binary identical to the input one? Would just checking that the file is in the package be sufficient?

grimar added inline comments.Apr 8 2020, 1:48 AM
lld/test/ELF/reproduce-deplibs.s
13

I also wonder about it.

Our reproduce-windows.s has:

# RUN: tar tf repro.tar | FileCheck %s

# CHECK: repro/response.txt
# CHECK: repro/{{.*}}/build/foo.o
andrewng marked 2 inline comments as done.Apr 8 2020, 2:24 AM
andrewng added inline comments.
lld/test/ELF/reproduce-deplibs.s
2

I've followed what the other reproduce tests have done. I suspect the reasoning for shell is that this can be overridden if your Windows shell, environment and tools can support long paths. By default, shell is not enabled on Windows.

I will add a comment.

13

I've basically followed the convention of the other reproduce tests (except the Windows specific ones) that all check the contents too. I'm guessing this is just to be sure that it's also the correct file. I'm happy to change it to only test for its presence in the TAR file if that's the consensus.

jhenderson added inline comments.Apr 8 2020, 2:49 AM
lld/test/ELF/reproduce-deplibs.s
13

I don't really have an opinion either way. Happy to defer to others on this one.

andrewng updated this revision to Diff 255942.Apr 8 2020, 3:03 AM

Add comment to explain the Windows deficiencies (one of many)...

grimar added inline comments.Apr 8 2020, 3:17 AM
lld/test/ELF/reproduce-deplibs.s
6

Does it mean that using tar tf like reproduce-windows.s do would allow this to be enabled on windows?

13

I'd slightly prefer to avoid checking the content because LLD tests are already take some time to pass and would be good to reduce this time. I do not mind to leave it for a follow-up, but see my question above.

andrewng marked 2 inline comments as done.Apr 8 2020, 4:01 AM
andrewng added inline comments.
lld/test/ELF/reproduce-deplibs.s
6

Yes, tar tf only lists the contents of the TAR archive. That's why that is used in the Windows tests.

13

I think that if these comparisons are a concern, then we should address all the reproduce tests accordingly in a follow up.

grimar accepted this revision.Apr 8 2020, 4:29 AM

LGTM

lld/test/ELF/reproduce-deplibs.s
6

Then it is better to do in this way as disabling this test is unnecessary. If your intention is to improve testing coverage then enabling it to run on windows bots looks like a good thing to me.

13

My main concern now it that this and seems few other tests about --reproduce are disabled for no reason it seems.
Addressing the reproduce tests accordingly would solve both problems at once.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2020, 5:24 AM