Skip to content
Closed
Show file tree
Hide file tree
Changes from 151 commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
b60f27c
feat: Add Homebrew and Spack package definitions
sbryngelson Nov 4, 2025
007e05e
chore: Remove Spack files (Homebrew-only branch)
sbryngelson Nov 4, 2025
95097c9
docs: Consolidate Homebrew documentation into single file
sbryngelson Nov 4, 2025
edfc8fe
chore: Remove non-Homebrew documentation files
sbryngelson Nov 4, 2025
c1b5453
chore: Remove README/CITATION changes and issue templates
sbryngelson Nov 4, 2025
e34711d
refactor: Move Homebrew files to packaging/homebrew/ directory
sbryngelson Nov 4, 2025
6ee36b7
docs: Update README to match latest upstream version
sbryngelson Nov 4, 2025
33e9645
docs: Update README and CITATION.cff, add issue templates (#1022)
sbryngelson Nov 4, 2025
7d21ed3
fix: Address PR review feedback for Homebrew formula
sbryngelson Nov 4, 2025
35b4469
refactor: Implement all PR review suggestions for Homebrew formula
sbryngelson Nov 4, 2025
bd9f51e
fix: Address Copilot PR review comments
sbryngelson Nov 4, 2025
dd0b8c4
fix up
sbryngelson Nov 4, 2025
07ee05e
docs: Address final Copilot review suggestions
sbryngelson Nov 4, 2025
29a928d
fix: Implement qodo-merge-pro safety improvements
sbryngelson Nov 4, 2025
d1d1c67
ci: Add Homebrew formula testing workflow
sbryngelson Nov 4, 2025
b2e034e
fix: Address all Homebrew style violations
sbryngelson Nov 4, 2025
86a4c89
fix
sbryngelson Nov 4, 2025
79924a4
fix?
sbryngelson Nov 4, 2025
b7c580c
fix
sbryngelson Nov 4, 2025
919a800
Fix Homebrew CI: use local tap for formula installation
sbryngelson Nov 4, 2025
9fd8391
Restore bug_report.md from master branch
sbryngelson Nov 4, 2025
d176487
Fix Homebrew formula: handle hashed installation directory
sbryngelson Nov 4, 2025
5f5ced5
Fix: Find each binary individually in separate hashed directories
sbryngelson Nov 4, 2025
d372e63
Simplify Homebrew formula to install binaries only
sbryngelson Nov 4, 2025
3c5d327
push
sbryngelson Nov 4, 2025
161d41d
Fix test: Don't run binaries with -h flag
sbryngelson Nov 4, 2025
52de223
Fix Homebrew style: Use assert_path_exists instead of assert_predicat…
sbryngelson Nov 4, 2025
1d3bc21
Install full MFC toolchain with smart wrapper for read-only Cellar
sbryngelson Nov 4, 2025
3b8c950
Fix formula test: Don't trigger Python venv setup
sbryngelson Nov 4, 2025
46e325a
Add Cantera dependency and pre-install Python venv
sbryngelson Nov 4, 2025
a38350f
Build Cantera 3.1.0 from source instead of PyPI
sbryngelson Nov 4, 2025
272340a
Complete Cantera 3.1.0 source build implementation
sbryngelson Nov 4, 2025
9b8db76
Fix trailing whitespace errors in Homebrew formula
sbryngelson Nov 4, 2025
5a48e36
Fix Cantera resource: remove incorrect revision hash
sbryngelson Nov 4, 2025
5d7ef61
Fix unnecessary spacing in Cantera resource definition
sbryngelson Nov 4, 2025
b8a2940
Fix: Build Cantera before MFC to avoid PyPI dependency error
sbryngelson Nov 4, 2025
9a45f65
Fix Homebrew style: Use ENV.fetch instead of ENV[]
sbryngelson Nov 4, 2025
4e5cc79
Add packaging module to Cantera build dependencies
sbryngelson Nov 4, 2025
1cd2cc3
Fix: Run scons via venv Python to find packaging module
sbryngelson Nov 4, 2025
5d2eb66
Remove scons from Homebrew dependencies
sbryngelson Nov 4, 2025
e2c249c
Fix Cantera build: Pass compiler and SDK paths to scons
sbryngelson Nov 5, 2025
4edc60f
Fix: Pass compiler flags as environment variables, not scons args
sbryngelson Nov 5, 2025
55ca2b0
Fix hash alignment for Homebrew style check
sbryngelson Nov 5, 2025
f9d3409
Add verbose logging and artifacts to Homebrew CI
sbryngelson Nov 5, 2025
24452d4
Fix brew test version check by committing formula to tap
sbryngelson Nov 5, 2025
26df743
Fix: Modify ENV directly instead of passing hash to system
sbryngelson Nov 5, 2025
dd0ba7c
Replace brew test with direct test commands
sbryngelson Nov 5, 2025
3a4ce68
Pass compiler flags directly to scons as build arguments
sbryngelson Nov 5, 2025
301ea0b
Fix trailing whitespace on line 45
sbryngelson Nov 5, 2025
f3643b9
Fix test: use formula-specific prefix for libexec check
sbryngelson Nov 5, 2025
ef4aba5
Fix Cantera build: Set ENV vars and explicit compilers for scons
sbryngelson Nov 5, 2025
7dc3c9a
Fix trailing whitespace on lines 44 and 51
sbryngelson Nov 5, 2025
09fe44e
Fix TypeError: Set SDKROOT in ENV instead of passing hash to system
sbryngelson Nov 5, 2025
19fe2d9
Add SDK C++ include path to scons extra_inc_dirs
sbryngelson Nov 5, 2025
b1c75bb
Pass compiler flags as scons variables for configure checks
sbryngelson Nov 5, 2025
1612552
Fix RuboCop: Use ENV.fetch instead of ENV[] for compiler flags
sbryngelson Nov 5, 2025
3973747
Fix Cantera scons: Use cc_flags/cxx_flags instead of CCFLAGS/CXXFLAGS
sbryngelson Nov 5, 2025
d4dcaaa
Add C++ include path directly to cxx_flags for scons checks
sbryngelson Nov 5, 2025
23949ef
Add SDK main include path to compiler flags for C header access
sbryngelson Nov 5, 2025
0385aa8
Add Cantera config.log capture to CI for debugging
sbryngelson Nov 5, 2025
00f8295
Fix CI: Add pipefail to catch brew install failures
sbryngelson Nov 5, 2025
7f34c7e
Add config.log output on Cantera build failure
sbryngelson Nov 5, 2025
abe825a
Fix RuboCop style: remove trailing whitespace and shorten long line
sbryngelson Nov 5, 2025
4bffab5
Improve config.log capture: search recursively and list directory con…
sbryngelson Nov 5, 2025
bd376b4
Fix RuboCop: remove trailing whitespace on lines 87 and 99
sbryngelson Nov 5, 2025
f4fa72e
Enhance debug output: use opoo, check multiple config.log locations, …
sbryngelson Nov 5, 2025
b8c2463
Remove Cantera from formula - make it an optional user-installed depe…
sbryngelson Nov 5, 2025
06edb9b
Install Cantera from PyPI instead of building from source
sbryngelson Nov 5, 2025
9e21f25
Fix RuboCop: use assert_path_exists instead of assert_predicate with …
sbryngelson Nov 5, 2025
5ee24d4
Fix mfc.sh build: ensure we're in buildpath directory
sbryngelson Nov 5, 2025
62393d1
Add debug output to diagnose mfc.sh directory issue
sbryngelson Nov 5, 2025
69427d9
Fix trailing whitespace in formula
sbryngelson Nov 5, 2025
b9d4148
Fix mfc.sh build: keep toolchain in buildpath during build
sbryngelson Nov 5, 2025
96fe6d4
Fix mfc wrapper script: add toolchain symlink and build directory
sbryngelson Nov 6, 2025
5c9bbb7
Fix Homebrew formula: copy directories instead of symlinking to avoid…
sbryngelson Nov 6, 2025
9163b77
Fix Homebrew formula: ensure fresh venv on each install
sbryngelson Nov 6, 2025
ed9c328
Fix CI: handle Homebrew dylib fixup warnings gracefully
sbryngelson Nov 6, 2025
0d472e7
Fix CI: remove invalid mfc count test
sbryngelson Nov 6, 2025
5a7a31a
Fix CI: use absolute path for test case file
sbryngelson Nov 6, 2025
8de2268
Remove 'mfc run' test from CI and clarify Homebrew limitations
sbryngelson Nov 6, 2025
bc7175f
Enable 'mfc run' by patching toolchain to use Homebrew binaries
sbryngelson Nov 6, 2025
c56cd92
Fix mfc run: patch toolchain to skip building and use Homebrew binaries
sbryngelson Nov 6, 2025
cae22fd
Fix wrapper script creation and permissions
sbryngelson Nov 6, 2025
09c8bf2
Fix executable permissions with post_install hook
sbryngelson Nov 6, 2025
385061a
Fix CI: use absolute path for case.py in mfc run test
sbryngelson Nov 6, 2025
692519f
docs
sbryngelson Nov 6, 2025
1408aec
docs
sbryngelson Nov 6, 2025
5b85475
cleanup
sbryngelson Nov 6, 2025
ef66c9a
harden
sbryngelson Nov 6, 2025
d3b1a93
quick start
sbryngelson Nov 6, 2025
e75b7ff
deploy to repo
sbryngelson Nov 6, 2025
415ad05
push
sbryngelson Nov 6, 2025
8a75271
remove test
sbryngelson Nov 6, 2025
d1381c8
improve and deploy
sbryngelson Nov 7, 2025
3efb9d6
ci(homebrew): merge duplicate push blocks in deploy-tap.yml
sbryngelson Nov 7, 2025
845c68b
minor trigger
sbryngelson Nov 7, 2025
a7572e2
ci(homebrew): fix brew audit to use formula name instead of path
sbryngelson Nov 7, 2025
2308b9a
bump to trigger
sbryngelson Nov 7, 2025
3be3e15
fix(homebrew): use rm_r instead of rm_rf per brew audit
sbryngelson Nov 7, 2025
1a32884
minor
sbryngelson Nov 7, 2025
6b5bd9f
fix(homebrew): only install executable files to bin
sbryngelson Nov 7, 2025
5da2c3a
style(homebrew): fix rubocop guard clause style
sbryngelson Nov 7, 2025
8215624
fix(homebrew): move venv to var/ to avoid dylib fixups and harden bin…
sbryngelson Nov 7, 2025
3ff41d1
style(homebrew): fix heredoc indentation for rubocop
sbryngelson Nov 7, 2025
72304d5
fix(ci): update venv path check in homebrew.yml workflow
sbryngelson Nov 7, 2025
43bfb7b
feat(ci): add smoke tests before expensive Homebrew installation
sbryngelson Nov 7, 2025
1bb2226
minor
sbryngelson Nov 7, 2025
315c4fd
fix(ci): configure git identity for brew tap-new in smoke tests
sbryngelson Nov 7, 2025
f7e6aea
fix(homebrew): correct Python indentation in build.py patch
sbryngelson Nov 7, 2025
81e30ff
fix
sbryngelson Nov 7, 2025
bb096d7
trigger
sbryngelson Nov 8, 2025
efb6c53
try again deploy
sbryngelson Nov 8, 2025
93f8c3b
fix
sbryngelson Nov 8, 2025
2db4c31
fixup
sbryngelson Nov 8, 2025
59f196b
add test
sbryngelson Nov 8, 2025
0aab6ca
fix
sbryngelson Nov 8, 2025
66e2093
fix?
sbryngelson Nov 8, 2025
323e3bf
Fix homebrew.yml: Update venv path from var/mfc/venv to libexec/venv
sbryngelson Nov 8, 2025
11a4e98
Fix lock.yaml write error by redirecting MFC paths to temp directory
sbryngelson Nov 8, 2025
c3b0c1d
Use sitecustomize.py for early MFC path patching
sbryngelson Nov 8, 2025
95f2109
Fix Homebrew formula: disable bottles to avoid relocation errors
sbryngelson Nov 8, 2025
ede409c
Fix Homebrew formula to enable proper bottle creation
sbryngelson Nov 8, 2025
dcc6031
Fix Cantera build issue: use pre-built wheel for Cantera, compile MFC…
sbryngelson Nov 8, 2025
addcd87
Simplify MFC deps install: let pip choose wheels vs source builds
sbryngelson Nov 8, 2025
25a39df
Fix orjson dylib relocation by forcing source compilation
sbryngelson Nov 8, 2025
9d4e299
Use bottle :unneeded to skip bottling for Python venv
sbryngelson Nov 8, 2025
e3a7f3c
Remove deprecated 'bottle :unneeded' causing wrong-arity error in bre…
sbryngelson Nov 8, 2025
2b2b749
Add Rust dependency and rebuild orjson with headerpad for bottle relo…
sbryngelson Nov 8, 2025
cf453b9
Move mfc wrapper to libexec and use write_exec_script for audit compl…
sbryngelson Nov 8, 2025
f5f9abb
Remove Rust dependency and orjson source rebuild - not needed with li…
sbryngelson Nov 8, 2025
b1e3ac5
Add skip_clean for libexec/venv to prevent orjson dylib relocation er…
sbryngelson Nov 8, 2025
c73b091
Improve Homebrew wrapper UX: add help, block unsupported commands, fi…
sbryngelson Nov 9, 2025
9ade107
Add Homebrew installation and usage documentation
sbryngelson Nov 9, 2025
6970bce
cleanup
sbryngelson Nov 9, 2025
61adc7e
Add README for Homebrew tap and auto-deploy it
sbryngelson Nov 9, 2025
1e78657
tap
sbryngelson Nov 9, 2025
cb29fc5
minor diff
sbryngelson Nov 9, 2025
7c7543f
Add smart case file detection to mfc wrapper
sbryngelson Nov 11, 2025
4041006
Merge upstream/master into homebrew-formula
sbryngelson Nov 11, 2025
346c413
Fix RuboCop style error: remove redundant escape in regex
sbryngelson Nov 11, 2025
ec24979
Update CI to test shorthand mfc syntax
sbryngelson Nov 11, 2025
3e4ba96
Merge upstream/master into homebrew-formula
sbryngelson Nov 12, 2025
a6d2641
Address PR #1038 feedback: standardize Homebrew command syntax
sbryngelson Nov 12, 2025
5fecd1b
Simplify Homebrew wrapper: remove redundant 'mfc run' syntax
sbryngelson Nov 12, 2025
76ac76e
Add error handling for 'mfc run' syntax
sbryngelson Nov 12, 2025
41706e1
Improve wrapper validation and error messages
sbryngelson Nov 12, 2025
58ba949
Fix RuboCop style error: remove redundant escape in regex
sbryngelson Nov 12, 2025
f125de6
Update packaging/homebrew/mfc.rb
sbryngelson Nov 12, 2025
4b5c016
Fix RuboCop error and improve validation logic
sbryngelson Nov 12, 2025
1a1865f
Fix 'run' detection to check first non-flag argument
sbryngelson Nov 12, 2025
8a5291e
fix ups for bottle
sbryngelson Nov 15, 2025
ecc17fa
tap fix
sbryngelson Nov 15, 2025
156410b
Merge upstream/master into homebrew-formula
sbryngelson Nov 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/deploy-tap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Deploy Homebrew Tap

on:
push:
branches: [ main, master, homebrew-formula ]
paths:
- 'packaging/homebrew/mfc.rb'
- 'packaging/homebrew/README.md'
Comment on lines 3 to 7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Limit deploy workflow to protected branches

The deploy-tap workflow no longer restricts which branches can trigger it—on.push now runs for any branch that happens to modify packaging/homebrew/**. Because the job always ends by committing and pushing the formula to MFlowCode/homebrew-mfc using the PAT, any contributor pushing a feature branch (or even a draft PR) will now publish their unreviewed formula straight to the public tap. Previously this workflow ran only after changes landed on main/master/homebrew-formula, guaranteeing review before publishing. Please reinstate a branch filter (or otherwise guard the job) so that only vetted branches can trigger the tap sync.

Useful? React with 👍 / 👎.

Comment on lines 3 to 7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Tag releases never trigger deploy workflow

A new tag-specific path was added (if: github.ref_type == 'tag'), but the workflow still declares a paths: filter under on.push. GitHub only evaluates the paths filter against files changed in the pushed commits, and tag pushes do not carry any file changes, so the workflow will never trigger for refs/tags/v*.*.*. As a result the “Update formula (for tag events)” step and the subsequent tap sync never run when creating a release tag, breaking the intended automation. Remove the paths restriction for tag events (or split them into a separate trigger) so that release tags actually invoke this workflow.

Useful? React with 👍 / 👎.

Expand All @@ -20,6 +19,7 @@ jobs:
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout MFC repository
uses: actions/checkout@v4
Expand All @@ -38,9 +38,9 @@ jobs:
VERSION="$(echo "${URL}" | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+)\.tar\.gz/\1/')"
fi
SHASUM="$(curl -sL "${URL}" | shasum -a 256 | awk '{print $1}')"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "url=${URL}" >> $GITHUB_OUTPUT
echo "sha256=${SHASUM}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "url=${URL}" >> "$GITHUB_OUTPUT"
echo "sha256=${SHASUM}" >> "$GITHUB_OUTPUT"

- name: Update formula (for tag events)
if: github.ref_type == 'tag'
Expand Down Expand Up @@ -98,5 +98,4 @@ jobs:
fi
git -c user.name="github-actions[bot]" -c user.email="github-actions[bot]@users.noreply.github.com" \
commit -m "mfc: v${{ steps.meta.outputs.version }}"
git push origin HEAD:main

git push origin HEAD:main
283 changes: 42 additions & 241 deletions .github/workflows/homebrew.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High-level Suggestion

Reintroduce the brew audit step into the homebrew.yml CI workflow. This ensures the Homebrew formula is validated for correctness, style, and checksums, which was a quality check removed during simplification. [High-level, importance: 8]

Solution Walkthrough:

Before:

# .github/workflows/homebrew.yml
jobs:
  homebrew-mfc:
    runs-on: macos-latest
    steps:
      - name: Checkout repo
        ...
      - name: Set up Homebrew
        ...
      - name: Install MFC via Homebrew
        run: |
          brew install mflowcode/mfc/mfc || brew install --build-from-source mflowcode/mfc/mfc
      - name: Run MFC test case
        ...
      - name: Basic installation verification
        ...

After:

# .github/workflows/homebrew.yml
jobs:
  homebrew-mfc:
    runs-on: macos-latest
    steps:
      - name: Checkout repo
        ...
      - name: Set up Homebrew
        ...
      - name: Validate formula
        run: |
          brew audit --online packaging/homebrew/mfc.rb
      - name: Install MFC via Homebrew
        run: |
          brew install mflowcode/mfc/mfc || brew install --build-from-source mflowcode/mfc/mfc
      - name: Run MFC test case
        ...
      - name: Basic installation verification
        ...

Original file line number Diff line number Diff line change
@@ -1,264 +1,65 @@
name: Homebrew Formula Test
name: Homebrew

on:
push:
branches:
- master
- homebrew-formula
paths:
- 'packaging/homebrew/**'
- '.github/workflows/homebrew.yml'
pull_request:
branches:
- master
paths:
- 'packaging/homebrew/**'
- '.github/workflows/homebrew.yml'
workflow_dispatch:

jobs:
# Fast smoke tests that run before expensive operations
smoke-test:
name: Quick Formula Validation
runs-on: ubuntu-latest # Use Linux for speed (Homebrew works on Linux too)

homebrew-mfc:
name: Test Homebrew package (macOS)
runs-on: macos-latest

steps:
- name: Checkout repository
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Validate formula syntax with brew style
run: |
echo "Checking formula syntax..."
brew style packaging/homebrew/mfc.rb

- name: Run brew audit (without installation)
run: |
echo "Configuring git for brew tap-new..."
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

echo "Creating temporary local tap..."
brew tap-new mflowcode/test
cp packaging/homebrew/mfc.rb $(brew --repository)/Library/Taps/mflowcode/homebrew-test/Formula/mfc.rb

echo "Running brew audit (online checks)..."
brew audit --online --skip-style mflowcode/test/mfc || true

echo "Cleaning up tap..."
brew untap mflowcode/test

- name: Validate Ruby syntax
run: |
echo "Checking Ruby syntax..."
ruby -c packaging/homebrew/mfc.rb

- name: Check for common formula issues
run: |
echo "Checking for common issues..."

# Check that required fields are present
grep -q 'desc "' packaging/homebrew/mfc.rb || (echo "❌ Missing desc"; exit 1)
grep -q 'homepage "' packaging/homebrew/mfc.rb || (echo "❌ Missing homepage"; exit 1)
grep -q 'url "' packaging/homebrew/mfc.rb || (echo "❌ Missing url"; exit 1)
grep -q 'sha256 "' packaging/homebrew/mfc.rb || (echo "❌ Missing sha256"; exit 1)
grep -q 'license "' packaging/homebrew/mfc.rb || (echo "❌ Missing license"; exit 1)

# Check that install method exists
grep -q 'def install' packaging/homebrew/mfc.rb || (echo "❌ Missing install method"; exit 1)

# Check that test block exists
grep -q 'test do' packaging/homebrew/mfc.rb || (echo "❌ Missing test block"; exit 1)

echo "✅ All required formula components present"

- name: Verify URL is reachable
run: |
echo "Checking that source URL is reachable..."
URL=$(grep -E 'url "https://[^"]+' packaging/homebrew/mfc.rb | head -1 | sed 's/.*url "\([^"]*\)".*/\1/')

if [ -z "$URL" ]; then
echo "❌ Could not extract URL from formula"
exit 1
fi

echo "URL: $URL"
HTTP_CODE=$(curl -sI -w "%{http_code}" -o /dev/null "$URL")

if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "302" ]; then
echo "✅ URL is reachable (HTTP $HTTP_CODE)"
else
echo "⚠️ URL returned HTTP $HTTP_CODE (may indicate an issue)"
# Don't fail here - could be a temporary issue
fi

- name: Verify SHA256 checksum
run: |
echo "Verifying SHA256 checksum matches URL..."
URL=$(grep -E 'url "https://[^"]+' packaging/homebrew/mfc.rb | head -1 | sed 's/.*url "\([^"]*\)".*/\1/')
EXPECTED_SHA=$(grep 'sha256 "' packaging/homebrew/mfc.rb | head -1 | sed 's/.*sha256 "\([^"]*\)".*/\1/')

if [ -z "$URL" ] || [ -z "$EXPECTED_SHA" ]; then
echo "❌ Could not extract URL or SHA256 from formula"
exit 1
fi

echo "Downloading tarball to compute checksum..."
ACTUAL_SHA=$(curl -sL "$URL" | shasum -a 256 | awk '{print $1}')

echo "Expected SHA256: $EXPECTED_SHA"
echo "Actual SHA256: $ACTUAL_SHA"

if [ "$EXPECTED_SHA" = "$ACTUAL_SHA" ]; then
echo "✅ SHA256 checksum matches!"
else
echo "❌ SHA256 mismatch!"
exit 1
fi

# Full installation test (only runs if smoke tests pass)
test-formula:
name: Full Installation Test
needs: smoke-test # Only run after smoke tests pass
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Homebrew
run: |
echo "Homebrew version:"
brew --version
echo "Updating Homebrew..."
brew update

- name: Install formula dependencies
run: |
echo "Installing MFC dependencies..."
brew install cmake gcc [email protected] boost fftw hdf5 open-mpi openblas

- name: Install MFC from formula
run: |
echo "Creating temporary local tap..."
brew tap-new mflowcode/test

echo "Copying formula to tap..."
cp packaging/homebrew/mfc.rb $(brew --repository)/Library/Taps/mflowcode/homebrew-test/Formula/mfc.rb

echo "Installing MFC from local tap..."
# Note: brew may exit with code 1 due to dylib fixup warnings on some Python packages (non-fatal)
# We verify installation using brew commands rather than parsing log output
set +e # Don't fail immediately on error
brew install --build-from-source --verbose mflowcode/test/mfc 2>&1 | tee /tmp/brew-install.log
brew_exit_code=$?
set -e

# Verify installation using brew list (more robust than log parsing)
if brew list mflowcode/test/mfc &>/dev/null; then
echo "✅ MFC installed successfully (ignoring dylib relocation warnings)"
# Optionally verify with brew info
brew info mflowcode/test/mfc
exit 0
else
echo "❌ MFC installation failed"
exit $brew_exit_code
fi

- name: Display error logs on failure
if: failure()
- name: Install MFC via Homebrew
run: |
echo "=== Displaying last 200 lines of brew install log ==="
if [ -f /tmp/brew-install.log ]; then
tail -200 /tmp/brew-install.log
fi

echo -e "\n=== Displaying Homebrew log files ==="
if [ -d ~/Library/Logs/Homebrew/mfc/ ]; then
for logfile in ~/Library/Logs/Homebrew/mfc/*; do
if [ -f "$logfile" ]; then
echo -e "\n\n====== $logfile ======"
cat "$logfile"
fi
done
fi

echo -e "\n=== Searching for Cantera config.log ==="
cantera_config_log=$(find /private/tmp -name "config.log" -path "*/mfc--cantera*" 2>/dev/null | head -1)
if [ -n "$cantera_config_log" ] && [ -f "$cantera_config_log" ]; then
echo -e "\n\n====== Cantera config.log ======"
echo "Found at: $cantera_config_log"
cat "$cantera_config_log"
# Copy to a known location for artifact upload
mkdir -p /tmp/cantera-logs
cp "$cantera_config_log" /tmp/cantera-logs/config.log
else
echo "Cantera config.log not found"
echo "Searching in all /private/tmp directories:"
find /private/tmp -name "config.log" 2>/dev/null || echo "No config.log files found"
fi

- name: Upload Homebrew logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: homebrew-logs
path: |
/tmp/brew-install.log
/tmp/cantera-logs/
~/Library/Logs/Homebrew/mfc/
if-no-files-found: ignore

