[llvm] r355645 - [GN] Locate prebuilt binaries correctly.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 14:30:36 PST 2019
That would work too, but I mildly prefer 'gn --version' because we don't
really gain anything by using the variable.
Peter
On Thu, Mar 7, 2019 at 2:27 PM Mitch Phillips <mitchphillips at outlook.com>
wrote:
> Since the 'gn' is coming from the variable on the line above, are you
> thinking `subprocess.call(gn + ' --version', ...`?
>
> On Thu, 7 Mar 2019 at 14:26, Peter Collingbourne <peter at pcc.me.uk> wrote:
>
>> On Thu, Mar 7, 2019 at 2:19 PM Mitch Phillips via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>>> Author: hctim
>>> Date: Thu Mar 7 14:20:36 2019
>>> New Revision: 355645
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=355645&view=rev
>>> Log:
>>> [GN] Locate prebuilt binaries correctly.
>>>
>>> Use the system shell to see if we can find a 'gn' binary on $PATH. This
>>> solves the error wherein subprocess.call fails ungracefully if the binary
>>> doesn't exist.
>>>
>>> Modified:
>>> llvm/trunk/utils/gn/gn.py
>>>
>>> Modified: llvm/trunk/utils/gn/gn.py
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/gn.py?rev=355645&r1=355644&r2=355645&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/utils/gn/gn.py (original)
>>> +++ llvm/trunk/utils/gn/gn.py Thu Mar 7 14:20:36 2019
>>> @@ -38,7 +38,8 @@ def main():
>>> # Find real gn executable.
>>> gn = 'gn'
>>> if subprocess.call([gn, '--version'], stdout=open(os.devnull, 'w'),
>>>
>>
>> I think this needs to be 'gn --version' to avoid the platform dependent
>> behaviour discussed in D59003.
>>
>> Peter
>>
>> - stderr=subprocess.STDOUT) != 0:
>>> + stderr=subprocess.STDOUT,
>>> + shell=True) != 0:
>>> # Not on path. See if get.py downloaded a prebuilt binary and
>>> run that
>>> # if it's there, or suggest to run get.py if it isn't.
>>> platform = get_platform()
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>
>>
>>
>> --
>> --
>> Peter
>>
>
--
--
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190307/44ab1722/attachment.html>
More information about the llvm-commits
mailing list