mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
- cmd/vmid prints constants.EVMID — Go source of truth for the C-Chain VM ID. Build scripts and Makefile now call this instead of hardcoding the base58 string. Drops a stale subnet-evm ID (ag3GReYP…) from the Makefile. - scripts/build.sh: default output is build/evm; INSTALL=1 installs under the derived VMID at \$LUX_PLUGIN_DIR. Codesigns on darwin in-line so a fresh binary doesn't get SIGKILLed by gatekeeper post-cp. - core/parallel/gpu_bridge.go: build tag flipped from \`!nogpu\` (opt-out) to \`gpu\` (opt-in) so default builds don't drag in luxfi/gpu cgo. - go.mod: luxfi/gpu v0.30.0 → v1.0.1. v0.30.0 referenced removed MLX symbols (mlx_from_slice_int64 etc.); v1.0.1 migrated to lux/gpu.h and builds cleanly with -tags gpu and -tags \"cevm gpu\". - LLM.md: build commands updated; \"no canonical / no aliases\" reflects reality (single VMID, one filename, derived from Go).
62 lines
2.5 KiB
Bash
Executable File
62 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Builds docker images for antithesis testing.
|
|
|
|
# e.g.,
|
|
# ./scripts/build_antithesis_images.sh # Build local images
|
|
# IMAGE_PREFIX=<registry>/<repo> IMAGE_TAG=latest ./scripts/build_antithesis_images.sh # Specify a prefix to enable image push and use a specific tag
|
|
|
|
# Directory above this script
|
|
EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
|
|
|
# Assume it's necessary to build the luxd node image from source
|
|
# TODO(marun) Support use of a released node image if using a release version of luxd
|
|
|
|
source "${EVM_PATH}"/scripts/constants.sh
|
|
# shellcheck source=/dev/null
|
|
source "${EVM_PATH}"/scripts/lib_luxd_clone.sh
|
|
|
|
clone_luxd "${LUX_VERSION}"
|
|
LUXD_IMAGE_TAG="$(luxd_image_tag_from_clone)"
|
|
|
|
# Build luxd node image in the clone path
|
|
pushd "${LUXD_CLONE_PATH}" > /dev/null
|
|
NODE_ONLY=1 TEST_SETUP=luxd IMAGE_TAG="${LUXD_IMAGE_TAG}" bash -x "${LUXD_CLONE_PATH}"/scripts/build_antithesis_images.sh
|
|
popd > /dev/null
|
|
|
|
# Specifying an image prefix will ensure the image is pushed after build
|
|
IMAGE_PREFIX="${IMAGE_PREFIX:-}"
|
|
|
|
IMAGE_TAG="${IMAGE_TAG:-}"
|
|
if [[ -z "${IMAGE_TAG}" ]]; then
|
|
# Default to tagging with the commit hash
|
|
source "${EVM_PATH}"/scripts/constants.sh
|
|
IMAGE_TAG="${EVM_COMMIT::8}"
|
|
fi
|
|
|
|
# The dockerfiles don't specify the golang version to minimize the changes required to bump
|
|
# the version. Instead, the golang version is provided as an argument.
|
|
GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
|
|
|
|
# Import common functions used to build images for antithesis test setups
|
|
# shellcheck source=/dev/null
|
|
source "${LUXD_CLONE_PATH}"/scripts/lib_build_antithesis_images.sh
|
|
|
|
build_antithesis_builder_image "${GO_VERSION}" "antithesis-evm-builder:${IMAGE_TAG}" "${LUXD_CLONE_PATH}" "${EVM_PATH}"
|
|
|
|
# Ensure luxd and evm binaries are available to create an initial db state that includes subnets.
|
|
pushd "${LUXD_CLONE_PATH}" && ./scripts/build.sh && popd
|
|
"${EVM_PATH}"/scripts/build.sh
|
|
|
|
echo "Generating compose configuration"
|
|
gen_antithesis_compose_config "${IMAGE_TAG}" "${EVM_PATH}/tests/antithesis/gencomposeconfig" \
|
|
"${EVM_PATH}/build/antithesis" \
|
|
"LUXD_PATH=${LUXD_CLONE_PATH}/build/luxd \
|
|
LUXD_PLUGIN_DIR=${LUX_PLUGIN_DIR}"
|
|
|
|
build_antithesis_images "${GO_VERSION}" "${IMAGE_PREFIX}" "antithesis-evm" "${IMAGE_TAG}" \
|
|
"${LUXD_IMAGE_TAG}" "${EVM_PATH}/tests/antithesis/Dockerfile" \
|
|
"${EVM_PATH}/Dockerfile" "${EVM_PATH}"
|