Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(465)

Issue 6782095: Update gyp and make to allow alternative out directories (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by DerekS
Modified:
11 years, 7 months ago
Reviewers:
epoger, EricB
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

Update gyp to allow alternative out directories If the enviroment variable SKIA_OUT is set the output of both gyp and make will be redirected to that directory. Committed: https://code.google.com/p/skia/source/detail?r=6578

Patch Set 1 #

Total comments: 19

Patch Set 2 : addressing comments #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -9 lines) Patch
M Makefile View 1 4 chunks +10 lines, -4 lines 3 comments Download
M gyp_skia View 1 4 chunks +27 lines, -5 lines 1 comment Download

Messages

Total messages: 5
DerekS
11 years, 7 months ago (2012-11-20 19:12:19 UTC) #1
EricB
https://codereview.appspot.com/6782095/diff/1/Makefile File Makefile (right): https://codereview.appspot.com/6782095/diff/1/Makefile#newcode75 Makefile:75: rm -rf out xcodebuild Why not change this line ...
11 years, 7 months ago (2012-11-20 19:41:36 UTC) #2
epoger
https://codereview.appspot.com/6782095/diff/1/Makefile File Makefile (right): https://codereview.appspot.com/6782095/diff/1/Makefile#newcode97 Makefile:97: $(MAKE) out/Makefile I guess you need to replace this, ...
11 years, 7 months ago (2012-11-20 20:42:36 UTC) #3
DerekS
still need to test that makefile change on linux as my previous testing has been ...
11 years, 7 months ago (2012-11-20 21:27:42 UTC) #4
epoger
11 years, 7 months ago (2012-11-27 17:11:03 UTC) #5
LGTM

Some minor suggestions, nothing to block submission...

https://codereview.appspot.com/6782095/diff/1/Makefile
File Makefile (right):

https://codereview.appspot.com/6782095/diff/1/Makefile#newcode75
Makefile:75: rm -rf out xcodebuild
On 2012/11/20 21:27:43, DerekS wrote:
> On 2012/11/20 19:41:36, EricB wrote:
> > Why not change this line to read:
> > rm -rf $(SKIA_OUT) xcodebuild
> > ?
> 
> I wanted to preserve the old behavior of always cleaning out and debug in case
> you had previously put stuff there.

It seems strange to me that we would clean out a directory other than SKIA_OUT. 
It's bad enough that we have to clean out "xcodebuild" specifically... it would
be great if that directory could be created within SKIA_OUT.

Maybe change it to this, which will yield the same results but hopefully be more
enlightening?

    rm -rf $(SKIA_OUT)
    # TODO: During a transition period, clean out the old hardcoded "out/"
    # directory.
    # Once SKIA_OUT has been in place for a while, delete this.
    rm -rf out
    # TODO: Our Xcode build writes into a local "xcodebuild/" directory.
    # Until we can fix that, make sure it gets cleaned up...
    rm -rf xcodebuild

https://codereview.appspot.com/6782095/diff/1/gyp_skia
File gyp_skia (right):

https://codereview.appspot.com/6782095/diff/1/gyp_skia#newcode66
gyp_skia:66: not 'make' in os.getenv('GYP_GENERATORS')))):
On 2012/11/20 19:41:36, EricB wrote:
> Suggest rewriting this expression to read:
> 
> if os.name != 'posix' or \
>    (sys.platform.startswith('darwin') and \
>     (not os.getenv('GYP_GENERATORS') or \
>      'make' not in os.getenv('GYP_GENERATORS'))):
> 
> I think the \'s are necessary to keep python from complaining.

Python doesn't need the backslashes, because the open-parenthesis tells it to
keep going to the next line.

https://codereview.appspot.com/6782095/diff/3002/Makefile
File Makefile (right):

https://codereview.appspot.com/6782095/diff/3002/Makefile#newcode4
Makefile:4: # Some usage examples (tested on both Linux and Mac):
Maybe add a usage example using SKIA_OUT?  (Or just change one of the examples
below to use a value other than "out".)

https://codereview.appspot.com/6782095/diff/3002/Makefile#newcode58
Makefile:58: # recursively invoked Makefile within out/ _is_ allowed to run in
parallel
out -> $SKIA_OUT

https://codereview.appspot.com/6782095/diff/3002/Makefile#newcode119
Makefile:119: rm -f out/$(BUILDTYPE) || if test -d out/$(BUILDTYPE); then echo
"run 'make clean' or otherwise delete out/$(BUILDTYPE)"; exit 1; fi
I think it would be better to use $SKIA_OUT here (so we can get rid of the last
hardcoded references to "out/"), and fail-fast if SKIA_OUT is defined as
something other than "out/" in this case.

Hopefully we can remove this limitation before too long.

https://codereview.appspot.com/6782095/diff/3002/gyp_skia
File gyp_skia (right):

https://codereview.appspot.com/6782095/diff/3002/gyp_skia#newcode58
gyp_skia:58: # SKIA_OUT can be any directory either as a child of the standard
out/
But we delete "out/" as part of "make clean", so if any of your builds are
within "out/" they will be deleted by any call to "make clean"!

I don't think that's bad enough to warrant a change in behavior, but it might be
confusing.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b