Skip to content

ci: ensure Autotools configure is generated in C/C++ CI#1

Merged
FuzzysTodd merged 2 commits intomainfrom
copilot/fix-ci-autotools
Nov 11, 2025
Merged

ci: ensure Autotools configure is generated in C/C++ CI#1
FuzzysTodd merged 2 commits intomainfrom
copilot/fix-ci-autotools

Conversation

Copy link

Copilot AI commented Nov 6, 2025

The C/C++ CI workflow fails on branches without a pre-generated configure script (job 54655044154 at cd8c4b6). Many Autotools-based projects only commit configure.ac and generate configure during build.

Changes

  • Replace hardcoded ./configure step with conditional Autotools preparation that:

    • Runs existing configure if present
    • Falls back to autogen.sh if available
    • Falls back to autoreconf -i (installing autoconf/automake/libtool/pkg-config) if configure.ac or configure.in exists
    • Fails with diagnostic output if no Autotools entrypoint found
  • Preserve all existing make / make check / make distcheck steps unchanged

- name: Prepare build (Autotools)
  run: |
    set -e
    if [ -f configure ]; then
      ./configure
    elif [ -f autogen.sh ]; then
      ./autogen.sh
    elif [ -f configure.ac ] || [ -f configure.in ]; then
      sudo apt-get update && sudo apt-get install -y autoconf automake libtool pkg-config build-essential
      autoreconf -i && ./configure
    else
      echo "No Autotools entrypoint found" >&2 && ls -la && exit 1
    fi

Note: This enforces Autotools. If the project uses CMake or another build system, the workflow requires further updates.

Original prompt

The repository's C/C++ CI workflow currently runs ./configure directly but many branches do not include a pre-generated configure script, causing the job to fail with: "./configure: No such file or directory" (see job 54655044154 logs). The workflow file that ran is .github/workflows/c-cpp.yml (ref: cd8c4b6).

Goal: Update the workflow to reliably build Autotools-based projects by generating configure when needed (autoreconf/autogen.sh) and installing required tools. Keep existing make / make check / make distcheck steps.

Required changes to implement in a new branch (suggested branch name: fix/ci-autotools):

  1. Update .github/workflows/c-cpp.yml to replace the existing configure step (which runs "./configure") with a Prepare build (Autotools) step that:
    • Detects whether configure exists and runs it if present.
    • If autogen.sh exists, runs it.
    • If configure.ac or configure.in exists, installs necessary packages and runs autoreconf -i, then runs ./configure.
    • Prints the repository root listing and fails with a helpful message if no supported Autotools entrypoint is found.

Use the following shell snippet for the step content (preserve set -e so the job fails on error):

  • name: Prepare build (Autotools)
    run: |
    set -e
    if [ -f configure ]; then
    echo "Running ./configure"
    chmod +x configure
    ./configure
    elif [ -f autogen.sh ]; then
    echo "Running ./autogen.sh"
    chmod +x autogen.sh
    ./autogen.sh
    elif [ -f configure.ac ] || [ -f configure.in ]; then
    echo "Running autoreconf -i"
    sudo apt-get update
    sudo apt-get install -y autoconf automake libtool pkg-config build-essential
    autoreconf -i
    chmod +x configure
    ./configure
    else
    echo "No Autotools entrypoint found (configure, autogen.sh, or configure.ac)." >&2
    echo "Repository root listing:";
    ls -la
    exit 1
    fi
  1. Ensure the subsequent make / make check / make distcheck steps remain and execute in the repository root (no change required unless the project uses an out-of-tree build; this patch assumes in-tree build).

  2. Commit message: "ci: make C/C++ workflow generate configure via Autotools when needed"
    Pull request title: "ci: ensure Autotools configure is generated in C/C++ CI"
    Branch: fix/ci-autotools

Notes for reviewers:

  • This change enforces Autotools usage. If the repository actually uses CMake or another build system, update the workflow accordingly.
  • If the project requires extra libraries or dependencies for configure/make, add them to the install list in the step.
  • The job ref shown in the failing run is: cd8c4b6; this PR modifies the workflow file at .github/workflows/c-cpp.yml referenced by that run.

Please create a branch from main, apply the change to .github/workflows/c-cpp.yml, and open a pull request with the description above.

This pull request was created as a result of the following prompt from Copilot chat.

The repository's C/C++ CI workflow currently runs ./configure directly but many branches do not include a pre-generated configure script, causing the job to fail with: "./configure: No such file or directory" (see job 54655044154 logs). The workflow file that ran is .github/workflows/c-cpp.yml (ref: cd8c4b6).

Goal: Update the workflow to reliably build Autotools-based projects by generating configure when needed (autoreconf/autogen.sh) and installing required tools. Keep existing make / make check / make distcheck steps.

Required changes to implement in a new branch (suggested branch name: fix/ci-autotools):

  1. Update .github/workflows/c-cpp.yml to replace the existing configure step (which runs "./configure") with a Prepare build (Autotools) step that:
    • Detects whether configure exists and runs it if present.
    • If autogen.sh exists, runs it.
    • If configure.ac or configure.in exists, installs necessary packages and runs autoreconf -i, then runs ./configure.
    • Prints the repository root listing and fails with a helpful message if no supported Autotools entrypoint is found.

Use the following shell snippet for the step content (preserve set -e so the job fails on error):

  • name: Prepare build (Autotools)
    run: |
    set -e
    if [ -f configure ]; then
    echo "Running ./configure"
    chmod +x configure
    ./configure
    elif [ -f autogen.sh ]; then
    echo "Running ./autogen.sh"
    chmod +x autogen.sh
    ./autogen.sh
    elif [ -f configure.ac ] || [ -f configure.in ]; then
    echo "Running autoreconf -i"
    sudo apt-get update
    sudo apt-get install -y autoconf automake libtool pkg-config build-essential
    autoreconf -i
    chmod +x configure
    ./configure
    else
    echo "No Autotools entrypoint found (configure, autogen.sh, or configure.ac)." >&2
    echo "Repository root listing:";
    ls -la
    exit 1
    fi
  1. Ensure the subsequent make / make check / make distcheck steps remain and execute in the repository root (no change required unless the project uses an out-of-tree build; this patch assumes in-tree build).

  2. Commit message: "ci: make C/C++ workflow generate configure via Autotools when needed"
    Pull request title: "ci: ensure Autotools configure is generated in C/C++ CI"
    Branch: fix/ci-autotools

Notes for reviewers:

  • This change enforces Autotools usage. If the repository actually uses CMake or another build system, update the workflow accordingly.
  • If the project requires extra libraries or dependencies for configure/make, add them to the install list in the step.
  • The job ref shown in the failing run is: cd8c4b6; this PR modifies the workflow file at .github/workflows/c-cpp.yml referenced by that run.

Please create a branch from main, apply the change to .github/workflows/c-cpp.yml, and open a pull request with the description above.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: FuzzysTodd <157565446+FuzzysTodd@users.noreply.github.com>
Copilot AI changed the title [WIP] Update CI workflow to build Autotools projects ci: ensure Autotools configure is generated in C/C++ CI Nov 6, 2025
Copilot AI requested a review from FuzzysTodd November 6, 2025 15:10
@FuzzysTodd FuzzysTodd marked this pull request as ready for review November 11, 2025 02:44
@FuzzysTodd FuzzysTodd merged commit 8d56f54 into main Nov 11, 2025
6 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants