Open gaukas opened 2 months ago
We would love to seek out a long-term solution for this problem.
By adding a dummy import path in our wazero
fork in commit https://github.com/refraction-networking/wazero/commit/15dfe8eb50718971e30d69aaa4674bb4c0ac46e3, we allow water
to import this directory at
must/replace/with/refraction-networking/wazero/fork
which does not and will not exist in the upstream tetratelabs/wazero
repository. Therefore we managed to detect if replace
directive is in use and will display the error message close to
wazero_config.go:13:2: no required module provides package github.com/tetratelabs/wazero/must/replace/with/refraction-networking/wazero/fork; to add it:
go get github.com/tetratelabs/wazero/must/replace/with/refraction-networking/wazero/fork
which is relatively intuitive.
Additionally, we should mention the replace
directive is a must in documentations (e.g., https://water.refraction.network/runtime/go.html).
One of the external dependency of
water
,tetratelabs/wazero
has been replaced with our fork,refraction-networking/wazero
. However, Go itself will not inherit thereplace
directive ingo.mod
and therefore any dependents of this project must manually add thereplace
directive to theirgo.mod
as well, making it challenging to maintain.