gno icon indicating copy to clipboard operation
gno copied to clipboard

[gno.mod] Add `replace`

Open leohhhn opened this issue 1 year ago • 1 comments

Description

When developing a p/ & and r/ in a repository not containing the examples/ folder, we currently do not have a way to use the code from p/ in r/, especially in the case of gno test. We should try to implement a feature similar to replace in Go, which will allow you to redirect a specific dependency of a realm from say gno.land/p/leon/app to ../p/leon/mypackage.

This should also include the possibility to use packages & realms in the same subdirectory as the code that the user is currently developing. For example, r/leon/app should be able to use r/leon/app/helperpackage.

cc @moul @thehowl

leohhhn avatar Jul 17 '24 16:07 leohhhn

Recycling this issue as part of #4365.

I don't remember where we discussed this further. I recall commenting on other issues and PRs regarding the target. If anyone finds relevant sources, please link them here.

The TL;DR was: the replace directive is exclusively for development, focusing on off-chain replacements (local disk or platforms like GitHub), while avoiding on-chain replacements to encourage maintaining single identifiers for on-chain items.

moul avatar Jun 13 '25 13:06 moul