@@ -21,8 +21,8 @@ class Mfc < Formula
2121 depends_on "openblas"
22222323
24- # Skip relocation for Python C extensions in the venv
25- # The venv is self-contained in libexec and doesn 't need Homebrew's relocation
24+ # Skip cleanup for Python venv to preserve C extensions as-is
25+ # Python wheels manage their own RPATHs and don 't need Homebrew's relocation
2626 skip_clean "libexec/venv"
2727
2828 def install
@@ -248,6 +248,16 @@ def post_install
248248 ( libexec /"mfc" ) . chmod 0755
249249 end
250250
251+ # Override to skip relocation checks for Python C extensions in venv
252+ # Python wheels (especially orjson, cantera) have Mach-O headers without enough
253+ # padding for Homebrew's longer paths. This is safe because:
254+ # 1. The venv is self-contained in libexec and uses relative paths
255+ # 2. Python manages its own RPATH for C extensions
256+ # 3. The venv is never relocated after installation
257+ def skip_relocation? ( file , _type )
258+ file . to_s . include? ( "/libexec/venv/" )
259+ end
260+
251261 def caveats
252262 <<~EOS
253263 MFC has been installed successfully!
@@ -289,21 +299,22 @@ def caveats
289299 # Test that mfc wrapper works
290300 system bin /"mfc" , "--help"
291301
292- # Test running a simple 1D Sod shock tube case from a separate directory
293- # This ensures the wrapper script correctly handles relative paths
302+ # Test running a complete 1D Sod shock tube case from a separate directory
303+ # This comprehensive test ensures the entire MFC workflow functions correctly
304+ # and that the wrapper script properly handles relative paths
294305 testpath_case = testpath /"test_run"
295306 testpath_case . mkpath
296307
297308 # Copy case.py from examples to an independent test directory
298309 cp prefix /"examples/1D_sodshocktube/case.py" , testpath_case /"case.py"
299310
300- # Run the case from the test directory (this will execute pre_process and simulation)
301- # Limit to 1 processor and reduce runtime for testing
311+ # Run all three stages: pre_process, simulation, and post_process
312+ # This runs a full 1D Sod shock tube (1000 timesteps, 399 cells)
302313 cd testpath_case do
303- system bin /"mfc" , "run" , " case.py", "-j " , "1"
314+ system bin /"mfc" , "case.py" , "-n " , "1"
304315 end
305316
306- # Verify output files were created in the test directory
317+ # Verify silo_hdf5 output files were created by post_process
307318 assert_path_exists testpath_case /"silo_hdf5"
308319 assert_predicate testpath_case /"silo_hdf5" , :directory?
309320 end
0 commit comments