- name: Test MFC installation
run: |
echo "=== Testing MFC Installation ==="

echo "1. Checking binaries exist and are executable..."
test -f $(brew --prefix)/bin/mfc && test -x $(brew --prefix)/bin/mfc
test -f $(brew --prefix)/bin/pre_process && test -x $(brew --prefix)/bin/pre_process
test -f $(brew --prefix)/bin/simulation && test -x $(brew --prefix)/bin/simulation
test -f $(brew --prefix)/bin/post_process && test -x $(brew --prefix)/bin/post_process
echo " ✓ All binaries exist and are executable"

echo "2. Verifying installation structure..."
test -f $(brew --prefix mfc)/libexec/mfc.sh
test -d $(brew --prefix mfc)/toolchain
echo " ✓ Installation structure verified"

echo "3. Checking Python venv..."
test -d $(brew --prefix mfc)/libexec/venv
test -f $(brew --prefix mfc)/libexec/venv/bin/python
test -f $(brew --prefix mfc)/libexec/venv/bin/pip
echo " ✓ Python venv exists"

echo "4. Checking examples..."
test -d $(brew --prefix mfc)/examples
test -f $(brew --prefix mfc)/examples/1D_sodshocktube/case.py
echo " ✓ Examples installed"

echo "5. Testing mfc wrapper..."
mfc --help
echo " ✓ mfc --help succeeded"

echo "=== All tests passed! ==="

set -euo pipefail
# Prefer bottle; fall back to source build if needed
brew install mflowcode/mfc/mfc || brew install --build-from-source mflowcode/mfc/mfc

- name: Run MFC test case
run: |
set -euo pipefail
echo "Running a simple test case (1D Sod shock tube)..."
TESTDIR=$(mktemp -d)
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py "$TESTDIR/"
cp "$(brew --prefix mfc)/examples/1D_sodshocktube/case.py" "$TESTDIR/"

echo "Running with $(sysctl -n hw.ncpu) processors..."
# Use absolute path and shorthand syntax (mfc auto-detects and prepends 'run')
mfc "$TESTDIR/case.py" -j $(sysctl -n hw.ncpu)

echo "Test case completed successfully!"

- name: Uninstall and cleanup
if: always()
mfc "$TESTDIR/case.py" -j "$(sysctl -n hw.ncpu)"

test -d "$TESTDIR/silo_hdf5"
echo "✅ Test case completed successfully and produced output"

- name: Basic installation verification
run: |
echo "Cleaning up..."
brew uninstall mfc || true
brew cleanup
set -euo pipefail
echo "1. Checking binaries..."
test -x "$(brew --prefix mfc)/bin/pre_process"
test -x "$(brew --prefix mfc)/bin/simulation"
test -x "$(brew --prefix mfc)/bin/post_process"
test -x "$(brew --prefix mfc)/bin/mfc"

echo "2. Checking toolchain..."
test -d "$(brew --prefix mfc)/toolchain"

echo "3. Checking Python venv..."
test -d "$(brew --prefix mfc)/libexec/venv"
test -x "$(brew --prefix mfc)/libexec/venv/bin/python"

echo "4. Checking examples..."
test -d "$(brew --prefix mfc)/examples"

echo "5. Testing mfc command..."
mfc --help

echo "✅ All verification checks passed"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Install the prebuilt package and run an example:
brew install mflowcode/mfc/mfc
mkdir -p ~/mfc_quickstart && cd ~/mfc_quickstart
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py .
mfc run case.py -n 2
mfc case.py -n 2
```

Use `-n X` to select the number of MPI processes. For developer commands (`build`, `test`, etc.), clone the repo and use `./mfc.sh`.
Expand Down
5 changes: 3 additions & 2 deletions docs/documentation/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ Run a quick example:
mkdir -p ~/mfc_quickstart && cd ~/mfc_quickstart
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py .
# Use -n X to choose the number of MPI processes
mfc run case.py -n 2
mfc case.py -n 2
```

Notes:
- The Homebrew wrapper supports only `mfc run ...`. Developer commands like `build`, `test`, `clean` are available when you clone the repo and use `./mfc.sh`.
- The Homebrew package uses a simplified syntax: just `mfc <case.py>` to run cases.
- Developer commands like `build`, `test`, `clean` are available when you clone the repo and use `./mfc.sh`.
- The package bundles a Python venv and prebuilt binaries; no additional setup is required.
- Examples are installed at `$(brew --prefix mfc)/examples/`.

Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ several supercomputer clusters, both interactively and through batch submission.
If you installed MFC via Homebrew, run cases with the `mfc` wrapper:

```bash
mfc run <path/to/case.py> -n 2
mfc <path/to/case.py> -n 2
```

- Use `-n X` to control the number of MPI processes (ranks).
- Only the `run` command is supported in the Homebrew wrapper.
- The Homebrew package uses a simplified syntax: just `mfc <case.py>` to run cases.
- To use developer commands (`build`, `test`, `clean`, etc.), clone the repository and use `./mfc.sh`.
- The wrapper passes through runtime flags like `-t pre_process simulation`, `-n`, and others; it always runs with preinstalled binaries.
- Examples live at `$(brew --prefix mfc)/examples/`.
Expand Down
Loading
Loading