Skip to content
Open
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
89 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
0839de6
Merge branch 'MFlowCode:master' into homebrew-formula
sbryngelson Nov 4, 2025
d1ccc91
fix: Address PR review feedback for Homebrew formula
sbryngelson Nov 4, 2025
312a0ff
refactor: Implement all PR review suggestions for Homebrew formula
sbryngelson Nov 4, 2025
1b80a46
fix: Address Copilot PR review comments
sbryngelson Nov 4, 2025
ac0b77a
fix up
sbryngelson Nov 4, 2025
62310af
docs: Address final Copilot review suggestions
sbryngelson Nov 4, 2025
34ef2bd
fix: Implement qodo-merge-pro safety improvements
sbryngelson Nov 4, 2025
90df696
ci: Add Homebrew formula testing workflow
sbryngelson Nov 4, 2025
b83729b
fix: Address all Homebrew style violations
sbryngelson Nov 4, 2025
120b3a3
fix
sbryngelson Nov 4, 2025
8b91e40
fix?
sbryngelson Nov 4, 2025
d305435
fix
sbryngelson Nov 4, 2025
f45fa47
Fix Homebrew CI: use local tap for formula installation
sbryngelson Nov 4, 2025
faa1807
Restore bug_report.md from master branch
sbryngelson Nov 4, 2025
1b72214
Fix Homebrew formula: handle hashed installation directory
sbryngelson Nov 4, 2025
9a840ec
Fix: Find each binary individually in separate hashed directories
sbryngelson Nov 4, 2025
a0f4293
Simplify Homebrew formula to install binaries only
sbryngelson Nov 4, 2025
af2cc33
push
sbryngelson Nov 4, 2025
e335fcb
Fix test: Don't run binaries with -h flag
sbryngelson Nov 4, 2025
48fe8f5
Fix Homebrew style: Use assert_path_exists instead of assert_predicat…
sbryngelson Nov 4, 2025
1df4901
Install full MFC toolchain with smart wrapper for read-only Cellar
sbryngelson Nov 4, 2025
2152b36
Fix formula test: Don't trigger Python venv setup
sbryngelson Nov 4, 2025
0971f4f
Add Cantera dependency and pre-install Python venv
sbryngelson Nov 4, 2025
c0dbe80
Build Cantera 3.1.0 from source instead of PyPI
sbryngelson Nov 4, 2025
23337c1
Complete Cantera 3.1.0 source build implementation
sbryngelson Nov 4, 2025
5bd664c
Fix trailing whitespace errors in Homebrew formula
sbryngelson Nov 4, 2025
26204da
Fix Cantera resource: remove incorrect revision hash
sbryngelson Nov 4, 2025
c0168b7
Fix unnecessary spacing in Cantera resource definition
sbryngelson Nov 4, 2025
487b88f
Fix: Build Cantera before MFC to avoid PyPI dependency error
sbryngelson Nov 4, 2025
822a045
Fix Homebrew style: Use ENV.fetch instead of ENV[]
sbryngelson Nov 4, 2025
8c381b1
Add packaging module to Cantera build dependencies
sbryngelson Nov 4, 2025
88521cb
Fix: Run scons via venv Python to find packaging module
sbryngelson Nov 4, 2025
8efd560
Remove scons from Homebrew dependencies
sbryngelson Nov 4, 2025
a648a59
Fix Cantera build: Pass compiler and SDK paths to scons
sbryngelson Nov 5, 2025
9b76a24
Fix: Pass compiler flags as environment variables, not scons args
sbryngelson Nov 5, 2025
9823cfe
Fix hash alignment for Homebrew style check
sbryngelson Nov 5, 2025
00f9d63
Add verbose logging and artifacts to Homebrew CI
sbryngelson Nov 5, 2025
5564cd6
Fix brew test version check by committing formula to tap
sbryngelson Nov 5, 2025
56083b9
Fix: Modify ENV directly instead of passing hash to system
sbryngelson Nov 5, 2025
2145319
Replace brew test with direct test commands
sbryngelson Nov 5, 2025
2089f3c
Pass compiler flags directly to scons as build arguments
sbryngelson Nov 5, 2025
e5e5947
Fix trailing whitespace on line 45
sbryngelson Nov 5, 2025
74178b6
Fix test: use formula-specific prefix for libexec check
sbryngelson Nov 5, 2025
f392a7d
Fix Cantera build: Set ENV vars and explicit compilers for scons
sbryngelson Nov 5, 2025
73cd91e
Fix trailing whitespace on lines 44 and 51
sbryngelson Nov 5, 2025
9a9e93f
Fix TypeError: Set SDKROOT in ENV instead of passing hash to system
sbryngelson Nov 5, 2025
82cd3f4
Add SDK C++ include path to scons extra_inc_dirs
sbryngelson Nov 5, 2025
62a1550
Pass compiler flags as scons variables for configure checks
sbryngelson Nov 5, 2025
5483722
Fix RuboCop: Use ENV.fetch instead of ENV[] for compiler flags
sbryngelson Nov 5, 2025
acb0441
Fix Cantera scons: Use cc_flags/cxx_flags instead of CCFLAGS/CXXFLAGS
sbryngelson Nov 5, 2025
6837356
Add C++ include path directly to cxx_flags for scons checks
sbryngelson Nov 5, 2025
b41fcbc
Add SDK main include path to compiler flags for C header access
sbryngelson Nov 5, 2025
ee8d3e0
Add Cantera config.log capture to CI for debugging
sbryngelson Nov 5, 2025
9540c07
Fix CI: Add pipefail to catch brew install failures
sbryngelson Nov 5, 2025
d0bb8c9
Add config.log output on Cantera build failure
sbryngelson Nov 5, 2025
dde2442
Fix RuboCop style: remove trailing whitespace and shorten long line
sbryngelson Nov 5, 2025
086c239
Improve config.log capture: search recursively and list directory con…
sbryngelson Nov 5, 2025
8767c6c
Fix RuboCop: remove trailing whitespace on lines 87 and 99
sbryngelson Nov 5, 2025
90fe111
Enhance debug output: use opoo, check multiple config.log locations, …
sbryngelson Nov 5, 2025
feb36b1
Remove Cantera from formula - make it an optional user-installed depe…
sbryngelson Nov 5, 2025
03f9364
Install Cantera from PyPI instead of building from source
sbryngelson Nov 5, 2025
97bab16
Fix RuboCop: use assert_path_exists instead of assert_predicate with …
sbryngelson Nov 5, 2025
9d790c8
Fix mfc.sh build: ensure we're in buildpath directory
sbryngelson Nov 5, 2025
fa96ac4
Add debug output to diagnose mfc.sh directory issue
sbryngelson Nov 5, 2025
4b8f094
Fix trailing whitespace in formula
sbryngelson Nov 5, 2025
6235b8a
Fix mfc.sh build: keep toolchain in buildpath during build
sbryngelson Nov 5, 2025
eef778c
Fix mfc wrapper script: add toolchain symlink and build directory
sbryngelson Nov 6, 2025
9a4eb8b
Fix Homebrew formula: copy directories instead of symlinking to avoid…
sbryngelson Nov 6, 2025
df418b0
Fix Homebrew formula: ensure fresh venv on each install
sbryngelson Nov 6, 2025
3bc9854
Fix CI: handle Homebrew dylib fixup warnings gracefully
sbryngelson Nov 6, 2025
73d1623
Fix CI: remove invalid mfc count test
sbryngelson Nov 6, 2025
9b8b345
Fix CI: use absolute path for test case file
sbryngelson Nov 6, 2025
ac6248f
Remove 'mfc run' test from CI and clarify Homebrew limitations
sbryngelson Nov 6, 2025
3b6b988
Enable 'mfc run' by patching toolchain to use Homebrew binaries
sbryngelson Nov 6, 2025
691db62
Fix mfc run: patch toolchain to skip building and use Homebrew binaries
sbryngelson Nov 6, 2025
9c783b1
Fix wrapper script creation and permissions
sbryngelson Nov 6, 2025
dd49604
Fix executable permissions with post_install hook
sbryngelson Nov 6, 2025
e7373e6
Fix CI: use absolute path for case.py in mfc run test
sbryngelson Nov 6, 2025
0ffea8f
docs
sbryngelson Nov 6, 2025
37614f3
docs
sbryngelson Nov 6, 2025
4127e3f
cleanup
sbryngelson Nov 6, 2025
d659884
harden
sbryngelson Nov 6, 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
165 changes: 165 additions & 0 deletions .github/workflows/homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: Homebrew Formula Test

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:
test-formula:
name: Test Homebrew Formula
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 sundials yaml-cpp

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

- 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 check for successful installation (🍺 symbol) rather than just exit code
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

# Check if the formula actually installed successfully
if grep -q "🍺.*mfc.*built in" /tmp/brew-install.log; then
echo "✅ MFC installed successfully (ignoring dylib relocation warnings)"
exit 0
else
echo "❌ MFC installation failed"
exit $brew_exit_code
fi
Comment on lines +45 to +68
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Replace the brittle log-parsing check for Homebrew installation success with more robust brew list and brew info commands to verify the package is installed. [possible issue, importance: 7]

Suggested change
- 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 check for successful installation (🍺 symbol) rather than just exit code
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
# Check if the formula actually installed successfully
if grep -q "🍺.*mfc.*built in" /tmp/brew-install.log; then
echo "✅ MFC installed successfully (ignoring dylib relocation warnings)"
exit 0
else
echo "❌ MFC installation failed"
exit $brew_exit_code
fi
- 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..."
set +e
brew install --build-from-source --verbose mflowcode/test/mfc 2>&1 | tee /tmp/brew-install.log
brew_exit_code=$?
set -e
echo "Verifying installation via brew..."
if brew list --versions mfc >/dev/null 2>&1; then
echo "✅ MFC appears installed (brew list)"
exit 0
fi
# As an extra check, try brew info --json to detect installation
if brew info --json=v2 mfc | grep -q '"installed":\s*\['; then
echo "✅ MFC appears installed (brew info)"
exit 0
fi
echo "❌ MFC installation failed"
exit $brew_exit_code


- name: Display error logs on failure
if: failure()
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)/Cellar/mfc/*/libexec/venv
test -f $(brew --prefix)/Cellar/mfc/*/libexec/venv/bin/python
test -f $(brew --prefix)/Cellar/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! ==="

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

echo "Running with $(sysctl -n hw.ncpu) processors..."
# Use absolute path since mfc wrapper creates its own tmpdir
mfc run "$TESTDIR/case.py" -j $(sysctl -n hw.ncpu)

echo "Test case completed successfully!"

- name: Uninstall and cleanup
if: always()
run: |
echo "Cleaning up..."
brew uninstall mfc || true
brew cleanup

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ benchmarks/*.png
*.mov
*.mkv
*.avi

packaging/spack/spack-test
.spack
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Strang = "Strang"
TKE = "TKE"
HSA = "HSA"
infp = "infp"
Sur = "Sur"

[files]
extend-exclude = ["docs/documentation/references*", "tests/", "toolchain/cce_simulation_workgroup_256.sh"]
Loading
Loading