FreeCAD / homebrew-freecad

Homebrew recipes for FreeCAD
53 stars 34 forks source link

med-file: build error #552

Open ipatch opened 1 month ago

ipatch commented 1 month ago

med-file will fail to build if gcc@13 is not installed. upstream homebrew-core must've migrated the gcc alias from gcc@13 to gcc@14 and the way this formula is setup it uses gcc as a dep but then sets the CC FC and CXX env vars pointing the gcc-13 bins, which neither the style or audit exceptions seem to be picking up this logic error.

==> Fetching freecad/freecad/med-file@4.1.1
==> Downloading https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8efd96c520e35c36cbd55460669a643b53b27c29/patches/med-file-4.1.1-cmake-find-python-h.patch
Already downloaded: /Volumes/STORAGE/ipatch/homebrew/cache/downloads/5c3798ec2adc242f7c15da987324674d7a4effda9305cb1d7453825aa9ef48c4--med-file-4.1.1-cmake-find-python-h.patch
==> Verifying checksum for '5c3798ec2adc242f7c15da987324674d7a4effda9305cb1d7453825aa9ef48c4--med-file-4.1.1-cmake-find-python-h.patch'
==> Downloading https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/med/files/med-4.1.0-0003-build-against-hdf5-1.14.patch
Already downloaded: /Volumes/STORAGE/ipatch/homebrew/cache/downloads/54f20dc1d3b5e0502b9dd200fc9db38d7a354c779c137036f3b53cad832a96ab--med-4.1.0-0003-build-against-hdf5-1.14.patch
==> Verifying checksum for '54f20dc1d3b5e0502b9dd200fc9db38d7a354c779c137036f3b53cad832a96ab--med-4.1.0-0003-build-against-hdf5-1.14.patch'
==> Downloading https://github.com/chennes/med/archive/refs/tags/v4.1.1.tar.gz
Already downloaded: /Volumes/STORAGE/ipatch/homebrew/cache/downloads/f48d9279f1ea68c4007ad6c4dddfadb4155bc14a742e8f851923eeec0f9b98d1--med-4.1.1.tar.gz
==> Verifying checksum for 'f48d9279f1ea68c4007ad6c4dddfadb4155bc14a742e8f851923eeec0f9b98d1--med-4.1.1.tar.gz'
==> Installing med-file@4.1.1 from freecad/freecad
/usr/bin/env tar --extract --no-same-owner --file /Volumes/STORAGE/ipatch/homebrew/cache/downloads/f48d9279f1ea68c4007ad6c4dddfadb4155bc14a742e8f851923eeec0f9b98d1--med-4.1.1.tar.gz --directory /Volumes/STORAGE/ipatch/homebrew/tmp/homebrew-unpack20240816-70172-939h2a
/usr/bin/env cp -pR /Volumes/STORAGE/ipatch/homebrew/tmp/homebrew-unpack20240816-70172-939h2a/med-4.1.1/. /Volumes/STORAGE/ipatch/homebrew/tmp/med-fileA4.1.1-20240816-70172-2g39yh/med-4.1.1
==> Patching
cp -p /Volumes/STORAGE/ipatch/homebrew/cache/downloads/5c3798ec2adc242f7c15da987324674d7a4effda9305cb1d7453825aa9ef48c4--med-file-4.1.1-cmake-find-python-h.patch /Volumes/STORAGE/ipatch/homebrew/tmp/med-fileA4.1.1--patch-20240816-70172-60ilwq/med-file-4.1.1-cmake-find-python-h.patch
==> Applying med-file-4.1.1-cmake-find-python-h.patch
patch -g 0 -f -p1 -i /Volumes/STORAGE/ipatch/homebrew/tmp/med-fileA4.1.1--patch-20240816-70172-60ilwq/med-file-4.1.1-cmake-find-python-h.patch
patching file CMakeLists.txt
cp -p /Volumes/STORAGE/ipatch/homebrew/cache/downloads/54f20dc1d3b5e0502b9dd200fc9db38d7a354c779c137036f3b53cad832a96ab--med-4.1.0-0003-build-against-hdf5-1.14.patch /Volumes/STORAGE/ipatch/homebrew/tmp/med-fileA4.1.1--patch-20240816-70172-nr1img/med-4.1.0-0003-build-against-hdf5-1.14.patch
==> Applying med-4.1.0-0003-build-against-hdf5-1.14.patch
patch -g 0 -f -p1 -i /Volumes/STORAGE/ipatch/homebrew/tmp/med-fileA4.1.1--patch-20240816-70172-nr1img/med-4.1.0-0003-build-against-hdf5-1.14.patch
patching file config/cmake_files/medMacros.cmake
patching file src/ci/MEDfileCompatibility.c
patching file src/hdfi/_MEDfileCreate.c
patching file src/hdfi/_MEDfileOpen.c
patching file src/hdfi/_MEDmemFileOpen.c
patching file src/hdfi/_MEDparFileCreate.c
patching file src/hdfi/_MEDparFileOpen.c
--------------------------------------------
PYTHON=/Volumes/STORAGE/ipatch/homebrew/opt/python@3.11/bin/python3.11
PYTHON_INCLUDE_DIR=/Volumes/STORAGE/ipatch/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11
PYTHON_LIBRARY=/Volumes/STORAGE/ipatch/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/config-3.11-darwin/libpython3.11.dylib
==> cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/Volumes/STORAGE/ipatch/homebrew/Cellar/med-file@4.1.1/4.1.1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/Volumes/STORAGE/ipatch/homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -DHOMEBREW_PREFIX=/Volumes/STORAGE/ipatch/homebrew -DMEDFILE_INSTALL_DOC=ON -DMEDFILE_USE_UNICODE=ON -DMEDFILE_BUILD_PYTHON=ON -DPYTHON_EXECUTABLE=/Volumes/STORAGE/ipatch/homebrew/opt/python@3.11/bin/python3.11 -DPYTHON_INCLUDE_DIRS=/Volumes/STORAGE/ipatch/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -DCMAKE_PREFIX_PATH=/Volumes/STORAGE/ipatch/homebrew/opt/hdf5;/Volumes/STORAGE/ipatch/homebrew/opt/gcc; -DCMAKE_INSTALL_RPATH=@loader_path/../lib -DMEDFILE_BUILD_TESTS=0
CMake Error at /Volumes/STORAGE/ipatch/homebrew/Cellar/cmake/3.30.2/share/cmake/Modules/CMakeDetermineCCompiler.cmake:49 (message):
  Could not find compiler set in environment variable CC:

  /Volumes/STORAGE/ipatch/homebrew/opt/gcc/bin/gcc-13.
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

proposed fix is to use a more robust way of setting the compilers that way errors like do not present themselves in the future.

i came across this issue today when migrating a homebrew installation from a local storage path to a external storage due to size constraints on the box.

ipatch commented 1 month ago

should probably fix the python module setup with the site packages dir as well 🤦‍♂️

ipatch commented 1 month ago
brew audit --formula freecad/freecad/med-file --new
==> Installing 'bundler' gem
Fetching bundler-2.5.11.gem
brew style freecad/freecad
Inspecting 32 files
................................

32 files inspected, no offenses detected
ipatch commented 4 weeks ago

hopefully pr #553 will resolve this issue.

ipatch commented 3 weeks ago

554 should fix the python module path creation.