You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugins can not be loaded if it shared a dependency with the host package and the required dependency version declared in the host package go.mod is lower than that in the plugin package. An example here.
What did you expect to see?
As there might be several common dependencies(both direct & indirect) between the host package and the plugin package, managing the version constraints manually could be annoying.
Since there is no way to tell go which main package the plugin package is built for, a workaround to this problem is to manually copy all common dependency requirements from the server go.mod, however it requires a lot of human intervention and a non-synchronized go.mod will cause subsequent builds to fail.
The Proposal
I think we can add a comply directive to go.mod. The directive will tell go module system the package dependencies need to be in comply with another main package, as it will be built as a plugin for that package.
When executing go mod tidy, all applicable require, exclude and replace directives from given version of the foreign module are applied into the current go.mod (In this example, when executing go mod tidy on the plugin module, the version requirement on github.com/gin-gonic/gin will be changed to in comply with the server(v1.1.4))
When downloading modules, abort with error if the calculated dependencies does not comply with the packages indicated in the comply directive
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Plugins can not be loaded if it shared a dependency with the host package and the required dependency version declared in the host package
go.mod
is lower than that in the plugin package. An example here.What did you expect to see?
As there might be several common dependencies(both direct & indirect) between the host package and the plugin package, managing the version constraints manually could be annoying.
Since there is no way to tell go which main package the plugin package is built for, a workaround to this problem is to manually copy all common dependency requirements from the server
go.mod
, however it requires a lot of human intervention and a non-synchronizedgo.mod
will cause subsequent builds to fail.The Proposal
I think we can add a
comply
directive togo.mod
. The directive will tell go module system the package dependencies need to be in comply with another main package, as it will be built as a plugin for that package.The
comply
directive poses these effects:go mod tidy
, all applicablerequire
,exclude
andreplace
directives from given version of the foreign module are applied into the currentgo.mod
(In this example, when executinggo mod tidy
on the plugin module, the version requirement ongithub.com/gin-gonic/gin
will be changed to in comply with the server(v1.1.4
))comply
directiveThe text was updated successfully, but these errors were encountered: