Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Issue 2095173002: Teach build.py to cross-compile go-based packages. (Closed)

Created:
4 years, 6 months ago by Vadim Sh.
Modified:
4 years, 5 months ago
Reviewers:
nodir
CC:
chromium-reviews, infra-reviews+infra_chromium.org
Base URL:
https://chromium.googlesource.com/infra/infra.git@master
Target Ref:
refs/heads/master
Project:
infra
Visibility:
Public.

Description

Teach build.py to cross-compile go-based packages. build.py now understands GOOS and GOARCH env vars and builds the packages for corresponding target platform. Packages that support cross-compilation must be declared via 'supports_cross_compilation' attribute in package definition yaml. R=nodir@chromium.org BUG= Committed: https://chromium.googlesource.com/infra/infra/+/43ed7bea9bd3195083779ab566b5b64ab3b6b058

Patch Set 1 : Teach build.py to cross-compile go-based packages. #

Total comments: 9

Patch Set 2 : attach tags with build machine info #

Patch Set 3 : name them build_host_*, shorter #

Patch Set 4 : support arm as a host too; detect 32-bit userland on Linux amd64 #

Patch Set 5 : verify we running correct go toolset #

Patch Set 6 : consistently use word 'toolset' instead of 'toolchain' #

Patch Set 7 : don't touch GOOS and GOARCH in bootstrap_go_toolset, it should not matter #

Patch Set 8 : make build.py correctly bootstrap go toolset if it is missing #

Patch Set 9 : nits #

Patch Set 10 : clarify that cross-compiled binaries are different #

Total comments: 33

Patch Set 11 : use 'go clean', less rebuilding #

Total comments: 4

Patch Set 12 : prebuild stdlib #

Unified diffs Side-by-side diffs Delta from patch set Stats (+649 lines, -131 lines) Patch
M build/README.md View 1 2 3 4 5 6 7 8 9 5 chunks +42 lines, -7 lines 0 comments Download
M build/build.py View 1 2 3 4 5 6 7 8 9 10 11 18 chunks +510 lines, -97 lines 0 comments Download
M build/out/.gitignore View 1 chunk +1 line, -0 lines 0 comments Download
M build/packages/authutil.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/buildbucket.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/cipd_client.yaml View 1 chunk +3 lines, -0 lines 0 comments Download
M build/packages/cloudtail.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/dispatcher.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/infra_python.yaml View 1 chunk +3 lines, -0 lines 0 comments Download
M build/packages/kitchen.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/logdog_annotee.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/logdog_butler.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/logdog_cat.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/packages/luci_machine_tokend.yaml View 1 chunk +2 lines, -0 lines 0 comments Download
M build/test_packages.py View 1 7 chunks +44 lines, -14 lines 0 comments Download
M go/bootstrap.py View 1 2 3 4 5 6 7 2 chunks +28 lines, -13 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 13 (5 generated)
Vadim Sh.
PTAL. Tested manually with different combinations of GOOS and GOARCH. Example of execution: https://paste.googleplex.com/6177740315164672 https://codereview.chromium.org/2095173002/diff/40001/build/build.py ...
4 years, 6 months ago (2016-06-25 03:51:04 UTC) #3
Vadim Sh.
Added some more stuff: * Support ARM as a host too (being careful with what ...
4 years, 6 months ago (2016-06-25 06:19:47 UTC) #4
nodir
https://codereview.chromium.org/2095173002/diff/210001/build/README.md File build/README.md (right): https://codereview.chromium.org/2095173002/diff/210001/build/README.md#newcode104 build/README.md:104: `GOBIN`. cool, it won't compile everything an improvement https://codereview.chromium.org/2095173002/diff/210001/build/build.py ...
4 years, 6 months ago (2016-06-26 05:00:48 UTC) #5
Vadim Sh.
https://codereview.chromium.org/2095173002/diff/210001/build/build.py File build/build.py (right): https://codereview.chromium.org/2095173002/diff/210001/build/build.py#newcode64 build/build.py:64: return self.pkg_def.get('uses_python_env') On 2016/06/26 05:00:47, nodir wrote: > consider ...
4 years, 5 months ago (2016-06-27 21:37:29 UTC) #6
nodir
lgtm https://codereview.chromium.org/2095173002/diff/230001/build/build.py File build/build.py (right): https://codereview.chromium.org/2095173002/diff/230001/build/build.py#newcode277 build/build.py:277: # Above command is either silent (with '-x') ...
4 years, 5 months ago (2016-06-27 22:41:56 UTC) #7
Vadim Sh.
Also running "go install std" now before building packages in cross-compiling mode (otherwise stdlib is ...
4 years, 5 months ago (2016-06-27 22:54:00 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2095173002/250001
4 years, 5 months ago (2016-06-27 22:54:56 UTC) #11
commit-bot: I haz the power
4 years, 5 months ago (2016-06-27 23:16:22 UTC) #13
Message was sent while issue was closed.
Committed patchset #12 (id:250001) as
https://chromium.googlesource.com/infra/infra/+/43ed7bea9bd3195083779ab566b5b...

Powered by Google App Engine
This is Rietveld 408576698