Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for golang.org/x remote libs.
Although golang.org/x supports the `go get` <meta> protocol, pants does not have a `Fetcher` that supports that protocol yet, so just use the standard `ArchiveFetcher` with a regex mapping that redirects directly to github (this appears to be the consistent pattern of th golang.org/x <meta> re-directs). Add a test to cover this new default fetcher configuration. Testing Done: Manually tested this in a custom Medium pants.ini setup: ```ini [fetchers] mapping: { # Builtin fetchers: r'^bitbucket.org/.*$': 'ArchiveFetcher', r'^github.com/.*$':'ArchiveFetcher', r'^gopkg.in/.*$':'GopkgInFetcher', # Our workaround custom fetcher until # pantsbuild#2378 or # pantsbuild#2379 is resolved. r'^golang.org/x/.*$':'ArchiveFetcher', } [archive-fetcher] matchers: { # Builtin matchers: r'bitbucket.org/(?P<user>[^/]+)/(?P<repo>[^/]+)': ('https://bitbucket.org/\g<user>/\g<repo>/get/{rev}.tar.gz', 'tip', 1), r'github.com/(?P<user>[^/]+)/(?P<repo>[^/]+)': ('https://github.com/\g<user>/\g<repo>/archive/{rev}.tar.gz', 'master', 1), # Our workaround custom fetcher until # pantsbuild#2378 or # pantsbuild#2379 is resolved. r'golang.org/x/(?P<user>[^/]+)': ('https://github.com/golang/\g<user>/archive/{rev}.tar.gz', 'master', 1), } ``` CI went green here: https://travis-ci.org/pantsbuild/pants/builds/85667224 Bugs closed: 2378, 2379, 2380 Reviewed at https://rbcommons.com/s/twitter/r/2976/
- Loading branch information