cwd when running compiler/linker

2 views
Skip to first unread message

Evan Martin

unread,
Sep 6, 2011, 1:37:13 PM9/6/11
to gyp-developer
Generally it seems gyp semantics are that actions/rules are run in the
same directory as the .gyp file.

This file assumes that the linker is run with cwd as the source root:
http://codesearch.google.com/codesearch#OAMlx_jo-ck/src/chrome/nacl.gypi&exact_package=chromium&q=nacl_helper_bootstrap_linux.x&type=cs&l=280

This breaks the ninja build, but it's not clear to me what behavior is right.
<(DEPTH) is maybe right, but we can only use relative paths when we
have fixed the cwd.

Bradley Nelson

unread,
Sep 6, 2011, 2:00:20 PM9/6/11
to Evan Martin, gyp-developer, Brad Chen
Ah, so I'd kind of wondered about this when BradC brought that change to me.

I think having everything run relative to the gyp file (including compile/link) seems logical, but I actually haven't checked what the IDEs do, I'm not sure we'd be able to change it, particularly for something like incredibuild.

I think originally I'd suggested <(DEPTH), but there as some reason an absolute path wasn't ok here. BradC?

Since we can control things for make/ninja, I'd say gyp relative is least surprising.
Shall I file a bug on the make generator?

-BradN

Evan Martin

unread,
Sep 6, 2011, 4:47:54 PM9/6/11
to Bradley Nelson, gyp-developer, Brad Chen
On Tue, Sep 6, 2011 at 11:00 AM, Bradley Nelson <bradn...@google.com> wrote:
> Ah, so I'd kind of wondered about this when BradC brought that change to me.
> I think having everything run relative to the gyp file (including
> compile/link) seems logical, but I actually haven't checked what the IDEs
> do, I'm not sure we'd be able to change it, particularly for something like
> incredibuild.
> I think originally I'd suggested <(DEPTH), but there as some reason an
> absolute path wasn't ok here. BradC?

<(DEPTH) is relative, I think. At least it was on my quick test.

> Since we can control things for make/ninja, I'd say gyp relative is least
> surprising.
> Shall I file a bug on the make generator?

It's least surprising, but also most complicated to implement. I
wonder if we can come up with something better.

Reply all
Reply to author
Forward
0 new messages