Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(675)

Issue 722073004: ninja/win: Let link-wrapper convert /s to \s in the linker command. (Closed)

Created:
6 years ago by Nico
Modified:
6 years ago
Reviewers:
scottmg
CC:
gyp-developer_googlegroups.com
Visibility:
Public.

Description

ninja/win: Let link-wrapper convert /s to \s in the linker command. ExecLinkWrapper() runs a subprocess with shell=True, so that "link.exe" is looked up using PATH from the environment loaded from environment.x86 in the build directory. shell=True implies that forward slashes in the path to the linker (say, if a custom linker, such as lld-link.exe is used) don't work. If the linker command is '..\../lld-link.exe', the command with fail with "'..\..' is not recognized as an internal or external command". So manually replace forward slashes with backslashes in the link command before attempting to run it. BUG=chromium:436277 r2008

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M pylib/gyp/win_tool.py View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (1 generated)
Nico
6 years ago (2014-11-25 01:12:10 UTC) #2
scottmg
lgtm https://codereview.chromium.org/722073004/diff/1/pylib/gyp/win_tool.py File pylib/gyp/win_tool.py (right): https://codereview.chromium.org/722073004/diff/1/pylib/gyp/win_tool.py#newcode119 pylib/gyp/win_tool.py:119: link = subprocess.Popen((args[0].replace('/', '\\'),) + args[1:], nit; i'd ...
6 years ago (2014-11-25 01:16:07 UTC) #3
Nico
https://codereview.chromium.org/722073004/diff/1/pylib/gyp/win_tool.py File pylib/gyp/win_tool.py (right): https://codereview.chromium.org/722073004/diff/1/pylib/gyp/win_tool.py#newcode119 pylib/gyp/win_tool.py:119: link = subprocess.Popen((args[0].replace('/', '\\'),) + args[1:], On 2014/11/25 01:16:07, ...
6 years ago (2014-11-25 01:19:01 UTC) #4
scottmg
6 years ago (2014-11-25 01:23:44 UTC) #5
On 2014/11/25 01:19:01, Nico wrote:
> https://codereview.chromium.org/722073004/diff/1/pylib/gyp/win_tool.py
> File pylib/gyp/win_tool.py (right):
> 
>
https://codereview.chromium.org/722073004/diff/1/pylib/gyp/win_tool.py#newcod...
> pylib/gyp/win_tool.py:119: link = subprocess.Popen((args[0].replace('/',
'\\'),)
> + args[1:],
> On 2014/11/25 01:16:07, scottmg wrote:
> > nit; i'd probably make it a list to avoid the trailing , since it's going to
> > have to turn into a list anyway, but don't change if you like this better
> 
> You mean
> 
>   [args[0].replace...0] + list(args[1:])
> 
> ? (without the list conversion on the rhs, python will complain about
> concatenating lists and tuples)
> 
> Done.

Oh, sorry! I was thinking *args was a list for some reason. :/ ps#1 is probably
better then, but either lgtm.

Powered by Google App Engine
This is Rietveld 408576698