This is an archive of the discontinued LLVM Phabricator instance.

Revert "Use find_library for ncurses"
ClosedPublic

Authored by haampie on Aug 25 2020, 3:58 AM.

Details

Summary

The introduction of find_library for ncurses caused more issues than it solved problems. The current open issue is it makes the static build of LLVM fail. It's better to revert for now, and get back to it later.

Revert "[CMake] Fix an issue where get_system_libname creates an empty regex capture on windows"

This reverts commit 1ed1e16ab83f55d85c90ae43a05cbe08a00c20e0.

Revert "Fix msan build"

This reverts commit 34fe9613dda3c7d8665b609136a8c12deb122382.

Revert "[CMake] Always mark terminfo as unavailable on Windows"

This reverts commit 76bf26236f6fd453343666c3cd91de8f74ffd89d.

Revert "[CMake] Fix OCaml build failure because of absolute path in system libs"

This reverts commit 8e4acb82f71ad4effec8895b8fc957189ce95933.

Revert "[CMake] Don't look for terminfo libs when LLVM_ENABLE_TERMINFO=OFF"

This reverts commit 495f91fd33d492941c39424a32cf24bcfe192f35.

Revert "Use find_library for ncurses"

This reverts commit a52173a3e56553d7b795bcf3cdadcf6433117107.

Diff Detail

Event Timeline

haampie created this revision.Aug 25 2020, 3:58 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptAug 25 2020, 3:58 AM
Herald added subscribers: llvm-commits, lldb-commits, Restricted Project and 2 others. · View Herald Transcript
haampie requested review of this revision.Aug 25 2020, 3:58 AM
gkistanova accepted this revision.Aug 25 2020, 12:58 PM

I have checked this patch with http://lab.llvm.org:8011/builders/lld-perf-testsuite bot. It makes it green.

Thanks for reverting, Harmen!

This revision is now accepted and ready to land.Aug 25 2020, 12:58 PM

FYI this doesn't fully fix MinGW issue:

$ cat tools/llvm-config/BuildVariables.inc | grep LLVM_SYSTEM_LIBS
#define LLVM_SYSTEM_LIBS "-lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lz.dll"

It's because libraries are found by their import library which is libz.dll.a in this case.
libz.dll.a matches if in line 213 and gets stripped to z.dll which doesn't match shared library regex lib.*\.dll.

The easiest fix would be adding:

if(CMAKE_IMPORT_LIBRARY_PREFIX AND CMAKE_IMPORT_LIBRARY_SUFFIX AND
    zlib_library MATCHES "^${CMAKE_IMPORT_LIBRARY_PREFIX}.*${CMAKE_IMPORT_LIBRARY_SUFFIX }$")
  STRING(REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" zlib_library ${zlib_library})
  STRING(REGEX REPLACE "${CMAKE_IMPORT_LIBRARY_SUFFIX }$" "" zlib_library ${zlib_library})
endif()

Should it fixed in separate diff given the fact this is a revert?

Hi Mateusz,
Yes, this looks like a separate patch on top of this revert.

By the way, this hasn't been merged yet. Are we waiting for anything? Harmen, do you need a help committing this patch?

I have suggested an alternative in https://reviews.llvm.org/D85820#2237357 to try and fix this forward and I was waiting for @haampie's response before landing this. I can implement that today if you're OK fixing this forward? I think it'd be easier to do that than reverting and then relanding all these changes again. @gkistanova how did you check the patch with http://lab.llvm.org:8011/builders/lld-perf-testsuite bot? Is there a way to do a presubmit check on that bot?

Hi Petr,

I don't have a strong opinion on the exact way of fixing the problem. But we should do this as soon as possible, as keeping the bots red for that long is not Ok.

Please send me your patch and I will check it on lld-perf-testsuite bot. If you do not have the patch ready yet, I'd say we shall commit this revert to buy more time.

@phosek it would be great to get that patch in, but the truth is it is difficult testing across multiple platforms for me; I can only test on Linux and macOS, not Windows (GNU). Since that patch would touch predefined, platform-dependent cmake variables, I would want to test it properly before submitting a patch, which might take a bit more time. So for me it would be best to temporarily accept this reverting patch, and submit a properly tested patch afterwards.

This revision was landed with ongoing or failed builds.Aug 27 2020, 5:58 PM
This revision was automatically updated to reflect the committed changes.

Fair enough. Reverted.
https://github.com/llvm/llvm-project/commit/cdcb9ab10e53ff08293915af3cd897c42112bcc5

Thanks, everyone!

Petr, please feel free to send me a patch you want me to check for you. Make sure I could apply it on top of the trunk.