-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add support for wormchain and update the docker files to better support a custom build dir #134
Changes from 1 commit
44cba21
a9aea69
d16b66d
9e878e6
7f6ff92
c23fdb2
d6c74a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,18 @@ ARG BUILDARCH | |
ARG GITHUB_ORGANIZATION | ||
ARG REPO_HOST | ||
ARG GITHUB_REPO | ||
ARG BUILD_DIR | ||
ARG BUILD_TARGET | ||
|
||
WORKDIR /go/src/${REPO_HOST}/${GITHUB_ORGANIZATION}/${GITHUB_REPO} | ||
|
||
ADD . . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The optimization did not account for a build dir. When a build dir is defined, we would need to pull the go.mod and go.sum from that build directory for the wasmvm search, not from the root. If other modules from that repo are also used, i.e. wormchain's sdk module, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if we just move up the Alternatively, what if we move the wasm version detection into the heighliner go code and add |
||
|
||
# Download dependencies and CosmWasm libwasmvm if found. | ||
ADD go.mod go.sum ./ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this and L22 removed? We should be able to cache deps still, but it could be done as a phase after the libwasmvm download since that no longer depends on the go.mod being present. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pulling those files does not work when there is a custom build directory |
||
RUN set -eux; \ | ||
if [ ! -z "$BUILD_TARGET" ]; then \ | ||
if [ ! -z "$BUILD_DIR" ]; then cd "${BUILD_DIR}"; fi; \ | ||
fi; \ | ||
export ARCH=$(uname -m); \ | ||
WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm | awk '{print $2}'); \ | ||
if [ ! -z "${WASM_VERSION}" ]; then \ | ||
|
@@ -103,7 +109,6 @@ ARG BUILD_DIR | |
|
||
# This Dockerfile is the same as native.Dockerfile except that the chain code is sourced from the | ||
# current working directory instead of a remote git repository. | ||
ADD . . | ||
|
||
RUN set -eux; \ | ||
export CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"'; \ | ||
|
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 there any chance this would be backwards breaking?
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.
It shouldn't. If a build directory is defined, then we need to enter it to use the go list to find a wasm version in the next step. The current and only cosmos repo (gravitybridge) with a build dir set, does not use wasm so it wasn't an issue.