Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,326
    • Issues 4,326
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 390
    • Merge Requests 390
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18446

Closed
Open
Opened Jul 14, 2020 by Matthias Andreas Benkard@benkard

System frameworks cannot be loaded on macOS Big Sur

Summary

When running on macOS Big Sur, attempting to load a system framework at runtime fails with a not found error.

Steps to reproduce

Create a file called Main.hs with the following content:

module Main where

main = putStrLn "Hi."

Run it with runghc, passing -framework OpenGL to GHC:

runghc --ghc-arg="-framework OpenGL" Main.hs

Expected behavior

The program should run and say hi.

Environment

  • GHC version used: 8.10.1
  • Operating System: macOS 10.16 Big Sur (20A4300b)
  • System Architecture: x86_64

Proposed Fix

Merge request !3689 (closed) is a proposed fix.

Remarks

This is presumably due to the following change in macOS Big Sur:

New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

(https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes/)

The fix proposed above implements the behavior suggested there.

Edited Jul 14, 2020 by Matthias Andreas Benkard
Assignee
Assign to
8.10.3
Milestone
8.10.3
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#18446