This is an archive of the discontinued LLVM Phabricator instance.

gn build: Add get.py script to download prebuilt gn, make gn.py run downloaded gn if gn is not on PATH
ClosedPublic

Authored by thakis on Jan 25 2019, 12:49 PM.

Diff Detail

Event Timeline

thakis created this revision.Jan 25 2019, 12:49 PM
thakis updated this revision to Diff 183605.Jan 25 2019, 1:01 PM

also recommend get.py if depot_tools broken gn forwarder is on PATH

hans accepted this revision.Jan 28 2019, 11:32 AM
hans added a subscriber: hans.
hans added inline comments.
llvm/utils/gn/get.py
32

Fancy :-)

56

the url doesn't end in .zip or something?

58

if it's a zip file, i'm surprised this is necessary

This revision is now accepted and ready to land.Jan 28 2019, 11:32 AM
thakis updated this revision to Diff 183927.Jan 28 2019, 11:38 AM
thakis marked 2 inline comments as done.

comments

thakis marked an inline comment as done.Jan 28 2019, 11:39 AM
thakis added inline comments.
llvm/utils/gn/get.py
32

Done :-P

56

No.

58

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!

thakis updated this revision to Diff 183930.Jan 28 2019, 11:46 AM

restore chmod, check arch

Hm, turns out I do need the chmod() after all. Looks like zipfile strips x bits: https://stackoverflow.com/questions/39296101/python-zipfile-removes-execute-permissions-from-binaries

I also added a check that the host system is arm64.

thakis updated this revision to Diff 183933.Jan 28 2019, 11:49 AM

also mention x86 in readme

This revision was automatically updated to reflect the committed changes.