Skip to content

Commit

Permalink
chore: fix cargo metadata error on first use of build.sh (#1155)
Browse files Browse the repository at this point in the history
Cleaned up the script devenv.sh by unsetting additional environment variables and refining the PATH handling, particularly for Rust toolchains.
  • Loading branch information
sergeytimoshin authored Sep 6, 2024
1 parent a877a4f commit 815b8e6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions js/stateless.js/src/idls/account_compression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,10 @@ export type AccountCompression = {
code: 6025;
name: 'InvalidGroup';
},
{
code: 6026;
name: 'ProofLengthMismatch';
},
];
};

Expand Down Expand Up @@ -2327,5 +2331,9 @@ export const IDL: AccountCompression = {
code: 6025,
name: 'InvalidGroup',
},
{
code: 6026,
name: 'ProofLengthMismatch',
},
],
};
4 changes: 0 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion scripts/devenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ deactivate () {
CARGO_HOME="${LIGHT_PROTOCOL_OLD_CARGO_HOME}"
NPM_CONFIG_PREFIX="${LIGHT_PROTOCOL_OLD_NPM_CONFIG_PREFIX}"
PATH="${LIGHT_PROTOCOL_OLD_PATH}"
[ -n "${LIGHT_PROTOCOL_OLD_RUST_PATH}" ] && PATH="${LIGHT_PROTOCOL_OLD_RUST_PATH}"
unset LIGHT_PROTOCOL_DEVENV
unset LIGHT_PROTOCOL_TOPLEVEL
unset GOROOT
unset RUSTUP_HOME
unset CARGO_HOME
unset LIGHT_PROTOCOL_OLD_RUST_PATH
}

# Stop early if already in devenv.
Expand Down Expand Up @@ -41,8 +45,17 @@ PATH="${LIGHT_PROTOCOL_TOPLEVEL}/.local/cargo/bin:${PATH}"
PATH="${LIGHT_PROTOCOL_TOPLEVEL}/.local/go/bin:${PATH}"
PATH="${LIGHT_PROTOCOL_TOPLEVEL}/.local/npm-global/bin:${PATH}"

# Remove the original Rust-related PATH entries
PATH=$(echo "$PATH" | tr ':' '\n' | grep -vE "/.rustup/|/.cargo/" | tr '\n' ':' | sed 's/:$//')

# Define alias of `light` to use the CLI built from source.
alias light="${LIGHT_PROTOCOL_TOPLEVEL}/cli/test_bin/run"

# Define GOROOT for Go.
GOROOT="${LIGHT_PROTOCOL_TOPLEVEL}/.local/go"
export GOROOT="${LIGHT_PROTOCOL_TOPLEVEL}/.local/go"

# Ensure Rust binaries are in PATH
PATH="${CARGO_HOME}/bin:${PATH}"

# Export the modified PATH
export PATH

0 comments on commit 815b8e6

Please sign in to comment.