[llvm] r312254 - [lit] Make symlinks in test paths work a different way

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 12:50:30 PDT 2017


I think this broke a bunch of lnt tests:

http://lab.llvm.org:8080/green/job/LNT_Tests/700/ <http://lab.llvm.org:8080/green/job/LNT_Tests/700/>

(you may have missed it because the V4Pages.py test was already broken before this commit).

- Matthias

> On Aug 31, 2017, at 10:07 AM, Reid Kleckner via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: rnk
> Date: Thu Aug 31 10:07:35 2017
> New Revision: 312254
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=312254&view=rev
> Log:
> [lit] Make symlinks in test paths work a different way
> 
> Use os.path.normpath instead of realpath to collapse '..' and '.' path
> components. Use realpath when caching search results about a path for
> good measure.
> 
> I considered rigging up a test involving symlinks for this, but I doubt
> I can check a symlink into SVN. The test would have to conditionally
> create a symlink at runtime if the host OS supports it. This sounds too
> fragile and complicated to me to be worth it.
> 
> Modified:
>    llvm/trunk/utils/lit/lit/discovery.py
> 
> Modified: llvm/trunk/utils/lit/lit/discovery.py
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/discovery.py?rev=312254&r1=312253&r2=312254&view=diff
> ==============================================================================
> --- llvm/trunk/utils/lit/lit/discovery.py (original)
> +++ llvm/trunk/utils/lit/lit/discovery.py Thu Aug 31 10:07:35 2017
> @@ -52,13 +52,14 @@ def getTestSuite(item, litConfig, cache)
> 
>     def search(path):
>         # Check for an already instantiated test suite.
> -        res = cache.get(path)
> +        real_path = os.path.realpath(path)
> +        res = cache.get(real_path)
>         if res is None:
> -            cache[path] = res = search1(path)
> +            cache[real_path] = res = search1(path)
>         return res
> 
>     # Canonicalize the path.
> -    item = os.path.realpath(item)
> +    item = os.path.normpath(item)
> 
>     # Skip files and virtual components.
>     components = []
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170831/652fafdc/attachment.html>


More information about the llvm-commits mailing list