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

Issue 796837 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature

Blocking:
issue 784944



Sign in to add a comment

CROS_GO_BINARIES should support installing to alternate location

Project Member Reported by derat@chromium.org, Dec 21 2017

Issue description

Per email discussion: I'd like to be able to install Go binaries to locations other than /usr/bin. CROS_GO_BINARIES already supports appending ":binary_name" to install a binary using a different name. Rahul suggested that it could also accept ":/some/other/path/binary_name" to install to a different location.

I'm not sure about the black magic that we use to install test-only packages under /usr/local instead of /usr (do we override $DESTTREE?), but it'd be nice if this also respected that if possible, so that ":/usr/share/foo/bar" would end up as ":/usr/local/share/foo/bar" for test packages. Maybe it'd be good to support a relative-path version that uses similar logic to dobin? Then ":share/foo/bar" would install to /usr/share/foo/bar for a regular package and /usr/local/share/foo/bar for a test package.
 
I just created a CL for adding simple ":/install/path/binary_name" support: https://chromium-review.googlesource.com/858229

I'm not sure how test-only packages end up under /usr/local instead of /usr.
Maybe these packages do an explicit "into /usr/local" in src_install()?

Comment 2 by derat@chromium.org, Jan 9 2018

Cc: vapier@chromium.org
> I'm not sure how test-only packages end up under /usr/local instead of /usr.

Mike probably knows.
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/cd924d8a104640bc3cf8e93933a9825f64c4326a

commit cd924d8a104640bc3cf8e93933a9825f64c4326a
Author: Rahul Chaudhry <rahulchaudhry@chromium.org>
Date: Wed Jan 10 08:10:49 2018

cros-go.eclass: support alternate install locations for CROS_GO_BINARIES.

CROS_GO_BINARIES already supports appending ":binary_name" to install a
binary using a different name. This change adds support for providing a
full install path for the binary by appending ":/install/path/binary_name".

BUG= chromium:796837 
TEST=Added "golang.org/x/tools/cmd/stringer:/usr/local/bin/gostringer"
     to CROS_GO_BINARIES in dev-go/go-tools, emerged the package, and
     verified that "gostringer" is installed in "/usr/local/bin".

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

[modify] https://crrev.com/cd924d8a104640bc3cf8e93933a9825f64c4326a/eclass/cros-go.eclass

Comment 4 by derat@chromium.org, Jan 10 2018

Status: Verified (was: Assigned)
I'm still not sure of the magic that makes test-only packages get installed under /usr/local -- https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/install-software-on-base-images might have some clues, but I think it may be outdated at this point.

I can confirm that when I use "...:/usr/libexec/foo" for an executable in a test-only package, the file ends up in /usr/local/libexec/foo in the system image, though, so that part seems like it still works.

Thanks!

Sign in to add a comment