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

Issue 1213123002: Fix XCode emulation when SDK is not installed.

Created:
5 years, 5 months ago by bnoordhuis
Modified:
4 years, 11 months ago
Reviewers:
Nico
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp@master
Target Ref:
refs/heads/master
Project:
gyp
Visibility:
Public.

Description

Fix XCode emulation when SDK is not installed. Fixes a regression from https://codereview.chromium.org/82763006 BUG=gyp:477

Patch Set 1 #

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

Messages

Total messages: 10 (3 generated)
bnoordhuis
5 years, 5 months ago (2015-06-29 10:10:08 UTC) #2
Nico
+sdefresne who wrote this https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py File pylib/gyp/xcode_emulation.py (right): https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py#newcode1484 pylib/gyp/xcode_emulation.py:1484: env['SDKROOT'] = sdk_root Is it ...
5 years, 5 months ago (2015-06-29 16:25:19 UTC) #4
sdefresne
https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py File pylib/gyp/xcode_emulation.py (right): https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py#newcode1484 pylib/gyp/xcode_emulation.py:1484: env['SDKROOT'] = sdk_root On 2015/06/29 at 16:25:19, Nico wrote: ...
5 years, 5 months ago (2015-06-29 16:48:59 UTC) #5
bnoordhuis
On 2015/06/29 16:48:59, sdefresne wrote: > https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py > File pylib/gyp/xcode_emulation.py (right): > > https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py#newcode1484 > ...
5 years, 5 months ago (2015-06-30 11:12:36 UTC) #6
Nico
On 2015/06/30 11:12:36, bnoordhuis wrote: > On 2015/06/29 16:48:59, sdefresne wrote: > > https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py > ...
5 years, 5 months ago (2015-06-30 18:33:30 UTC) #7
sdefresne
On 2015/06/30 at 18:33:30, thakis wrote: > On 2015/06/30 11:12:36, bnoordhuis wrote: > > On ...
5 years, 5 months ago (2015-07-01 10:49:58 UTC) #8
Nico
5 years, 5 months ago (2015-07-01 22:42:00 UTC) #9
On 2015/07/01 10:49:58, sdefresne wrote:
> On 2015/06/30 at 18:33:30, thakis wrote:
> > On 2015/06/30 11:12:36, bnoordhuis wrote:
> > > On 2015/06/29 16:48:59, sdefresne wrote:
> > > >
> https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.py
> > > > File pylib/gyp/xcode_emulation.py (right):
> > > > 
> > > >
> > >
>
https://codereview.chromium.org/1213123002/diff/1/pylib/gyp/xcode_emulation.p...
> > > > pylib/gyp/xcode_emulation.py:1484: env['SDKROOT'] = sdk_root
> > > > On 2015/06/29 at 16:25:19, Nico wrote:
> > > > > Is it useful to set SDKROOT to an empty string? Should this just be
> > > > > 
> > > > >   if sdk_root is not None:
> > > > >     env['SDKROOT'] = sdk_root
> > > > 
> > > > IIUC this CL is to get Xcode emulation working when SDK is not
installed.
> I'm
> > > > not sure if it is possible to install Xcode without installing a SDK,
and
> > > since
> > > > this variable is only used by Xcode and its command line tools, I don't
> think
> > > > exporting or not the environment variable has any impact.
> > > > 
> > > > I'd tend to favor the code that does not export the variable then.
> > > 
> > > Correct me if I'm wrong, but wouldn't conditionally setting SDKROOT break
a
> GYP
> > > file that links to '$(SDKROOT)/System/Library/Frameworks/Foo.framework' in
> its
> > > 'libraries' section?
> > 
> > Relying on $(SDKROOT) expanding to '' so that that becomes an absolute path
is
> pretty subtle :-/ If you need this I guess it's fine, but add a comment like
`#
> For $(SDKROOT)/System/Library/Frameworks/Foo.framework` above the line that
sets
> that path to '' please.
> 
> How can not setting the variable break in such a situation. If a variable is
> unset, it gets expanded to '' by the shell. 

This is $(FOO), not ${FOO}. That's expanded by xcode / xcode_emulation. If the
shell sees it $(asdf), it means the same as `asdf`: "run asdf, get the result
from that":

$ echo $(asdf)
-bash: asdf: command not found


> The only case were it would be
> different would be if you already had a SDKROOT variable in the current
> environment before invoking the build tool.

Powered by Google App Engine
This is Rietveld 408576698