FAQ
Hello Gophers,

I've noticed that the recent changes on tip that enforces the new location
for
the go.tool repo leads to an issue when doing coverage with Travis +
Coveralls
that I'm hoping you guys gave a clever solution for.

In short the old path no longer works on tip, but the new path doesn't work
on
release because it does not get installed to the 'go env GOTOOLDIR' so
running
'go tool cover' results in an error since it doesn't see it installed.

Has anyone already run into this and resolved it?


More specific details follow:

In particular, I have a matrix build setup with both go tip and go release
along
with the install section setup to get the cover tool which is later used to
send the coverage details along to coveralls. The relevant information from
the setup file is as follows:

go:
   - release
   - tip
install:
   - go get -v code.google.com/p/go.tools/cmd/cover

Due to the recent moving of the go.tools repo though, the tip build fails
with:

$ go get -v code.google.com/p/go.tools/cmd/cover
code.google.com/p/go.tools (download)
the code.google.com/p/go.tools/cmd/cover command has moved; use
golang.org/x/tools/cmd/cover instead.

However, if I update the command to the new location:
  - go get -v golang.org/x/tools/cmd/cover

The cover tool gets installed to GOPATH instead of GOTOOLPATH which leads to
'go tool cover' complaining about it not being found:

$ go tool cover
go tool: no such tool "cover"; to install:
         go get code.google.com/p/go.tools/cmd/cover

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Andrew Gerrand at Nov 15, 2014 at 1:10 am
    Use the old path with release and the new path with tip. That's what the go
    tool says you should do.
    On Sat, 15 Nov 2014 at 12:04, Dave Collins wrote:

    Hello Gophers,

    I've noticed that the recent changes on tip that enforces the new location
    for
    the go.tool repo leads to an issue when doing coverage with Travis +
    Coveralls
    that I'm hoping you guys gave a clever solution for.

    In short the old path no longer works on tip, but the new path doesn't
    work on
    release because it does not get installed to the 'go env GOTOOLDIR' so
    running
    'go tool cover' results in an error since it doesn't see it installed.

    Has anyone already run into this and resolved it?


    More specific details follow:

    In particular, I have a matrix build setup with both go tip and go release
    along
    with the install section setup to get the cover tool which is later used to
    send the coverage details along to coveralls. The relevant information
    from
    the setup file is as follows:

    go:
    - release
    - tip
    install:
    - go get -v code.google.com/p/go.tools/cmd/cover

    Due to the recent moving of the go.tools repo though, the tip build fails
    with:

    $ go get -v code.google.com/p/go.tools/cmd/cover
    code.google.com/p/go.tools (download)
    the code.google.com/p/go.tools/cmd/cover command has moved; use
    golang.org/x/tools/cmd/cover instead.

    However, if I update the command to the new location:
    - go get -v golang.org/x/tools/cmd/cover

    The cover tool gets installed to GOPATH instead of GOTOOLPATH which leads
    to
    'go tool cover' complaining about it not being found:

    $ go tool cover
    go tool: no such tool "cover"; to install:
    go get code.google.com/p/go.tools/cmd/cover

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Collins at Nov 15, 2014 at 1:19 am
    Right, but I don't see a way to configure Travis to run a different install
    command for tip versus release, hence why I was asking if anyone had
    figured out
    a clever way to work around it.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrew Gerrand at Nov 15, 2014 at 2:29 am
    Ah, sorry. Thought it was a go question, not a travis question.
    On Sat, 15 Nov 2014 at 12:19, Dave Collins wrote:

    Right, but I don't see a way to configure Travis to run a different install
    command for tip versus release, hence why I was asking if anyone had
    figured out
    a clever way to work around it.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Collins at Nov 15, 2014 at 3:26 am
    For anyone else that runs into this and is looking for a solution, I made a
    hackish workaround that gets the job done for now:

    Modify the .travis.yml file under the install key to:

    install:
       - ./get_ci_cover.sh

    And include a new script with the executable bit set into the repo named
    'get_ci_cover.sh' for the following contents:

    #!/usr/bin/env sh

    set -x
    if [ "$TRAVIS_GO_VERSION" = "tip" ]; then
         go get -v golang.org/x/tools/cmd/cover
    else
         go get -v code.google.com/p/go.tools/cmd/cover
    fi


    El viernes, 14 de noviembre de 2014 19:04:50 UTC-6, Dave Collins escribió:
    Hello Gophers,

    I've noticed that the recent changes on tip that enforces the new location
    for
    the go.tool repo leads to an issue when doing coverage with Travis +
    Coveralls
    that I'm hoping you guys gave a clever solution for.

    In short the old path no longer works on tip, but the new path doesn't
    work on
    release because it does not get installed to the 'go env GOTOOLDIR' so
    running
    'go tool cover' results in an error since it doesn't see it installed.

    Has anyone already run into this and resolved it?


    More specific details follow:

    In particular, I have a matrix build setup with both go tip and go release
    along
    with the install section setup to get the cover tool which is later used to
    send the coverage details along to coveralls. The relevant information
    from
    the setup file is as follows:

    go:
    - release
    - tip
    install:
    - go get -v code.google.com/p/go.tools/cmd/cover

    Due to the recent moving of the go.tools repo though, the tip build fails
    with:

    $ go get -v code.google.com/p/go.tools/cmd/cover
    code.google.com/p/go.tools (download)
    the code.google.com/p/go.tools/cmd/cover command has moved; use
    golang.org/x/tools/cmd/cover instead.

    However, if I update the command to the new location:
    - go get -v golang.org/x/tools/cmd/cover

    The cover tool gets installed to GOPATH instead of GOTOOLPATH which leads
    to
    'go tool cover' complaining about it not being found:

    $ go tool cover
    go tool: no such tool "cover"; to install:
    go get code.google.com/p/go.tools/cmd/cover
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jonathan Lawlor at Nov 17, 2014 at 3:52 pm
    I put a line into .travis.yml:

    - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi

    To be removed at some point when 1.3 and lower are no longer in my build matrix.

    Alternatively, you might only calculate coverage in the release build.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Wael M. Nasreddine at Nov 19, 2014 at 6:16 am
    Check out go-poker's travis.yml
    <https://github.com/go-poker/poker/blob/v0/.travis.yml>. It also took me a
    while to figure it out last week.

    I am glad you worked it out, sorry it took me a while to see your email, I
    could have saved you some time researching.

    Wael
    On Mon, Nov 17, 2014 at 7:52 AM, Jonathan Lawlor wrote:

    I put a line into .travis.yml:

    - if ! go get code.google.com/p/go.tools/cmd/cover; then go get
    golang.org/x/tools/cmd/cover; fi

    To be removed at some point when 1.3 and lower are no longer in my build
    matrix.

    Alternatively, you might only calculate coverage in the release build.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    Wael Nasreddine | SRE at Google | wael.nasreddine@gmail.com | (650) 735-1773

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 15, '14 at 1:04a
activeNov 19, '14 at 6:16a
posts7
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase