Files
zeekayandGitHub 8d53833026 env: drop LUX_ prefix from env vars (noise) (#113)
Renames LUX_-prefixed env vars to their canonical, non-noisy forms:

- LUX_RLP_PATH    -> RLP_PATH    (test override for the RLP fixture path)
- LUX_VERSION     -> LUXD_VERSION (the luxd version being downloaded/cloned)
- LUX_PLUGIN_DIR  -> PLUGIN_DIR  (the lux plugin install dir, ~/.lux/plugins)

LUX_VERSION had two callers: shell scripts treating it as the luxd
version, and install_luxd_release.sh that already aliased
'LUXD_VERSION=${LUXD_VERSION:-${LUX_VERSION#v}}' on read. Collapse this
to a single canonical name (LUXD_VERSION) and a one-liner v-prefix
strip; no more aliasing.

LUX_PLUGIN_DIR points at ~/.lux/plugins on disk — the path is unchanged,
only the env var name. INSTALL=1 ./scripts/build.sh continues to work,
just driven from $PLUGIN_DIR.

Note: the historical README mention of LUX_VM_RUNTIME_ENGINE_ADDR /
LUX_VM_TRANSPORT (legacy luxfi/vm <= v1.1.0 names) is left in place
because it documents past behavior, per task convention for CHANGELOG/
historical docs.

BREAKING: external callers (CI, dev scripts, operators) must update
env var names. Per CLAUDE.md no-backwards-compatibility rule, the old
forms are removed.
2026-05-15 16:05:42 -07:00

40 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Build the Lux EVM plugin.
#
# ./scripts/build.sh # → build/evm
# ./scripts/build.sh /custom/path # → /custom/path
# INSTALL=1 ./scripts/build.sh # also installs to $PLUGIN_DIR/<vmid>
#
# The VM ID for the install path is derived at runtime from luxfi/constants.EVMID
# via cmd/vmid — no base58 strings are hardcoded in shell.
set -o errexit
set -o nounset
set -o pipefail
EVM_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. && pwd)
source "$EVM_PATH"/scripts/constants.sh
BINARY_PATH="${1:-$EVM_PATH/build/evm}"
echo "Building EVM @ GitCommit: $EVM_COMMIT at $BINARY_PATH"
mkdir -p "$(dirname "$BINARY_PATH")"
go build \
-ldflags "-X github.com/luxfi/evm/plugin/evm.GitCommit=$EVM_COMMIT $STATIC_LD_FLAGS" \
-o "$BINARY_PATH" \
"$EVM_PATH"/plugin/*.go
if [[ "$(uname -s)" == "Darwin" ]]; then
codesign --force --sign - "$BINARY_PATH" >/dev/null 2>&1 || true
fi
if [[ "${INSTALL:-}" == "1" ]]; then
mkdir -p "$PLUGIN_DIR"
install -m 0755 "$BINARY_PATH" "$PLUGIN_DIR/$EVM_VMID"
if [[ "$(uname -s)" == "Darwin" ]]; then
codesign --force --sign - "$PLUGIN_DIR/$EVM_VMID" >/dev/null 2>&1 || true
fi
echo "Installed $PLUGIN_DIR/$EVM_VMID"
fi