[Lldb-commits] [PATCH] D21032: Eliminate differences in lldbinline-generated Makefiles and ensure they're regenerated every time

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 7 15:07:05 PDT 2016


For the diffing issue seems like we should be able to generate makefiles
with stable separators. I haven't seen the generation code, but it seems
like we could write a function lldbsuite.support.fs.unixpath() that works
like normpath but always uses /, never \. Would that fix it?

When you say it doesn't support in place renames, the only issue I'm aware
of is that you can't use os.rename if the destination already exists. As
such, you also can't implement atomic rename. As long as that isn't
required, you should be able to unlink first, then rename. I thought we had
a function in lldbsuite.support.fs that does this, but I can't remember
On Tue, Jun 7, 2016 at 2:48 PM Pavel Labath <labath at google.com> wrote:

> labath added subscribers: zturner, labath.
> labath added a comment.
>
> Hi, I have reverted this commit, as it makes a number of assumptions,
> which are not true on windows. Please see comments for details.
>
> If you need help testing out a revised version on windows, let me know. I
> think Zachary will be able to help with that as well (:P).
>
>
> ================
> Comment at: packages/Python/lldbsuite/test/lldbinline.py:135
> @@ +134,3 @@
> +        if os.path.exists("Makefile"):
> +            if not filecmp.cmp("Makefile", "Makefile.tmp"):
> +                sys.exit("Existing Makefile doesn't match generated
> Makefile!")
> ----------------
> This files will not end up being identical, due to different path
> separators and newlines when this is being run on windows.
>
> I like the idea of diffing, but it needs to be done in a way that it will
> work on windows.
>
> ================
> Comment at: packages/Python/lldbsuite/test/lldbinline.py:136
> @@ +135,3 @@
> +            if not filecmp.cmp("Makefile", "Makefile.tmp"):
> +                sys.exit("Existing Makefile doesn't match generated
> Makefile!")
> +
> ----------------
> This will not cause the error to be reported in the test runner. See <
> http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/6268/steps/test1/logs/stdio>
> where, this code is triggered, but the test is still not marked as failed
> in the summary at the end. I think throwing an exception here would do the
> expected thing.
>
> ================
> Comment at: packages/Python/lldbsuite/test/lldbinline.py:138
> @@ +137,3 @@
> +
> +        os.rename("Makefile.tmp", "Makefile")
> +
> ----------------
> Windows does not support in-place renames, so this will just fail.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D21032
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160607/8d0c217d/attachment.html>


More information about the lldb-commits mailing list