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

setup new formula file for freecad 0.20.2 release using py310 #488

Closed
wants to merge 1 commit into from

Conversation

ipatch
Copy link
Collaborator

@ipatch ipatch commented Mar 7, 2024

brew style freecad/freecad/[NAME_OF_FORMULA_FILE] 

output from running above command should output something similiar to the below

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

Not all PRs require passing these checks ie. adding [no ci] in the commit message will prevent the CI from running but PRs that change formula files generally should run through the CI checks that way new bottles are built and uploaded to the repository thus not having to build all formula from source but rather installing from a bottle (significantly faster 🐰 ... 🐢)

For more information about this template file learn more

@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch from deb0dbf to da22876 Compare March 7, 2024 20:02
@ipatch
Copy link
Collaborator Author

ipatch commented Mar 7, 2024

unfortunately [email protected] sneaks into various environment variables during the cmake configure step. presently, not sure how to allow rubocop to either skip or ignore the offenses.

Inspecting 27 files
.....C.....................

Offenses:

Formula/[email protected]_py310.rb:148:32: C: [Correctable] FormulaAudit/PythonVersions: References to [email protected] should match the specified python dependency ([email protected])
    ENV.remove "PATH", Formula["[email protected]"].opt_prefix/"bin"
                               ^^^^^^^^^^^^^
Formula/[email protected]_py310.rb:149:32: C: [Correctable] FormulaAudit/PythonVersions: References to [email protected] should match the specified python dependency ([email protected])
    ENV.remove "PATH", Formula["[email protected]"].opt_prefix/"libexec/bin"
                               ^^^^^^^^^^^^^
Formula/[email protected]_py310.rb:150:43: C: [Correctable] FormulaAudit/PythonVersions: References to [email protected] should match the specified python dependency ([email protected])
    ENV.remove "PKG_CONFIG_PATH", Formula["[email protected]"].opt_prefix/"lib/pkgconfig"
                                          ^^^^^^^^^^^^^

27 files inspected, 3 offenses detected, 3 offenses autocorrectable

https://github.com/Homebrew/brew/blob/3d948b78031da01397168cf7a78a1d6e1b935795/Library/Homebrew/rubocops/lines.rb#L368

https://github.com/orgs/Homebrew/discussions/5182

@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch 5 times, most recently from af14c3a to 8250cf8 Compare March 13, 2024 20:22
@ipatch
Copy link
Collaborator Author

ipatch commented Mar 13, 2024

presently there is an issue with hdf5 due to the upstream (homebrew-core) hdf5 formula using cmake 🤦‍♂️
Homebrew/homebrew-core#159165
Homebrew/homebrew-core#159165 (comment)

-- Check for medfile (libmed and libmedc) ...
-- Found MEDFile: /Users/ipatch/homebrew/include
-- Found PkgConfig: /Users/ipatch/homebrew/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'
-- Unable to determine HDF5 C flags from HDF5 wrapper.
CMake Error at /Users/ipatch/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_HL_LIBRARIES) (found
  version "1.14.3")
Call Stack (most recent call first):
  /Users/ipatch/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /Users/ipatch/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/FindHDF5.cmake:1025 (find_package_handle_standard_args)
  cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:94 (find_package)
  CMakeLists.txt:58 (SetupSalomeSMESH)


-- Configuring incomplete, errors occurred!
-- Cache values

am able to work around the above issue with the below cmake code snippet,

https://github.com/FreeCAD/homebrew-freecad/blob/master/patches/freecad-0.20.2-cmake-find-hdf5.patch

-                if(NOT HDF5_FOUND)
-                    find_package(HDF5 REQUIRED)
+                if(HOMEBREW_PREFIX)
+                  set(HDF5_ROOT ${HOMEBREW_PREFIX}/opt/hdf5)
+                  message("--------------------------------------------")
+                  message("ipatch, manually set hdf5_root, cmake build of hdf5 breaks h5cc")
+                  message("--------------------------------------------")
                 else()
