This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Tighten checks in hip-include-path.hip test case
ClosedPublic

Authored by bjope on May 18 2021, 1:36 PM.

Details

Summary

The checks (both positive and negative checks) in the test case
hip-include-path.hip could mistakenly end up matching the string
"clang" from the InstalledDir in case the build dir for example
was named "/home/username/build-clang/". Intention with this
patch is to tighten up the checks a bit to filter our the
part of the paths that match with InstalledDir when doing the
checks, as well as matching "/lib/clang/" rather than
just "clang/".

Problem was found when building with

-DCLANG_DEFAULT_RTLIB=compiler-rt
-DCLANG_DEFAULT_CXX_STDLIB=libc++

and having "clang/" in the path to the build dir.

Diff Detail

Event Timeline

bjope requested review of this revision.May 18 2021, 1:36 PM
bjope created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2021, 1:36 PM
yaxunl accepted this revision.May 18 2021, 1:46 PM

LGTM. Thanks.

This revision is now accepted and ready to land.May 18 2021, 1:46 PM
This revision was automatically updated to reflect the committed changes.

This change is causing failures when the build is done from a working directory that has symlinks:
https://lab.llvm.org/staging/#/builders/126/builds/529/steps/5/logs/FAIL__Clang__hip-include-path_hip

It seems we cannot introduce ROOT by line 19 since it is not used in other lines in situations where working directories have sym links.

Instead, we just change {{.*}}clang/ to {{.*}}/lib/clang/ in other lines. Hopefully this will still work.

bjope added a comment.May 31 2021, 8:28 AM

It seems we cannot introduce ROOT by line 19 since it is not used in other lines in situations where working directories have sym links.

Instead, we just change {{.*}}clang/ to {{.*}}/lib/clang/ in other lines. Hopefully this will still work.

Ok. That probably works.

A bit surprised though. I found checks using InstalledDir in other test cases such as clang/test/Friver/stdlibxx-isystem.cpp, so I figured it would be safe to use that also in this test case. So I wonder how other tests that captures InstalledDir could work for the symlink-bots.

It seems we cannot introduce ROOT by line 19 since it is not used in other lines in situations where working directories have sym links.

Instead, we just change {{.*}}clang/ to {{.*}}/lib/clang/ in other lines. Hopefully this will still work.

Ok. That probably works.

A bit surprised though. I found checks using InstalledDir in other test cases such as clang/test/Friver/stdlibxx-isystem.cpp, so I figured it would be safe to use that also in this test case. So I wonder how other tests that captures InstalledDir could work for the symlink-bots.

That test uses --ccc-install-dir %t/bin to specify installed directory. %t/bin is expanded to real path. However, it seems not working on windows.

bjope added a comment.May 31 2021, 1:47 PM

I relaxed the checks a bit again here: https://reviews.llvm.org/rGf0e10cc91bc4
But it looks like the workers here (https://lab.llvm.org/staging/#/workers/109) are paused so hard to tell if it helped.

But it looks like the workers here (https://lab.llvm.org/staging/#/workers/109) are paused so hard to tell if it helped.

@gkistanova, none of the staging builders appear to be active: https://lab.llvm.org/staging/#/builders

I relaxed the checks a bit again here: https://reviews.llvm.org/rGf0e10cc91bc4
But it looks like the workers here (https://lab.llvm.org/staging/#/workers/109) are paused so hard to tell if it helped.

It helped; thanks. The bot has come back green: https://lab.llvm.org/staging/#/builders/126/builds/557