[PATCH] D57256: gn build: Add get.py script to download prebuilt gn, make gn.py run downloaded gn if gn is not on PATH
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 28 11:39:41 PST 2019
thakis marked an inline comment as done.
thakis added inline comments.
================
Comment at: llvm/utils/gn/get.py:31
+ mode = os.stat(path).st_mode
+ mode |= (mode & 0o444) >> 2 # Copy R bits to X.
+ os.chmod(path, mode) # No-op on Windows.
----------------
hans wrote:
> Fancy :-)
Done :-P
================
Comment at: llvm/utils/gn/get.py:55
+ url = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/%s-amd64/+/latest'
+ gn = 'gn' + ('.exe' if sys.platform == 'win32' else '')
+ download_and_unpack(url % platform, dirname, gn)
----------------
hans wrote:
> the url doesn't end in .zip or something?
No.
================
Comment at: llvm/utils/gn/get.py:57
+ download_and_unpack(url % platform, dirname, gn)
+ set_executable_bit(os.path.join(dirname, gn))
+
----------------
hans wrote:
> if it's a zip file, i'm surprised this is necessary
That's actually a good point. Huh, I wonder why I have this.
Oh, I think maybe I used to not have the unzip code, and this tried to run the zip file directly, and then that failed so then I added the chmod, only to realize that this is a zip file, and then I didn't remove the chmod again.
Things seem to be fine without this, so I removed it again. Thanks for catching this!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57256/new/
https://reviews.llvm.org/D57256
More information about the llvm-commits
mailing list