Page MenuHomePhabricator

[lit] Disable test on darwin when building shared libs.
ClosedPublic

Authored by hintonda on May 8 2019, 1:53 PM.

Details

Summary

This test fails to link shared libraries because tries to run
a copied version of clang-check to see if the mock version of libcxx
in the same directory can be loaded dynamically. Since the test is
specifically designed not to look in the default just-built lib
directory, it must be disabled when building with
BUILD_SHARED_LIBS=ON.

Currently only disabling it on Darwin and basing it on the
enable_shared flag.

Diff Detail

Repository
rL LLVM

Event Timeline

hintonda created this revision.May 8 2019, 1:53 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 8 2019, 1:53 PM

@zturner, I only disabled this on Darwin because that's all I can test on right now. Please let me know if there's a better way to do this or if it should fire on different platforms.

sammccall resigned from this revision.Jun 7 2019, 12:37 AM
sammccall edited reviewers, added: ilya-biryukov, hokein; removed: sammccall.

Sorry, I don't have any context on this (I just "blindly" fixed an asan error at one point).

Adding original authors/reviewers of the test.

ilya-biryukov accepted this revision.Jun 7 2019, 12:53 AM

LGTM, I see no way around it, we can't copy all of the shared libs.
Maybe there's an alternative way to test this without copying the binary, but I don't have one in mind.

This revision is now accepted and ready to land.Jun 7 2019, 12:53 AM
This revision was automatically updated to reflect the committed changes.
phosek added a subscriber: phosek.Jun 13 2019, 4:55 PM

This broke all our macOS builders:

llvm-lit: /b/s/w/ir/k/llvm-project/llvm/utils/lit/lit/TestingConfig.py:102: fatal: unable to parse config file '/b/s/w/ir/k/recipe_cleanup/clangh7IvHV/llvm_build_dir/tools/lld/test/lit.site.cfg.py', traceback: Traceback (most recent call last):
  File "/b/s/w/ir/k/llvm-project/llvm/utils/lit/lit/TestingConfig.py", line 89, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/b/s/w/ir/k/recipe_cleanup/clangh7IvHV/llvm_build_dir/tools/lld/test/lit.site.cfg.py", line 31, in <module>
    lit.llvm.initialize(lit_config, config)
  File "/b/s/w/ir/k/llvm-project/llvm/utils/lit/lit/llvm/__init__.py", line 9, in initialize
    llvm_config = config.LLVMConfig(lit_config, test_config)
  File "/b/s/w/ir/k/llvm-project/llvm/utils/lit/lit/llvm/config.py", line 51, in __init__
    if config.enable_shared:
AttributeError: TestingConfig instance has no attribute 'enable_shared'

The problem is that enable_shared isn't defined in lld's lit.site.cfg.py. Is it possible to either fix this or revert this change?

I reverted this in r363379 to unbreak check-lld on mac. I think the

if config.enable_shared:
               features.add("enable_shared")

bit belongs in clang/test/lit.cfg.py, not in llvm/utils/lit/lit/llvm/config.py.

hintonda added a comment.EditedJun 14 2019, 9:39 AM

I reverted this in r363379 to unbreak check-lld on mac. I think the

if config.enable_shared:
               features.add("enable_shared")

bit belongs in clang/test/lit.cfg.py, not in llvm/utils/lit/lit/llvm/config.py.

Sorry the breakage, and thanks for the suggestion.

Fixed in r363502.