Skip to content

Commit cab23f2

Browse files
authored
fix: update post-create.sh for current build system and fix unbound variables (#3304)
Signed-off-by: Keiven Chang <[email protected]>
1 parent af4c0ca commit cab23f2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.devcontainer/post-create.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ mkdir -p $CARGO_TARGET_DIR
6363
uv pip uninstall --yes ai-dynamo ai-dynamo-runtime 2>/dev/null || true
6464

6565
# Build project, with `dev` profile it will be saved at $CARGO_TARGET_DIR/debug
66-
cargo build --locked --profile dev --features mistralrs
66+
cargo build --locked --profile dev --features dynamo-llm/block-manager
6767

6868
# install the python bindings
6969

@@ -82,13 +82,13 @@ cargo build --locked --profile dev --features mistralrs
8282
# installs overall python packages, grabs binaries from .build/target/debug
8383
cd $DYNAMO_HOME && retry env DYNAMO_BIN_PATH=$CARGO_TARGET_DIR/debug uv pip install -e .
8484

85+
{ set +x; } 2>/dev/null
86+
8587
echo -e "\n" >> ~/.bashrc
8688
echo "# === This section is generated by the post-create.sh script ===" >> ~/.bashrc
8789

88-
{ set +x; } 2>/dev/null
89-
9090
# Check if PYTHONPATH is already set in environment
91-
if [ -n "$PYTHONPATH" ]; then
91+
if [ -n "${PYTHONPATH:-}" ]; then
9292
# PYTHONPATH exists, replace /workspace with $DYNAMO_HOME
9393
export PYTHONPATH=$(echo "$PYTHONPATH" | sed "s|/workspace|$DYNAMO_HOME|g")
9494
# Also add to .bashrc for persistence
@@ -122,13 +122,13 @@ fi
122122
# Unset empty tokens/variables to avoid issues with authentication and SSH
123123
if ! grep -q "# Unset empty tokens" ~/.bashrc; then
124124
echo -e "\n# Unset empty tokens and environment variables" >> ~/.bashrc
125-
echo '[ -z "$HF_TOKEN" ] && unset HF_TOKEN' >> ~/.bashrc
126-
echo '[ -z "$GITHUB_TOKEN" ] && unset GITHUB_TOKEN' >> ~/.bashrc
127-
echo '[ -z "$SSH_AUTH_SOCK" ] && unset SSH_AUTH_SOCK' >> ~/.bashrc
125+
echo '[ -z "${HF_TOKEN:-}" ] && unset HF_TOKEN' >> ~/.bashrc
126+
echo '[ -z "${GITHUB_TOKEN:-}" ] && unset GITHUB_TOKEN' >> ~/.bashrc
127+
echo '[ -z "${SSH_AUTH_SOCK:-}" ] && unset SSH_AUTH_SOCK' >> ~/.bashrc
128128
fi
129129

130130
# Check SSH agent forwarding status
131-
if [ -n "$SSH_AUTH_SOCK" ]; then
131+
if [ -n "${SSH_AUTH_SOCK:-}" ]; then
132132
if ssh-add -l > /dev/null 2>&1; then
133133
echo "SSH agent forwarding is working - found $(ssh-add -l | wc -l) key(s):"
134134
ssh-add -l

0 commit comments

Comments
 (0)