Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix "Another active Homebrew process ..." #264

Closed

Conversation

stepheneb
Copy link

Fixes: "Another active Homebrew process is already in progress ..." error.

Testing and console output below based off of this invocation:

brew install freecad --HEAD --with-macos-app --build-from-source --verbose --debug
brew style freecad/freecad/[NAME_OF_FORMULA_FILE] 

Passes

$ brew style freecad/freecad/freecad

1 file inspected, no offenses detected
  • Have you ensured your commit passed audit checks, ie.
brew audit freecad/freecad/[NAME_OF_FORMULA_FILE] --online --new-formula

No output running this:

$ brew audit freecad/freecad/freecad

Am still getting this error -- which is probably related to [#163] and this commit comment: vejmarie/FreeCAD@a5a448c#commitcomment-50072628

-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/Sketcher_Colors.cfg
-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/Start_Colors.cfg
-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/TechDraw_Colors.cfg
-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/Window_Colors.cfg
CMake Error at src/MacAppBundle/cmake_install.cmake:55 (file):
  file INSTALL cannot find
  "/tmp/freecad-20211115-25671-s2gnxp/src/MacAppBundle/import site": No such
  file or directory.
Call Stack (most recent call first):
  src/cmake_install.cmake:51 (include)
  cmake_install.cmake:68 (include)


make: *** [install] Error 1
/usr/local/Homebrew/Library/Homebrew/shims/shared/git --version
/usr/local/Homebrew/Library/Homebrew/shims/shared/curl --version
/usr/local/Homebrew/Library/Homebrew/ignorable.rb:29:in `block in raise'
BuildError: Failed executing: make -j8 install

Am not sure if this is related to these warnings in the first two lines of this

Warning: Use freecad/freecad/[email protected] instead of deprecated python3.9
Warning: Use freecad/freecad/[email protected] instead of deprecated python3.9
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/freecad/HEAD-8527cab -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -DBUILD_QT5=ON -DUSE_PYTHON3=1 -DCMAKE_CXX_STANDARD=17 -DBUILD_ENABLE_CXX_STD:STRING=C++17 -DBUILD_FEM_NETGEN=1 -DBUILD_FEM=1 -DBUILD_FEM_NETGEN:BOOL=ON -DBUILD_WEB=ON -DFREECAD_USE_EXTERNAL_KDL=ON -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/local/opt/[email protected]/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/local/opt/[email protected]/Frameworks/Python.framework/Headers -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5152/lib/cmake;/usr/local/opt/[email protected]/Contents/Resources;/usr/local/opt/[email protected]/lib/cmake;/usr/local/opt/[email protected]/lib/cmake;/usr/local/opt/med-file/share/cmake/;/usr/local/opt/shiboken2/lib/cmake;/usr/local/opt/pyside2/lib/cmake;/usr/local/opt/[email protected]/lib/cmake;/usr/local/opt/[email protected]/lib/cmake;/usr/local/opt/[email protected]/lib/cmake; -DFREECAD_CREATE_MAC_APP=1 ..
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compiler: AppleClang, version: 13.0.0.13000029
-- Looking for GL/gl.h
-- Looking for GL/gl.h - not found
-- Looking for C++ include istream
-- Looking for C++ include istream - found
-- Looking for C++ include ostream
-- Looking for C++ include ostream - found
-- Looking for C++ include fstream
-- Looking for C++ include fstream - found
-- Looking for C++ include sstream
-- Looking for C++ include sstream - found
-- Looking for C++ include ios
-- Looking for C++ include ios - found
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Looking for C++ include iomanip
-- Looking for C++ include iomanip - found
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Check for STD namespace
-- Check for STD namespace - found
-- Force BOOST_PP_VARIADICS=1 for clang
-- prefix: /usr/local/Cellar/freecad/HEAD-8527cab
-- bindir: bin
-- datadir: share
-- docdir: share/doc/FreeCAD
-- includedir: include
-- libdir: lib
-- cmake: 3.21.4
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.9.2") found components: doxygen dot 
-- Detected Homebrew install at /usr/local
-- Found Python3: /usr/local/bin/python3.9 (found version "3.9.6") found components: Interpreter Development Development.Module Development.Embed 
-- Found XercesC: /usr/local/lib/libxerces-c.dylib (found version "3.2.3") 
-- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/lib/libz.tbd (found version "1.2.11") 
-- PyCXX found:
--   Headers:  /tmp/freecad-20211115-25671-s2gnxp/src
--   Sources:  /tmp/freecad-20211115-25671-s2gnxp/src/CXX
--   Version:  6.2.8
-- Found OCC: /usr/local/opt/[email protected]/include/opencascade (found version "7.5.3") 
-- -- Found OCE/OpenCASCADE version: 7.5.3
-- -- OCE/OpenCASCADE include directory: /usr/local/opt/[email protected]/include/opencascade
-- -- OCE/OpenCASCADE shared libraries directory: /usr/local/opt/[email protected]/lib
-- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/OpenGL.framework   
-- Found OpenGLU: /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/OpenGL.framework
-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkhdf5;vtkRenderingCore;vtkInteractionStyle;vtkRenderingFreeType;vtkRenderingOpenGL2
-- Check for medfile (libmed and libmedc) ...
-- Found MEDFile: /usr/local/include  
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- We guess that libmed was built using hdf5-serial version
-- Checking for one of the modules 'hdf5-serial'
-- Found HDF5: /usr/local/opt/[email protected]/lib/libhdf5.dylib;/usr/local/lib/libsz.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/lib/libz.tbd;/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/lib/libdl.tbd;/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/lib/libm.tbd (found version "1.10.7")  
-- Checking for one of the modules 'ompi-cxx'
-- Found Boost: /usr/local/opt/[email protected]/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found suitable version "1.75.0", minimum required is "1.55") found components: filesystem program_options regex system thread date_time 
-- Found Netgen: /usr/local/opt/[email protected]/Contents/Resources/CMake
-- Performing Test CSTDIO_INCLUDE_TRY1
-- Performing Test CSTDIO_INCLUDE_TRY1 - Success
-- Found NETGEN version 6.2, calculated: 395832
-- Found SWIG: /usr/local/opt/[email protected]/bin/swig (found version "4.0.2")  
-- Found Eigen3: /usr/local/include/eigen3 (found suitable version "3.4.0", minimum required is "2.91.0") 
-- Found Freetype: /usr/local/lib/libfreetype.dylib (found version "2.11.0") 
-- Coin3D libraries found
-- Found Spnav: /usr/local/lib/libspnav.dylib  
-- Shiboken2Config: Using default python: .cpython-39-darwin
-- Found PythonInterp: /usr/local/bin/python3.9 (found suitable version "3.9.6", minimum required is "3") 
-- Found PythonLibs: /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib (found suitable version "3.9.6", minimum required is "3") 
-- SHIBOKEN_PYTHON_INCLUDE_DIRS computed to value: '/usr/local/opt/[email protected]/Frameworks/Python.framework/Headers'
-- SHIBOKEN_PYTHON_LIBRARIES computed to value: '-undefined dynamic_lookup'
-- libshiboken built for Release
-- PYTHON_CONFIG_SUFFIX: .cpython-39-darwin
-- libshiboken built for Release
-- ===============================================
PySide2 Python module found at /usr/local/lib/python3.9/site-packages/PySide2.
===============================================

-- Found Matplotlib: /usr/local/lib/python3.9/site-packages/matplotlib (found version "3.3.3")
-- Platform is 64-bit, set -D_OCC64
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Performing Test _flag_found
-- Performing Test _flag_found - Success

The formula installs six and it appears in the correct site-packages directory -- so it seems that [email protected] is being used.

$ ls -l /usr/local/lib/python3.9/site-packages/six.py
-rw-r--r--  1 stephen  admin  34549 Aug 16 14:03 /usr/local/lib/python3.9/site-packages/six.py

The cmake invocation looks like this (reformatted for readability):

=> cmake
  -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/freecad/HEAD-8527cab
  -DCMAKE_INSTALL_LIBDIR=lib
  -DCMAKE_BUILD_TYPE=Release
  -DCMAKE_FIND_FRAMEWORK=LAST
  -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev
  -DBUILD_TESTING=OFF
  -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
  -DBUILD_QT5=ON
  -DUSE_PYTHON3=1
  -DCMAKE_CXX_STANDARD=17
  -DBUILD_ENABLE_CXX_STD:STRING=C++17
  -DBUILD_FEM_NETGEN=1
  -DBUILD_FEM=1
  -DBUILD_FEM_NETGEN:BOOL=ON
  -DBUILD_WEB=ON
  -DFREECAD_USE_EXTERNAL_KDL=ON
  -DCMAKE_BUILD_TYPE=Release
  -DPYTHON_EXECUTABLE=/usr/local/opt/[email protected]/bin/python3
  -DPYTHON_INCLUDE_DIR=/usr/local/opt/[email protected]/Frameworks/Python.framework/Headers
  -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5152/lib/cmake;
    /usr/local/opt/[email protected]/Contents/Resources;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/med-file/share/cmake/;
    /usr/local/opt/shiboken2/lib/cmake;
    /usr/local/opt/pyside2/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
  -DFREECAD_CREATE_MAC_APP=1 ..

Asking python3 to report where it thinks site-packages is located:

$ python3 -c 'import site; print(site.getsitepackages())'
['/usr/local/Cellar/[email protected]/3.9.6_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages']

Which resolves to:

$ ls -l /usr/local/Cellar/[email protected]/3.9.6_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
lrwxr-xr-x  1 stephen  admin  54 Nov 15 19:07 /usr/local/Cellar/[email protected]/3.9.6_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages -> ../../../../../../../../../lib/python3.9/site-packages

before:

  -DCMAKE_PREFIX_PATH=
    /usr/local/opt/qt5152/lib/cmake;
    /usr/local/opt/[email protected]/Contents/Resources;
    /usr/local/opt/[email protected]/lib/cmake;
    /lib/cmake;
    /share/cmake/;
    /lib/cmake;
    /lib/cmake;
    /lib/cmake;
    /lib/cmake;
    /lib/cmake;

after:

-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5152/lib/cmake;
    /usr/local/opt/[email protected]/Contents/Resources;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/med-file/share/cmake/;
    /usr/local/opt/shiboken2/lib/cmake;
    /usr/local/opt/pyside2/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
    /usr/local/opt/[email protected]/lib/cmake;
@ipatch
Copy link
Collaborator

ipatch commented Nov 16, 2021

hey thanks for submitting this. i'm actively working on getting the freecad.rb formula going. hopefully i'll have my PR submitted today. 🤞 and get it passing CI/CD, and then we'll have "working" version of brew install freecad, so hopefully once i wrap that up i can begin to address some of the ongoing issues.

@stepheneb
Copy link
Author

stepheneb commented Nov 16, 2021

@ipatch, do you know if there is a way during work on the formula where I can keep the temporary directories around so subsequent complication and testing of changes is faster? It's hard to inspect the the results of generating src/MacAppBundle/cmake_install.cmake when the directories are removed on a build error.

FYI:

I have a separate freecad directory with a checkout of the source and a freecad-build dir where I compile it almost identically to the formula.. That had the same issue

CMake Error at src/MacAppBundle/cmake_install.cmake:55 (file):
  file INSTALL cannot find
  "/tmp/freecad-20211115-25671-s2gnxp/src/MacAppBundle/import site": No such

But after I force-linked [email protected] and removed sip v4.6.0 the install process continued past that step.

$ brew link --force [email protected]
$ brew remove sip

It then errored here: Making bundle relocatable..

-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/lib/qtplugins/webview/libqtwebview_darwin.dylib
-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/lib/qtplugins/webview/libqtwebview_webengine.dylib
-- Making bundle relocatable...
-- INFO: Analyzing bundle dependencies...
-- ERROR: Unable to find LC_DYLD_LOAD entry: @rpath/libc++abi.1.dylib
-- ERROR: Failed to resolve dependency in /usr/local/opt/llvm/lib/libc++.1.dylib
Traceback (most recent call last):
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 388, in <module>
    main()
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 371, in main
    build_deps_graph(graph, bundle_path, dir_filter, search_paths)
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 238, in build_deps_graph
    deps = create_dep_nodes(list_install_names(k2), s_paths)
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 163, in create_dep_nodes
    raise LibraryNotFound(lib_name + " not found in given search paths")
__main__.LibraryNotFound: libc++abi.1.dylib not found in given search paths
-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/share/License.txt
-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/share/examples/Schenkel.stp

Running the brew command on this branch still seems to have an error in the earlier problem: src/MacAppBundle/import site

brew install freecad --HEAD --with-macos-app --verbose

@ipatch
Copy link
Collaborator

ipatch commented Nov 17, 2021

@ipatch, do you know if there is a way during work on the formula where I can keep the temporary directories around so subsequent complication and testing of changes is faster? It's hard to inspect the the results of generating src/MacAppBundle/cmake_install.cmake when the directories are removed on a build error.

FYI:

I have a separate freecad directory with a checkout of the source and a freecad-build dir where I compile it almost identically to the formula.. That had the same issue

CMake Error at src/MacAppBundle/cmake_install.cmake:55 (file):
  file INSTALL cannot find
  "/tmp/freecad-20211115-25671-s2gnxp/src/MacAppBundle/import site": No such

But after I force-linked [email protected] and removed sip v4.6.0 the install process continued past that step.

$ brew link --force [email protected]
$ brew remove sip

It then errored here: Making bundle relocatable..

-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/lib/qtplugins/webview/libqtwebview_darwin.dylib
-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/lib/qtplugins/webview/libqtwebview_webengine.dylib
-- Making bundle relocatable...
-- INFO: Analyzing bundle dependencies...
-- ERROR: Unable to find LC_DYLD_LOAD entry: @rpath/libc++abi.1.dylib
-- ERROR: Failed to resolve dependency in /usr/local/opt/llvm/lib/libc++.1.dylib
Traceback (most recent call last):
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 388, in <module>
    main()
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 371, in main
    build_deps_graph(graph, bundle_path, dir_filter, search_paths)
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 238, in build_deps_graph
    deps = create_dep_nodes(list_install_names(k2), s_paths)
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 163, in create_dep_nodes
    raise LibraryNotFound(lib_name + " not found in given search paths")
__main__.LibraryNotFound: libc++abi.1.dylib not found in given search paths
-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/share/License.txt
-- Up-to-date: /Users/stephen/dev/freecad/FreeCAD.app/Contents/share/examples/Schenkel.stp

Running the brew command on this branch still seems to have an error in the earlier problem: src/MacAppBundle/import site

brew install freecad --HEAD --with-macos-app --verbose

so yeah that is an issue with building using brew install is that it sets up a temporary build folder to configure and build the software. however they do provide a --interactive and --debug and even --verbose when building formula if you'd like to test what you're working on. i find using the --verbose and --debug the best, but their far from perfect. as you've already noticed the lengthy task that is cmake, make, make install it takes quite a bit of time to run through a build as freecad uses a lot of different software under the hood. i do wish there were a more elegant way of incrementally testing changes of a formula without wiping out the "cmake cache". as i've been going through this process locally on my machine and incrementally changing the formula is time consuming believe me. once i get the formula working locally on my catalina machine i'm planning on submitting a PR to the build CI/CD to make sure everything goes well, and then when that passes the formula will be updated.

...and then clean up all the excess formulae in the repo dangling around ie. the versioned boost formula and what not.

the official mac homebrew has some decent documentation for writing formula

https://docs.brew.sh/Formula-Cookbook

...and once i can successfully build a FreeCAD.app bundle locally using brew install freecad on my local box i'll submit a PR condensed down into a single commit.

you can see the current freecad.rb formula i've been working on below. and checkout all the little incremental commits i've been making / testing to see what works and not.

https://github.com/ipatch/homebrew-freecad/blob/c6d0942b7bc904432120083893ae000da15abce0/Formula/freecad.rb

... i've been updating the patch with more path's that seem to be required each time i attempt to build the app bundle. hopefully i'll have it finished sooner rather than later.

if you're itching to get a working copy of freecad going on your macos box you always download the latest weekly build below.

https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds

@stepheneb
Copy link
Author

stepheneb commented Nov 17, 2021

you can see the current freecad.rb formula i've been working on below. and checkout all the little incremental commits i've been making / testing to see what works and not.

https://github.com/ipatch/homebrew-freecad/blob/c6d0942b7bc904432120083893ae000da15abce0/Formula/freecad.rb

Looks like you are moving towards fewer versioned formulas. If you can get that working that makes everything easier!

This is what part of my current freecad.rb file looks like right now. Even more versioned dependencies. Simpler is better.

  depends_on "freecad/freecad/[email protected]" => :build
  depends_on "freecad/freecad/[email protected]"
  depends_on "freecad/freecad/[email protected]"
  depends_on "freecad/freecad/[email protected]"
  depends_on "freecad/freecad/matplotlib"
  depends_on "freecad/freecad/med-file"
  depends_on "freecad/freecad/[email protected]"
  depends_on "freecad/freecad/opencamlib"
  depends_on "freecad/freecad/[email protected]"
  depends_on "freecad/freecad/pivy"
  depends_on "freecad/freecad/pyside2"
  depends_on "freecad/freecad/pyside2-tools"
  depends_on "freecad/freecad/[email protected]"
  depends_on "freecad/freecad/[email protected]"
  depends_on "freecad/freecad/qt5152"
  depends_on "freecad/freecad/shiboken2"
  depends_on "freecad/freecad/[email protected]"

If looks like you are still using a versioned vtk -- so this new issue I made may still be pertinent: #267

@ipatch
Copy link
Collaborator

ipatch commented Dec 10, 2021

@stepheneb

you mind testing the latest changes i pushed up the past few days.

also not sure if you still want to keep this PR open or not? either way i can close it out if you'd like.

@ipatch
Copy link
Collaborator

ipatch commented Jun 10, 2024

running brew install freecad/freecad/freecad -v -s should just work.

@ipatch ipatch closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants