Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 395
    • Issues 395
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 27
    • Merge requests 27
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2256
Closed
Open
Created Dec 07, 2020 by Hans-Nikolai Viessmann@hansOwner

MacOS sysroot path is to specific, highly dependent on Xcode version

When compiling sac2c on MacOS, we append to CCFLAGS the -isysroot flag to the CMake variable CMAKE_OSX_SYSROOT. This is needed so that when using sac2c we are able to find C-libraries and other system libraries. We store CCFLAGS in the sac2crc files.

It is not clear to me, but for whatever reason the CMAKE_OSX_SYSROOT variable resolves to a path which is Xcode version specific, e.g. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk. This can cause problems whenever a newer version of Xcode is installed. MacOS PKG files have no notion of inter-dependency --- it is not a package manager as such.

Furthermore, if there are multiple versions of Xcode on the system, then we are totally doomed. This was experienced in Stdlib PR 44.

It is not clear to me how best to resolve this, here are a few idea:

  • there seems to be a generic sysroot path, of the form /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk, but its not clear to me if this is dependable enough to rely on it.
  • another is to poll for it when calling sac2c, using xcode-select --print-path or similar.
  • as this path is encoded in the sac2crc files, we just need to update this. This could be possible as part of the CPack productbuild process using the CPACK_POSTFLIGHT_<COMP>_SCRIPT variable to set a script which looks for the correct path, and updates the sac2crc files during install.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking