Skip to content

Fix build with newer CMake and LLVM versions. #41

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cassandras-lies
Copy link

This is needed to build on Mac now.

@julian-CStack
Copy link
Collaborator

Current main branch should work fine on recent macos unless Apple has pushed updates in the last week that change that.
I did notice https://github.com/cassandras-lies/flutter_libsparkmobile/tree/fix-build is 17 commits behind cypherstack:main

@cassandras-lies
Copy link
Author

cassandras-lies commented Apr 11, 2025

Yes, it broke for me within the last week. Try brew update && brew upgrade. It's actually an upgrade to cmake 4.0.0 in brew and then the Apple update to clang version 17.0.0

~/Code/cflsm/scripts/macos $ git show --oneline -1                                                                                                                                                                    
e8c5026 (HEAD -> main, origin/main, origin/HEAD) Merge pull request #40 from cypherstack/win-patch-fix
~/Code/cflsm/scripts/macos $ ./build_all.sh
-- The C compiler identification is AppleClang 17.0.0.17000013
-- The CXX compiler identification is AppleClang 17.0.0.17000013
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: ~/.bin/cc - 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: ~/.bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
~/Code/cflsm/src/deps/boost-cmake ~/Code/cflsm
~/Code/cflsm
CMake Warning (dev) at /opt/homebrew/share/cmake/Modules/FetchContent.cmake:1373 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  deps/boost-cmake/CMakeLists.txt:10 (FetchContent_Declare)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Fetching Boost
CMake Warning (dev) at /opt/homebrew/share/cmake/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(Boost) is deprecated, call
  FetchContent_MakeAvailable(Boost) instead.  Policy CMP0169 can be set to
  OLD to allow FetchContent_Populate(Boost) to be called directly for now,
  but the ability to call it with declared details will be removed completely
  in a future version.
Call Stack (most recent call first):
  deps/boost-cmake/CMakeLists.txt:19 (FetchContent_Populate)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Fetching Boost - done
-- Removing: ~/Code/cflsm/scripts/macos/build/_deps/boost-src/boost/thread/pthread/thread_data.hpp
-- Copying: ~/Code/cflsm/src/deps/boost-cmake/../thread_data.hpp to ~/Code/cflsm/scripts/macos/build/_deps/boost-src/boost/thread/pthread
-- Boost found: 1.71.0 ~/Code/cflsm/scripts/macos/build/_deps/boost-src
-- Looking for __linux__
-- Looking for __linux__ - not found
-- Looking for _WIN32
-- Looking for _WIN32 - not found
-- Looking for __APPLE__
-- Looking for __APPLE__ - found
-- Looking for __ANDROID__
-- Looking for __ANDROID__ - not found
-- Looking for __FreeBSD__
-- Looking for __FreeBSD__ - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- The ASM compiler identification is AppleClang
-- Found assembler: ~/.bin/cc
-- Found BZip2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libbz2.tbd (found version "1.0.8")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libz.tbd (found version "1.2.12")
-- Failed to find all ICU components (missing: ICU_LIBRARY uc dt i18n) (found version "76.1")
-- Found iconv library: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libiconv.tbd
-- Checking for module 'mpi-c'
--   Package 'mpi-c' not found
-- Checking for module 'mpi-cxx'
--   Package 'mpi-cxx' not found
CMake Error at deps/openssl-cmake/CMakeLists.txt:26 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.


-- Configuring incomplete, errors occurred!
cp: flutter_libsparkmobile.framework: No such file or directory

julian-CStack
julian-CStack previously approved these changes Apr 16, 2025
Copy link
Collaborator

@julian-CStack julian-CStack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Works on updated macOS system. Needs to be double checked on other platforms so I will leave open for now

@julian-CStack julian-CStack self-requested a review April 16, 2025 20:53
@julian-CStack julian-CStack dismissed their stale review April 16, 2025 20:54

Looks like there are issues on windows. The patches aren't playing nice from a brief glance at the output.

@julian-CStack
Copy link
Collaborator

@sneurlax if you have the debug output saved still please link/post here.

@sneurlax
Copy link
Member

sneurlax commented Apr 16, 2025

@cassandras-lies I get this error, revolving error MSB8066: https://gist.github.com/sneurlax/41d54b4f34fcf97def234be66fda1986

@julian-CStack
Copy link
Collaborator

@cassandras-lies I get this error, revolving error MSB8066: https://gist.github.com/sneurlax/41d54b4f34fcf97def234be66fda1986

The failure to apply patches is inconsequential, the same error occurs on a fresh clone.

I believe the failure to apply patches earlier in the build process is what you are referring to and those don't appear in that gist.

It looks like the apply_patches is failing in cmake https://gist.github.com/sneurlax/41d54b4f34fcf97def234be66fda1986#file-gistfile1-txt-L205-L227

@cassandras-lies
Copy link
Author

I've updated the patch so it will work without errors, including on Windows though I haven't tried it there. Note that running ./scripts/prebuild.{sh,bat} will reset and clean source directories to those specified in .gitmodules; if you'd prefer dirty directories be unpatched, tell me and I'll update it to do that instead.

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.

3 participants