Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

use github mirror for golang.org packages when getting golang.org http meta failed #1857

Closed
wants to merge 4 commits into from
Closed

use github mirror for golang.org packages when getting golang.org http meta failed #1857

wants to merge 4 commits into from

Conversation

bensonfx
Copy link

@bensonfx bensonfx commented May 12, 2018

What does this do / why do we need it?

failed 1

dep ensure -add "golang.org/x/sys:github.com/golang/sys" 


The following issues were found in Gopkg.toml:

  ✗ unable to deduce repository and source type for "golang.org/x/sys": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http://golang.org/x/sys?go-get=1": Get http://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:80: getsockopt: connection timed out

ProjectRoot name validation failed

cause: ValidateProjectRoots is faild because the args is parsed to late.

failed 2

- touch Gopkg.toml  write constraint source:
prinf "
[[constraint]]
    name = "golang.org/x/sys"
    source = "github.com/golang/sys"
" > Gopkg.toml
den ensure -v

The following issues were found in Gopkg.toml:
  ✗ unable to deduce repository and source type for "golang.org/x/sys": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http://golang.org/x/sys?go-get=1": Get http://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:80: getsockopt: connection timed out

cause: fetch raw metadata from golang.org failed

about this patch:

when fetch raw metadata: failed HTTP request to http://golang.org/x/{name}
add deducerTrie rule for golang.org/x , and use github mirror

What should your reviewer look out for in this PR?

Do you need help or clarification on anything?

Which issue(s) does this PR fix?

#1322
#1837
#1721

@googlebot
Copy link
Collaborator

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

1 similar comment
@googlebot
Copy link
Collaborator

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@bensonfx bensonfx changed the title fix golang.org issue in china: add option to use github mirror for golang.org packages use github mirror for golang.org packages when getting golang.org http meta failed May 14, 2018
@co-kevin
Copy link

That's a good feature! I need it!

@chiaen
Copy link

chiaen commented May 30, 2018

nice job, but you should also consider google.golang.org

@davidaq
Copy link

davidaq commented Jul 20, 2018

Nice little feature, hope to see it merged into next release. By now I'm tricking dep into using github source by setting up a fake registry.

My trick is to add 127.0.0.1 golang.org into my hosts file and run a script written with go:

package main

import (
  "fmt"
  "strings"
  "net/http"
)

type myHandler struct{
}

func (self *myHandler) ServeHTTP(res http.ResponseWriter, req *http.Request){
  libName := strings.Split(req.URL.Path, "/")[2]
  html := fmt.Sprintf(`
  <!DOCTYPE html>
  <html>
    <head>
      <meta charset="utf-8">
      <meta name="go-import" content="golang.org/x/%s git https://github.com/golang/%s">
    </head>
    <body></body>
  </html>
  `, libName, libName)
  fmt.Println("Dep request repo", libName)
  res.Write([]byte(html))
}

func main() {
  http.ListenAndServe(":80", &myHandler{})
}

@hsluoyz
Copy link

hsluoyz commented Jul 21, 2018

@bensonfx really needed for this! I hope it can be merged. BTW, do you have a binary release? So it can save me from building it.

@mvdan
Copy link
Member

mvdan commented Sep 4, 2020

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!

@mvdan mvdan closed this Sep 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants