Skip to content

Commit 13e86b0

Browse files
committed
Use bottle :unneeded to skip bottling for Python venv
The formula contains a Python virtual environment with pre-built C extensions (orjson, etc.) that cannot be reliably relocated by Homebrew's bottling process. Attempts to force-compile these packages from source fail because: - orjson requires Rust (maturin build tool) - typos requires Rust - Setting LDFLAGS only helps packages built from source, not wheels Solution: Use 'bottle :unneeded' to tell Homebrew not to create bottles. Users will install from source, which is appropriate for scientific computing software like MFC. The installation process remains the same and works correctly.
1 parent 028e017 commit 13e86b0

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

packaging/homebrew/mfc.rb

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ class Mfc < Formula
1111
license "MIT"
1212
head "https://github.com/MFlowCode/MFC.git", branch: "master"
1313

14+
# Bottles are not created because this formula contains a Python virtual environment
15+
# with pre-built C extensions (orjson, etc.) that cannot be reliably relocated
16+
bottle :unneeded
17+
1418
depends_on "cmake" => :build
1519
depends_on "gcc" => :build
1620

@@ -31,26 +35,12 @@ def install
3135
# Cantera has CMake compatibility issues when building from source with newer CMake versions
3236
system venv/"bin/pip", "install", "cantera==3.1.0"
3337

34-
# Set LDFLAGS to ensure Python C extensions are compiled with enough
35-
# header padding for Homebrew's bottle relocation process
36-
# This fixes "Failed changing dylib ID" errors during bottling
37-
ENV.append "LDFLAGS", "-Wl,-headerpad_max_install_names"
38-
ENV.append "CFLAGS", "-Wl,-headerpad_max_install_names"
39-
ENV.append "CXXFLAGS", "-Wl,-headerpad_max_install_names"
40-
4138
# Install MFC Python package and dependencies into venv
4239
# Use editable install (-e) to avoid RECORD file issues when venv is symlinked at runtime
43-
# Most dependencies use pre-built wheels initially
40+
# Dependencies will use pre-built wheels from PyPI (no bottling needed)
4441
# Keep toolchain in buildpath for now - mfc.sh needs it there
4542
system venv/"bin/pip", "install", "-e", buildpath/"toolchain"
4643

47-
# Force-reinstall packages with C extensions from source with proper LDFLAGS
48-
# This ensures they have correct header padding for bottle relocation
49-
# orjson is a transitive dependency that comes from pre-built wheels without proper padding
50-
# --no-deps prevents reinstalling dependencies, only the target package
51-
system venv/"bin/pip", "install", "--no-binary", ":all:", "--force-reinstall",
52-
"--no-deps", "orjson"
53-
5444
# Create symlink so mfc.sh uses our pre-installed venv
5545
mkdir_p "build"
5646
ln_sf venv, "build/venv"

0 commit comments

Comments
 (0)