Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

support for replace directives and dependency overrides #50

Open
myitcv opened this issue Dec 2, 2018 · 0 comments
Open

support for replace directives and dependency overrides #50

myitcv opened this issue Dec 2, 2018 · 0 comments

Comments

@myitcv
Copy link
Owner

myitcv commented Dec 2, 2018

It is currently impossible to install a fork of a project.

For example, github.com/myitcv/gopherjs is a fork of github.com/gopherjs/gopherjs. The module at the path github.com/myitcv/gopherjs is github.com/gopherjs/gopherjs, that is to say, the former can only be used as a replace target for the latter.

Hence gobin currently fails:

failed to run go get -d github.com/myitcv/gopherjs: exit status 1
go: finding github.com/myitcv/gopherjs latest
go: github.com/myitcv/[email protected]: parsing go.mod: unexpected module path "github.com/gopherjs/gopherjs"
go: error loading module requirements

It should be possible to install the module that exists at path github.com/myitcv/gopherjs, perhaps via something like

$ gobin -replace github.com/gopherjs/gopherjs=github.com/myitcv/gopherjs github.com/gopherjs/gopherjs

Similarly, it would be nice to be able to support arbitrary dependency overrides. Say you want to install foo v1.0.0, but you know that there is a bug in bar v1.0.0. This might be made possible via something like:

Things to consider above:

  • if we support these require and replace augmentations then our caching strategy needs to change to be hash based, where the version, original go.mod (if there is one), additional replace and require directives all get hashed to give the build key
  • ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant