-
Notifications
You must be signed in to change notification settings - Fork 607
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
Move osmomath into its own go.mod #3771
Conversation
Dockerfile
Outdated
@@ -19,7 +19,7 @@ RUN apk add --no-cache \ | |||
|
|||
# Download go dependencies | |||
WORKDIR /osmosis | |||
COPY go.mod go.sum ./ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @niccoloraspa @p0mvn is there some more correct way I should be doing this?
AFAIU, we may actually be building against the wrong osmomath rn, since we can cache the osmomath copy.
We need it here though, since go mod download looks for a local osmomath replace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented below with suggestions, rest LGTM on a first pass
@@ -0,0 +1,89 @@ | |||
module github.com/osmosis-labs/osmosis/osmomath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we suffix this with a version?
I think not having a version might contribute to import cycles and other import problems in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not 1.0 yet. We only need version suffixes once theres a 2.0
I don't see how we'd get import cycles, though we may get import problems due to API breaks and not tagging a new osmomath. (I feel not super worried about this though, as long as we tag a new osmomath at every osmosis major version or notable osmomath changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This opens up a discussion of the semantics of versioning for these submodules. What sort of changes are needed for a v2? is it any api breaking changes?
I think this depends on wether we have external users or not, but I'm almost leaning towards that projects importing this should target a specific commit in their go.mod. That way we don't have to worry about breaking changes for external users.
Dockerfile
Outdated
@@ -19,7 +19,8 @@ RUN apk add --no-cache \ | |||
|
|||
# Download go dependencies | |||
WORKDIR /osmosis | |||
COPY go.mod go.sum ./ | |||
COPY go.work go.mod go.sum ./ | |||
COPY osmomath/ ./osmomath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to only copy osmomath/go.mod
and osmomath/go.sum
here?
This is so that updates to osmomath
code do not trigger wget for wasvm. Having only go.mod
will allow that layer to be cached
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me try this, but I believe the answer is no. This is because the main go.mod replaces it with a local folder path, rather than downloading this folder from a normal upstream mirror.
Though we could move all these copies until after the wasmvm wget, I don't understand why we do the go mod download before the wget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with moving the COPYs on the docker file and left a comment about versioning. But otherwise this LGTM
Note/warning: when main gets merged into this branch, you'll have issues with the Exp2 tests using osmoassert. This will be solved by making osmoutils its own module too |
Ok I tagged osmomath, and switched |
Should now work per the discussed plan! Going to merge |
* Move osmomath into its own go.mod * Fix go mods * fix osmomath test build * Tryfix e2e test * Try removing osmomath from the copy line? * Add osmomath to first copy * Try another layer * Make build work off of tagged releases * Switch prod and E2E builds to ignore go work * Fix merge conflict * Add root dir to go work * Fix conflict (cherry picked from commit 079702e) # Conflicts: # go.mod # go.sum # osmomath/decimal_test.go # osmomath/exp2_test.go # x/gamm/keeper/pool_service.go # x/gamm/pool-models/stableswap/pool_test.go # x/twap/logic.go # x/twap/strategy.go # x/twap/strategy_test.go
* Move osmomath into its own go.mod (#3771) * Move osmomath into its own go.mod * Fix go mods * fix osmomath test build * Tryfix e2e test * Try removing osmomath from the copy line? * Add osmomath to first copy * Try another layer * Make build work off of tagged releases * Switch prod and E2E builds to ignore go work * Fix merge conflict * Add root dir to go work * Fix conflict (cherry picked from commit 079702e) # Conflicts: # go.mod # go.sum # osmomath/decimal_test.go # osmomath/exp2_test.go # x/gamm/keeper/pool_service.go # x/gamm/pool-models/stableswap/pool_test.go # x/twap/logic.go # x/twap/strategy.go # x/twap/strategy_test.go * Tryfix conflicts * go mod tidy * Update to osmomath v0.0.2 * refactor(osmoutils): use Dec for additive tolerance instead of Int (#3711) * refactor(osmoutils): use Dec for additive tolerance instead of Int * changelog (cherry picked from commit 5ab7ebf) # Conflicts: # CHANGELOG.md # osmomath/binary_search.go # x/gamm/pool-models/balancer/pool_test.go # x/gamm/pool-models/internal/cfmm_common/lp.go # x/gamm/pool-models/stableswap/amm.go # x/gamm/pool-models/stableswap/amm_test.go * tryfix conflict Co-authored-by: Dev Ojha <[email protected]> Co-authored-by: Dev Ojha <[email protected]> Co-authored-by: Roman <[email protected]>
Closes: #3744 (after we get a tag for this folder, that comes after this is merged)
What is the purpose of the change
Move osmomath into its own go.mod, but all our code set to use latest code in the folder.
Brief Changelog
github.com/osmosis-labs/osmosis/v13/osmomath
github.com/osmosis-labs/osmosis/osmomath
Testing and Verifying
All tests still pass
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? yes