Skip to content

Commit

Permalink
kontrol env
Browse files Browse the repository at this point in the history
  • Loading branch information
aazhou1 committed Nov 15, 2024
1 parent fbe4653 commit 06dbc0a
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,53 +77,65 @@ jobs:
# Set absolute paths
WORKSPACE="$GITHUB_WORKSPACE"
K_ROOT="$WORKSPACE/kframework"
K_LIB_DIR="$K_ROOT/k-distribution/lib/kframework"
# Create directory if it doesn't exist (with -p to avoid errors if it exists)
mkdir -p "$K_LIB_DIR"
echo "Current directory structure before setup:"
ls -R "$K_ROOT"
# Find k-util.sh
# Try to locate existing directories
echo "Searching for existing k-util.sh..."
find "$K_ROOT" -name k-util.sh
echo "Searching for existing krun..."
find "$K_ROOT" -name krun
# Check directory structure
echo "Checking directory structure..."
ls -la "$K_ROOT/k-distribution" || echo "k-distribution not found"
ls -la "$K_ROOT/k-distribution/lib" || echo "lib directory not found"
# Find k-util.sh first
K_UTIL=$(find "$K_ROOT" -name k-util.sh | head -n 1)
if [ -z "$K_UTIL" ]; then
echo "Error: k-util.sh not found"
find "$K_ROOT" -type f -name "*k-util*" # Debug: look for similar files
exit 1
fi
echo "Found k-util.sh at: $K_UTIL"
# Copy k-util.sh to the expected location (use -f to force overwrite if exists)
cp -f "$K_UTIL" "$K_LIB_DIR/"
# Get the directory where k-util.sh currently resides
K_UTIL_DIR=$(dirname "$K_UTIL")
echo "k-util.sh directory: $K_UTIL_DIR"
# Find krun
KRUN=$(find "$K_ROOT" -name krun | head -n 1)
if [ -z "$KRUN" ]; then
echo "Error: krun not found"
find "$K_ROOT" -type f -name "*krun*" # Debug: look for similar files
exit 1
fi
echo "Found krun at: $KRUN"
KRUN_DIR=$(dirname "$KRUN")
echo "krun directory: $KRUN_DIR"
# Use the existing directory structure instead of creating new ones
K_LIB="$K_UTIL_DIR"
# Export paths
{
echo "K_BIN=$KRUN_DIR"
echo "K_LIB=$K_LIB_DIR"
echo "K_LIB=$K_LIB"
echo "PATH=$KRUN_DIR:$PATH"
} >> $GITHUB_ENV
# Debug: Show directory structure
echo "K Framework directory structure:"
echo "K_ROOT=$K_ROOT"
# Debug: Show final paths
echo "Final K Framework paths:"
echo "K_BIN=$KRUN_DIR"
echo "K_LIB=$K_LIB_DIR"
ls -la "$K_ROOT/k-distribution/lib" || echo "lib directory not accessible"
ls -la "$K_LIB_DIR" || echo "kframework directory not accessible"
echo "K_LIB=$K_LIB"
echo "PATH=$KRUN_DIR:$PATH"
# Verify k-util.sh was copied correctly
if [ ! -f "$K_LIB_DIR/k-util.sh" ]; then
echo "Error: Failed to copy k-util.sh to $K_LIB_DIR"
# Verify k-util.sh is accessible
if [ ! -f "$K_LIB/k-util.sh" ]; then
echo "Error: Cannot access k-util.sh at $K_LIB/k-util.sh"
exit 1
fi
Expand Down

0 comments on commit 06dbc0a

Please sign in to comment.