Skip to content

Commit 6235b8a

Browse files
committed
Fix mfc.sh build: keep toolchain in buildpath during build
The issue was that mfc.sh checks for 'toolchain/util.sh' to verify it's being run from MFC's root folder. We were moving the toolchain directory to the installation prefix BEFORE running the build, which caused this check to fail. Now we: 1. Keep toolchain in buildpath during the build 2. Install the Python package from buildpath/toolchain 3. Run the build (mfc.sh can now find toolchain/) 4. Move toolchain to prefix only after build completes This ensures mfc.sh finds the required files while still installing everything to the correct final location.
1 parent 4b8f094 commit 6235b8a

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

packaging/homebrew/mfc.rb

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ def install
2929
# Install Cantera from PyPI (required dependency for MFC build)
3030
system venv/"bin/pip", "install", "cantera==3.1.0"
3131

32-
# Install Python toolchain (needed before build)
33-
prefix.install "toolchain"
34-
3532
# Install MFC Python package and dependencies into venv
36-
system venv/"bin/pip", "install", "-e", prefix/"toolchain"
33+
# Keep toolchain in buildpath for now - mfc.sh needs it there
34+
system venv/"bin/pip", "install", "-e", buildpath/"toolchain"
3735

3836
# Create symlink so mfc.sh uses our pre-installed venv
3937
mkdir_p "build"
@@ -44,18 +42,14 @@ def install
4442
ENV["VIRTUAL_ENV"] = venv
4543

4644
# Build MFC using pre-configured venv
47-
# Must run from buildpath (MFC root directory)
48-
ohai "DEBUG: buildpath = #{buildpath}"
49-
ohai "DEBUG: pwd before chdir = #{Dir.pwd}"
50-
ohai "DEBUG: buildpath contents = #{Dir.entries(buildpath).join(", ")}"
51-
45+
# Must run from buildpath (MFC root directory) where toolchain/ exists
5246
Dir.chdir(buildpath) do
53-
ohai "DEBUG: pwd inside chdir = #{Dir.pwd}"
54-
ohai "DEBUG: mfc.sh exists? #{File.exist?("./mfc.sh")}"
55-
ohai "DEBUG: mfc.sh executable? #{File.executable?("./mfc.sh")}"
5647
system "./mfc.sh", "build", "-t", "pre_process", "simulation", "post_process", "-j", ENV.make_jobs.to_s
5748
end
5849

50+
# After build completes, install Python toolchain to prefix
51+
prefix.install "toolchain"
52+
5953
# Install binaries - they're in hashed subdirectories like build/install/<hash>/bin/*
6054
Dir.glob("build/install/*/bin/*").each do |binary_path|
6155
bin.install binary_path
@@ -64,9 +58,6 @@ def install
6458
# Install main mfc.sh script
6559
libexec.install "mfc.sh"
6660

67-
# Install toolchain directory (already done above, but make sure it stays in prefix)
68-
# (already done with prefix.install above)
69-
7061
# Install examples
7162
prefix.install "examples"
7263

0 commit comments

Comments
 (0)