-                    add_compile_options(${HDF5_CFLAGS})
-                    link_directories(${HDF5_LIBRARY_DIRS})
-                    link_libraries(${HDF5_LIBRARIES})
-                    find_file(Hdf5dotH hdf5.h PATHS ${HDF5_INCLUDE_DIRS} NO_DEFAULT_PATH)
-                    if(NOT Hdf5dotH)
-                        message( FATAL_ERROR "${HDF5_VARIANT} development header not found.")
-                    endif()
-                endif()
-                check_include_file_cxx(hdf5.h HDF5_FOUND)
-                if(NOT HDF5_FOUND)
-                    message( FATAL_ERROR "hdf5.h was not found.")
+                  if(NOT HDF5_FOUND)
+                      find_package(HDF5 REQUIRED CONFIG)
+                  else()
+                      add_compile_options(${HDF5_CFLAGS})
+                      link_directories(${HDF5_LIBRARY_DIRS})
+                      link_libraries(${HDF5_LIBRARIES})
+                      find_file(Hdf5dotH hdf5.h PATHS ${HDF5_INCLUDE_DIRS} NO_DEFAULT_PATH)
+                      if(NOT Hdf5dotH)
+                          message( FATAL_ERROR "${HDF5_VARIANT} development header not found.")
+                      endif()
+                  endif()
+                  check_include_file_cxx(hdf5.h HDF5_FOUND)
+                  if(NOT HDF5_FOUND)
+                      message( FATAL_ERROR "hdf5.h was not found.")
+                  endif()

@ipatch ipatch self-assigned this Mar 13, 2024
@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch 3 times, most recently from 1bd0eaf to fa0446c Compare March 14, 2024 20:14
@ipatch
Copy link
Collaborator Author

ipatch commented Mar 14, 2024

build error due to qt version 6 being installed.

https://github.com/FreeCAD/homebrew-freecad/actions/runs/8287012887/job/22678355704#step:17:5240

@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch 8 times, most recently from afd318d to 58ca312 Compare March 18, 2024 01:04
@ipatch
Copy link
Collaborator Author

ipatch commented Mar 18, 2024

from what i can tell upstream homebrew-core vtk uses qt which homebrew-core has set qt to version 6. and installing vtk puts qt in the system path thus breaking the build process. so to get around this i have disable certain cmake features and ignore certain paths. then have to manually add back certain paths to avoid the qt 6 installation. all this should allow freecad to build (haven't fully tested yet) without having to unlink qt use the upstream homebrew-core qt@5 formula without force linking it.

@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch from 58ca312 to 32db493 Compare March 18, 2024 17:22
@ipatch
Copy link
Collaborator Author

ipatch commented Mar 18, 2024

@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch 3 times, most recently from 8de44aa to 1ad0ebd Compare March 19, 2024 22:59
@ipatch
Copy link
Collaborator Author

ipatch commented Mar 20, 2024

presently, i've been able to build and install freecad based on this formula from a m1 testing box. but unfortunately freecad crashes or fails to launch with the below error,

dyld[75204]: Library not loaded: @rpath/libFreeCADGui.dylib
  Referenced from: <3A9A70C7-7298-3E28-A632-11BEF8A8C1B5> /Users/chris/homebrew/Cellar/[email protected]_py310/0.20.2/MacOS/FreeCAD
  Reason: no LC_RPATH's found
[1]    75204 abort      $bp/opt/[email protected]_py310/MacOS/FreeCAD -l

will continue to research

@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch from 1ad0ebd to 30dba75 Compare March 21, 2024 00:21
@ipatch
Copy link
Collaborator Author

ipatch commented Mar 21, 2024

adding the below cmake var seems to resolve the no LC_RPATH's found but I'm sitll dealing with a crash on launch, requiring further investigation.

-DCMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool

the install_name_tool is specific to macos, and i do not think it will effect a gnu+linux build 🤞

@ipatch
Copy link
Collaborator Author

ipatch commented Apr 23, 2024

readd formula llvm to cmake_prefix_path in attempt to resolve the below error.

brew linkage --test freecad/freecad/[email protected]_py310
==> FAILED
Full linkage --test freecad/freecad/[email protected]_py310 output
  Broken dependencies:
    /opt/homebrew/opt/llvm/lib/libunwind.1.dylib (llvm)

@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch 4 times, most recently from b6f4059 to ba540ba Compare April 27, 2024 18:40
@ipatch ipatch force-pushed the freecad.0.20.2-py310 branch from ba540ba to 5170afd Compare April 28, 2024 22:04
@ipatch ipatch added the pr-pull label Apr 29, 2024
@github-actions github-actions bot closed this in 8491128 Apr 29, 2024
@ipatch ipatch deleted the freecad.0.20.2-py310 branch May 3, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant