[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-15 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

In D61713#1502606 , @labath wrote:

> In D61713#1502580 , @mgorny wrote:
>
> > Is this test supposed to work portably? It fails on NetBSD buildbot: 
> > http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20101/steps/run%20unit%20tests/logs/FAIL%3A%20LLDB%3A%3Acompiler-full-path.test
>
>
> I think we can just add --mode=link to the test to avoid it trying to mess 
> with the linker (since that is not important here anyway).


Did you mean `--mode=compile`? I can confirm it fixes the test. Should I commit 
it?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D61713#1502580 , @mgorny wrote:

> Is this test supposed to work portably? It fails on NetBSD buildbot: 
> http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20101/steps/run%20unit%20tests/logs/FAIL%3A%20LLDB%3A%3Acompiler-full-path.test


I think we can just add --mode=link to the test to avoid it trying to mess with 
the linker (since that is not important here anyway).


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D61713#1502617 , @mgorny wrote:

> In D61713#1502606 , @labath wrote:
>
> > In D61713#1502580 , @mgorny wrote:
> >
> > > Is this test supposed to work portably? It fails on NetBSD buildbot: 
> > > http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20101/steps/run%20unit%20tests/logs/FAIL%3A%20LLDB%3A%3Acompiler-full-path.test
> >
> >
> > I think we can just add --mode=link to the test to avoid it trying to mess 
> > with the linker (since that is not important here anyway).
>
>
> Did you mean `--mode=compile`? I can confirm it fixes the test. Should I 
> commit it?


Yes, that's what I meant. :) Feel free to commit.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-09 Thread Jorge Gorbe Moya via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360355: [lldb] build.py: fix behavior when passing 
--compiler=/path/to/compiler (authored by jgorbe, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61713?vs=198858=198859#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713

Files:
  lldb/trunk/lit/BuildScript/compiler-full-path.test
  lldb/trunk/lit/helper/build.py


Index: lldb/trunk/lit/BuildScript/compiler-full-path.test
===
--- lldb/trunk/lit/BuildScript/compiler-full-path.test
+++ lldb/trunk/lit/BuildScript/compiler-full-path.test
@@ -0,0 +1,10 @@
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+
+CHECK-CLANG: Command Line: /path/to/my/clang
+CHECK-SAME: -o
+
+CHECK-MSVC: Command Line: /path/to/my/x64/cl.exe
+CHECK-SAME: /Fo
Index: lldb/trunk/lit/helper/build.py
===
--- lldb/trunk/lit/helper/build.py
+++ lldb/trunk/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):


Index: lldb/trunk/lit/BuildScript/compiler-full-path.test
===
--- lldb/trunk/lit/BuildScript/compiler-full-path.test
+++ lldb/trunk/lit/BuildScript/compiler-full-path.test
@@ -0,0 +1,10 @@
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+
+CHECK-CLANG: Command Line: /path/to/my/clang
+CHECK-SAME: -o
+
+CHECK-MSVC: Command Line: /path/to/my/x64/cl.exe
+CHECK-SAME: /Fo
Index: lldb/trunk/lit/helper/build.py
===
--- lldb/trunk/lit/helper/build.py
+++ lldb/trunk/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-09 Thread Jorge Gorbe Moya via Phabricator via lldb-commits
jgorbe updated this revision to Diff 198858.
jgorbe added a comment.

Removed trailing blank lines from test case, will commit now. Thanks for the 
review!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713

Files:
  lldb/lit/BuildScript/compiler-full-path.test
  lldb/lit/helper/build.py


Index: lldb/lit/helper/build.py
===
--- lldb/lit/helper/build.py
+++ lldb/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):
Index: lldb/lit/BuildScript/compiler-full-path.test
===
--- /dev/null
+++ lldb/lit/BuildScript/compiler-full-path.test
@@ -0,0 +1,10 @@
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+
+CHECK-CLANG: Command Line: /path/to/my/clang
+CHECK-SAME: -o
+
+CHECK-MSVC: Command Line: /path/to/my/x64/cl.exe
+CHECK-SAME: /Fo


Index: lldb/lit/helper/build.py
===
--- lldb/lit/helper/build.py
+++ lldb/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):
Index: lldb/lit/BuildScript/compiler-full-path.test
===
--- /dev/null
+++ lldb/lit/BuildScript/compiler-full-path.test
@@ -0,0 +1,10 @@
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+
+CHECK-CLANG: Command Line: /path/to/my/clang
+CHECK-SAME: -o
+
+CHECK-MSVC: Command Line: /path/to/my/x64/cl.exe
+CHECK-SAME: /Fo
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-09 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

Awesome, thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-09 Thread Jorge Gorbe Moya via Phabricator via lldb-commits
jgorbe updated this revision to Diff 198853.
jgorbe added a comment.

Added a new test that checks that, when a full path to a compiler is specified:

- That compiler is used in build commands
- The flag style used in build commands matches the toolchain type autodetected 
from the compiler executable name


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713

Files:
  lldb/lit/BuildScript/compiler-full-path.test
  lldb/lit/helper/build.py


Index: lldb/lit/helper/build.py
===
--- lldb/lit/helper/build.py
+++ lldb/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):
Index: lldb/lit/BuildScript/compiler-full-path.test
===
--- /dev/null
+++ lldb/lit/BuildScript/compiler-full-path.test
@@ -0,0 +1,12 @@
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+
+CHECK-CLANG: Command Line: /path/to/my/clang
+CHECK-SAME: -o
+
+CHECK-MSVC: Command Line: /path/to/my/x64/cl.exe
+CHECK-SAME: /Fo
+
+


Index: lldb/lit/helper/build.py
===
--- lldb/lit/helper/build.py
+++ lldb/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):
Index: lldb/lit/BuildScript/compiler-full-path.test
===
--- /dev/null
+++ lldb/lit/BuildScript/compiler-full-path.test
@@ -0,0 +1,12 @@
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
+RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+
+CHECK-CLANG: Command Line: /path/to/my/clang
+CHECK-SAME: -o
+
+CHECK-MSVC: Command Line: /path/to/my/x64/cl.exe
+CHECK-SAME: /Fo
+
+
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-09 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

BTW, there's some existing tests for build.py in `lit/BuildScript`. Could you 
check if it's feasible to make an analogous test for the fix you're making here?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-09 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Sounds reasonable.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61713/new/

https://reviews.llvm.org/D61713



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-08 Thread Jorge Gorbe Moya via Phabricator via lldb-commits
jgorbe created this revision.
jgorbe added reviewers: labath, zturner.
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

All the other paths in the find_toolchain function return a tuple 
(detected_toolchain_type, compiler_path), but when the parameter to 
`--compiler` is not one of the predefined names it only returns the detected 
toolchain type, which causes an error when trying to unpack the result.

This patch changes it to return also the compiler path passed as a parameter.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61713

Files:
  lldb/lit/helper/build.py


Index: lldb/lit/helper/build.py
===
--- lldb/lit/helper/build.py
+++ lldb/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):


Index: lldb/lit/helper/build.py
===
--- lldb/lit/helper/build.py
+++ lldb/lit/helper/build.py
@@ -207,16 +207,16 @@
 file = os.path.basename(compiler)
 name, ext = os.path.splitext(file)
 if file.lower() == 'cl.exe':
-return 'msvc'
+return ('msvc', compiler)
 if name == 'clang-cl':
-return 'clang-cl'
+return ('clang-cl', compiler)
 if name.startswith('clang'):
-return 'clang'
+return ('clang', compiler)
 if name.startswith('gcc') or name.startswith('g++'):
-return 'gcc'
+return ('gcc', compiler)
 if name == 'cc' or name == 'c++':
-return 'generic'
-return 'unknown'
+return ('generic', compiler)
+return ('unknown', compiler)
 
 class Builder(object):
 def __init__(self, toolchain_type, args, obj_ext):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits