Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace directive is needed for all dependents #74

Open
gaukas opened this issue Jun 27, 2024 · 2 comments
Open

replace directive is needed for all dependents #74

gaukas opened this issue Jun 27, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested

Comments

@gaukas
Copy link
Contributor

gaukas commented Jun 27, 2024

One of the external dependency of water, tetratelabs/wazero has been replaced with our fork, refraction-networking/wazero. However, Go itself will not inherit the replace directive in go.mod and therefore any dependents of this project must manually add the replace directive to their go.mod as well, making it challenging to maintain.

@gaukas gaukas added documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested labels Jun 27, 2024
@gaukas gaukas self-assigned this Jun 27, 2024
@gaukas gaukas changed the title replace directive is needed for all importing parties replace directive is needed for all dependents Jun 27, 2024
@gaukas
Copy link
Contributor Author

gaukas commented Jun 27, 2024

We would love to seek out a long-term solution for this problem.

@gaukas
Copy link
Contributor Author

gaukas commented Jul 2, 2024

By adding a dummy import path in our wazero fork in commit refraction-networking/wazero@15dfe8e, 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant