From 10f1410cd40daaad5b845cbf10385695922aa06c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 27 Jul 2025 00:26:17 +0000 Subject: [PATCH 1/3] Initial plan From d25e504839dddffb1969c071804672b3a1289f45 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 27 Jul 2025 00:36:22 +0000 Subject: [PATCH 2/3] Fix asmoses & moses build by using local components instead of cloning external repos Co-authored-by: drzo <15202748+drzo@users.noreply.github.com> --- .github/workflows/ci-org-generalized.yml | 186 ++++------------------- 1 file changed, 28 insertions(+), 158 deletions(-) diff --git a/.github/workflows/ci-org-generalized.yml b/.github/workflows/ci-org-generalized.yml index ca29b11f33..12265bbd0a 100644 --- a/.github/workflows/ci-org-generalized.yml +++ b/.github/workflows/ci-org-generalized.yml @@ -203,182 +203,52 @@ jobs: # Build and Install asmoses - name: Build and Install asmoses run: | - # Preserve local MOSES header modifications and perform safe update + # Build local asmoses component (part of opencog-central monorepo) COMPONENT="asmoses" - REPO_URL="https://github.com/opencog/asmoses.git" - echo "=== Processing $COMPONENT with local change preservation ===" + echo "=== Building local $COMPONENT component ===" if [ -d "$COMPONENT" ]; then - echo "Existing $COMPONENT directory found, checking for local modifications..." - cd "$COMPONENT" + echo "Local $COMPONENT directory found, building..." - # Check if this is a git repository - if [ -d ".git" ]; then - echo "Git repository detected, checking status..." - - # Check for uncommitted changes - if ! git diff-index --quiet HEAD --; then - echo "Local modifications detected! Backing up changes..." - - # Create a backup of modified files - BACKUP_DIR="../${COMPONENT}_backup_$(date +%s)" - mkdir -p "$BACKUP_DIR" - - # Backup all modified files (tracked and untracked) - git diff-index --name-only HEAD -- | while read -r file; do - echo "Backing up modified file: $file" - mkdir -p "$BACKUP_DIR/$(dirname "$file")" 2>/dev/null || true - cp "$file" "$BACKUP_DIR/$file" 2>/dev/null || true - done - - # Also backup untracked files that might be headers - git ls-files --others --exclude-standard | grep -E '\.(h|hpp|hxx)$' | while read -r file; do - echo "Backing up untracked header: $file" - mkdir -p "$BACKUP_DIR/$(dirname "$file")" 2>/dev/null || true - cp "$file" "$BACKUP_DIR/$file" 2>/dev/null || true - done - - echo "Changes backed up to: $BACKUP_DIR" - - # Stash changes for potential reapplication - git add -A - git stash push -m "CI backup: local modifications before update" - echo "Changes stashed successfully" - else - echo "No local modifications detected" - fi - - # Perform safe git update - echo "Performing safe git update..." - git fetch origin - git reset --hard origin/main || git reset --hard origin/master - - # Attempt to reapply stashed changes if they exist - if git stash list | grep -q "CI backup:"; then - echo "Attempting to reapply local modifications..." - if git stash pop; then - echo "Local modifications successfully reapplied" - else - echo "WARNING: Could not automatically reapply changes. Manual merge may be needed." - echo "Backup available at: $BACKUP_DIR" - fi - fi - else - echo "Not a git repository, using fallback method..." - cd .. - # Create backup then clean clone - BACKUP_DIR="${COMPONENT}_backup_$(date +%s)" - cp -r "$COMPONENT" "$BACKUP_DIR" - echo "Full backup created at: $BACKUP_DIR" - rm -rf "$COMPONENT" - git clone "$REPO_URL" - fi - cd .. + # Build the component + echo "Building $COMPONENT..." + mkdir -p "$COMPONENT/build" + cd "$COMPONENT/build" + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 + sudo make install + sudo ldconfig + cd ../.. else - echo "No existing $COMPONENT directory, performing fresh clone..." - git clone "$REPO_URL" + echo "ERROR: Local $COMPONENT directory not found!" + exit 1 fi - - # Build the component - echo "Building $COMPONENT..." - mkdir -p "$COMPONENT/build" - cd "$COMPONENT/build" - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j2 - sudo make install - sudo ldconfig - cd ../.. # Build and Install moses - name: Build and Install moses run: | - # Preserve local MOSES header modifications and perform safe update + # Build local moses component (part of opencog-central monorepo) COMPONENT="moses" - REPO_URL="https://github.com/opencog/moses.git" - echo "=== Processing $COMPONENT with local change preservation ===" + echo "=== Building local $COMPONENT component ===" if [ -d "$COMPONENT" ]; then - echo "Existing $COMPONENT directory found, checking for local modifications..." - cd "$COMPONENT" + echo "Local $COMPONENT directory found, building..." - # Check if this is a git repository - if [ -d ".git" ]; then - echo "Git repository detected, checking status..." - - # Check for uncommitted changes - if ! git diff-index --quiet HEAD --; then - echo "Local modifications detected! Backing up changes..." - - # Create a backup of modified files - BACKUP_DIR="../${COMPONENT}_backup_$(date +%s)" - mkdir -p "$BACKUP_DIR" - - # Backup all modified files (tracked and untracked) - git diff-index --name-only HEAD -- | while read -r file; do - echo "Backing up modified file: $file" - mkdir -p "$BACKUP_DIR/$(dirname "$file")" 2>/dev/null || true - cp "$file" "$BACKUP_DIR/$file" 2>/dev/null || true - done - - # Also backup untracked files that might be headers - git ls-files --others --exclude-standard | grep -E '\.(h|hpp|hxx)$' | while read -r file; do - echo "Backing up untracked header: $file" - mkdir -p "$BACKUP_DIR/$(dirname "$file")" 2>/dev/null || true - cp "$file" "$BACKUP_DIR/$file" 2>/dev/null || true - done - - echo "Changes backed up to: $BACKUP_DIR" - - # Stash changes for potential reapplication - git add -A - git stash push -m "CI backup: local modifications before update" - echo "Changes stashed successfully" - else - echo "No local modifications detected" - fi - - # Perform safe git update - echo "Performing safe git update..." - git fetch origin - git reset --hard origin/main || git reset --hard origin/master - - # Attempt to reapply stashed changes if they exist - if git stash list | grep -q "CI backup:"; then - echo "Attempting to reapply local modifications..." - if git stash pop; then - echo "Local modifications successfully reapplied" - else - echo "WARNING: Could not automatically reapply changes. Manual merge may be needed." - echo "Backup available at: $BACKUP_DIR" - fi - fi - else - echo "Not a git repository, using fallback method..." - cd .. - # Create backup then clean clone - BACKUP_DIR="${COMPONENT}_backup_$(date +%s)" - cp -r "$COMPONENT" "$BACKUP_DIR" - echo "Full backup created at: $BACKUP_DIR" - rm -rf "$COMPONENT" - git clone "$REPO_URL" - fi - cd .. + # Build the component + echo "Building $COMPONENT..." + mkdir -p "$COMPONENT/build" + cd "$COMPONENT/build" + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 + sudo make install + sudo ldconfig + cd ../.. else - echo "No existing $COMPONENT directory, performing fresh clone..." - git clone "$REPO_URL" + echo "ERROR: Local $COMPONENT directory not found!" + exit 1 fi - - # Build the component - echo "Building $COMPONENT..." - mkdir -p "$COMPONENT/build" - cd "$COMPONENT/build" - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j2 - sudo make install - sudo ldconfig - cd ../.. # Build and Install opencog - name: Build and Install opencog From f1a6442c344531240b8443f35d671f600bc655b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 27 Jul 2025 00:41:01 +0000 Subject: [PATCH 3/3] Fix asmoses & moses builds in ci-org-v7 and ci-org-v8 workflows as well Co-authored-by: drzo <15202748+drzo@users.noreply.github.com> --- .github/workflows/ci-org-v7.yml | 32 +++++++++++------ .github/workflows/ci-org-v8.yml | 64 +++++++++++++++++++++------------ 2 files changed, 63 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci-org-v7.yml b/.github/workflows/ci-org-v7.yml index f094b20a93..85f97dad92 100644 --- a/.github/workflows/ci-org-v7.yml +++ b/.github/workflows/ci-org-v7.yml @@ -112,17 +112,27 @@ jobs: # 7. Build and Install AsmoSES - name: Build and Install AsmoSES run: | - # Clean existing directory - rm -rf asmoses - # Clone the repository - git clone https://github.com/opencog/asmoses.git - mkdir -p asmoses/build - cd asmoses/build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j2 - sudo make install - sudo ldconfig - cd ../.. + # Build local asmoses component (part of opencog-central monorepo) + COMPONENT="asmoses" + + echo "=== Building local $COMPONENT component ===" + + if [ -d "$COMPONENT" ]; then + echo "Local $COMPONENT directory found, building..." + + # Build the component + echo "Building $COMPONENT..." + mkdir -p "$COMPONENT/build" + cd "$COMPONENT/build" + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 + sudo make install + sudo ldconfig + cd ../.. + else + echo "ERROR: Local $COMPONENT directory not found!" + exit 1 + fi # 8. Build and Install URE - name: Build and Install URE diff --git a/.github/workflows/ci-org-v8.yml b/.github/workflows/ci-org-v8.yml index b6465f7641..42851d2daa 100644 --- a/.github/workflows/ci-org-v8.yml +++ b/.github/workflows/ci-org-v8.yml @@ -97,32 +97,52 @@ jobs: # 6. Build and Install MoSES - name: Build and Install MoSES run: | - # Clean existing directory - rm -rf moses - # Clone the repository - git clone https://github.com/opencog/moses.git - mkdir -p moses/build - cd moses/build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j2 - sudo make install - sudo ldconfig - cd ../.. + # Build local moses component (part of opencog-central monorepo) + COMPONENT="moses" + + echo "=== Building local $COMPONENT component ===" + + if [ -d "$COMPONENT" ]; then + echo "Local $COMPONENT directory found, building..." + + # Build the component + echo "Building $COMPONENT..." + mkdir -p "$COMPONENT/build" + cd "$COMPONENT/build" + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 + sudo make install + sudo ldconfig + cd ../.. + else + echo "ERROR: Local $COMPONENT directory not found!" + exit 1 + fi # 7. Build and Install AsmoSES - name: Build and Install AsmoSES run: | - # Clean existing directory - rm -rf asmoses - # Clone the repository - git clone https://github.com/opencog/asmoses.git - mkdir -p asmoses/build - cd asmoses/build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j2 - sudo make install - sudo ldconfig - cd ../.. + # Build local asmoses component (part of opencog-central monorepo) + COMPONENT="asmoses" + + echo "=== Building local $COMPONENT component ===" + + if [ -d "$COMPONENT" ]; then + echo "Local $COMPONENT directory found, building..." + + # Build the component + echo "Building $COMPONENT..." + mkdir -p "$COMPONENT/build" + cd "$COMPONENT/build" + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 + sudo make install + sudo ldconfig + cd ../.. + else + echo "ERROR: Local $COMPONENT directory not found!" + exit 1 + fi # 9. Build and Install Unify - name: Build and Install Unify