From abf9ce68918bfcb412d963914fcd4235a0131264 Mon Sep 17 00:00:00 2001 From: mfolina Date: Thu, 19 Mar 2026 11:26:23 +0100 Subject: [PATCH 1/2] fix: update architecture case glob patterns and echo printouts --- clang.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/clang.sh b/clang.sh index fc28e36..72e9f54 100644 --- a/clang.sh +++ b/clang.sh @@ -24,16 +24,17 @@ unset CXXFLAGS unset CFLAGS unset LDFLAGS -case $ARCHITECTURE in +case "$ARCHITECTURE" in # Needed to have the C headers osx_*) DEFAULT_SYSROOT=$(xcrun --show-sdk-path) ;; *) DEFAULT_SYSROOT= ;; esac -case $ARCHITECTURE in - *_x86-64) LLVM_TARGETS_TO_BUILD=X86 ;; - *_arm64) LLVM_TARGETS_TO_BUILD=AArch64 ;; - *_aarch64) LLVM_TARGETS_TO_BUILD=AArch64 ;; - *) echo 'Unknown LLVM target for architecture' >&2; exit 1 ;; +case "$ARCHITECTURE" in + *x86-64*) LLVM_TARGETS_TO_BUILD=X86 ;; + *x86_64*) LLVM_TARGETS_TO_BUILD=X86 ;; + *arm64*) LLVM_TARGETS_TO_BUILD=AArch64 ;; + *aarch64*) LLVM_TARGETS_TO_BUILD=AArch64 ;; + *) echo "Unknown LLVM target for architecture $ARCHITECTURE" >&2; exit 1 ;; esac # BUILD_SHARED_LIBS=ON is needed for e.g. adding dynamic plugins to clang-tidy. From 5174f7ded495020c65a9120818e1d7e5fc9f5cb4 Mon Sep 17 00:00:00 2001 From: Maria Theodora Folina <139060140+m-fol@users.noreply.github.com> Date: Thu, 19 Mar 2026 16:24:21 +0100 Subject: [PATCH 2/2] CI: workflow dispatch --- .github/workflows/recipe-checks.yml | 76 +++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/recipe-checks.yml diff --git a/.github/workflows/recipe-checks.yml b/.github/workflows/recipe-checks.yml new file mode 100644 index 0000000..7639e2a --- /dev/null +++ b/.github/workflows/recipe-checks.yml @@ -0,0 +1,76 @@ +--- +# GitHub workflow to check pull requests and commits for pitfalls and formatting +# mistakes in build recipes. +name: Check recipes + +'on': + workflow_dispatch: + push: + paths: + - '*.sh' + pull_request: + paths: + - '*.sh' + +permissions: {} + +jobs: + lint: + name: alidistlint + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: python3 -m pip install -U --user 'alidistlint[git]' + + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Run linter + run: | + if [ -n "$BASE_SHA" ]; then + # For pull requests, only check files that have changed relative to + # the base commit. + merge_base=$(git merge-base "$BASE_SHA" "$HEAD_SHA") + git diff -z --diff-filter d --name-only "$merge_base..$HEAD_SHA" -- '*.sh' | + xargs -0tr alidistlint -f github --changes "$merge_base..$HEAD_SHA" + else + # On push, check every file, ignoring warnings and notes. + alidistlint -ef github ./*.sh + fi + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.sha }} + + circular: + name: circular dependencies + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: | + sudo apt update -y + sudo apt install -y graphviz + python3 -m pip install -U --user alibuild + aliBuild analytics off + - uses: actions/checkout@v6 + + - name: Run check + run: | + for fname in *.sh; do + case "$fname" in + jalien*) default=jalien ;; + *) default=o2 ;; + esac + echo "Checking $fname with --defaults $default" + if aliBuild deps --defaults "$default" --outgraph /dev/null --no-system --neat -c . \ + "$(awk '/^package: /{print $2}' "$fname")" 2>&1 | + grep -q 'transitive reduction not unique' + then + echo -n "::error title=circular dependency,file=$fname,line=1" + echo '::recipe has circular dependency' + err=1 + fi + done + exit "${err:-0}"