New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 813790 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Task



Sign in to add a comment

Update tast to use Go's new package cache after switching to 1.10

Project Member Reported by derat@chromium.org, Feb 20 2018

Issue description

Right now, the "tast run" and "tast build" commands use "go build -i -pkgdir /tmp/tast/... -o /path/to/bin" to cache packages that are compiled when building test bundles. This makes builds slower than they need to be (~1 sec on my workstation even when nothing has changed), since "go build" always rebuilds the executable file.

Once the Chrome OS toolchain switches to Go 1.10, I think that this can be simplified. Packages are automatically cached to a location controllable by $GOCACHE. See https://groups.google.com/forum/#!msg/golang-dev/qfa3mHN4ZPA/X2UzjNV1BAAJ and https://tip.golang.org/doc/go1.10#build for more details.

I'm not sure whether "go install" will support arbitrary destination paths, so I may still need to use "go build" and make tast compare timestamps itself if I want to avoid rebuilding executables unnecessarily.
 
Cc: ayatane@chromium.org

Comment 2 by derat@chromium.org, Apr 24 2018

Status: Started (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast/+/96bc6953d2104225a7f1469527b0e0e651f0597d

commit 96bc6953d2104225a7f1469527b0e0e651f0597d
Author: Daniel Erat <derat@chromium.org>
Date: Fri Apr 27 04:10:22 2018

tast: Use "go install" when building test bundles.

Update the tast command to use "go install" rather than "go
build -i -pkgdir" when building test bundles (or
local_test_runner). "go build" and "go install" now cache
compiled packages to $HOME/.cache/go-build, so there's no
need to create our own directory for this. (Go also handles
cleaning old files out of the new directory.)

BUG= chromium:813790 
TEST=verified that "go build", "go run", and "go list" still
     work (with both -buildtype=local and -buildtype=remote,
     for the latter two) and that building takes ~400 ms
     with -checkbuilddeps=false to bypass slow equery

Change-Id: I421ccac419aec8dd6e7cb140a92b1e2b071d28f4
Reviewed-on: https://chromium-review.googlesource.com/1025399
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Rahul Chaudhry <rahulchaudhry@chromium.org>

[modify] https://crrev.com/96bc6953d2104225a7f1469527b0e0e651f0597d/src/chromiumos/cmd/tast/run/remote.go
[modify] https://crrev.com/96bc6953d2104225a7f1469527b0e0e651f0597d/src/chromiumos/cmd/tast/run/local.go
[modify] https://crrev.com/96bc6953d2104225a7f1469527b0e0e651f0597d/src/chromiumos/cmd/tast/build_cmd.go
[modify] https://crrev.com/96bc6953d2104225a7f1469527b0e0e651f0597d/src/chromiumos/cmd/tast/build/config.go
[modify] https://crrev.com/96bc6953d2104225a7f1469527b0e0e651f0597d/src/chromiumos/cmd/tast/build/build_test.go
[modify] https://crrev.com/96bc6953d2104225a7f1469527b0e0e651f0597d/src/chromiumos/cmd/tast/build/build.go

Comment 4 by derat@chromium.org, Apr 27 2018

Status: Fixed (was: Started)

Sign in to add a comment