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

Repository
rL LLVM

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
31 ↗(On Diff #183605)

Fancy :-)

55 ↗(On Diff #183605)

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

57 ↗(On Diff #183605)

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
31 ↗(On Diff #183605)

Done :-P

55 ↗(On Diff #183605)

No.

57 ↗(On Diff #183605)

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.