title: "macOS_SDK_headers_for_macOS_10.14.pkg is incompatible with this version of macOS" while installing Haskell on OS X mojave
body: <p>While running the following code block,</p>
  
  <pre><code>$ cd /Library/Developer/CommandLineTools/Packages/
  $ open macOS_SDK_headers_for_macOS_10.14.pkg
  </code></pre>
  
  <p>The installer warned </p>
  
  <blockquote>
    <p>This package is incompatible with this version of macOS and may fail to install.</p>
  </blockquote>
  
  <p>And when I choose 'Install Anyway', it fails.</p>
  
  <p>How can I possibly get it work?</p>
  
  <p>Some possibly relevant environmental versions:<br>
      OS: macOS 10.14.5<br>
      xcodebuild -version: Xcode 11.2.1<br>
      gcc --version: gcc (Homebrew GCC 9.2.0_1) 9.2.0  </p>
  
  <p>Bigger Context: 
  I was setting up haskellstack, following instructions on <a href="https://docs.haskellstack.org/en/stable/install_and_upgrade/" rel="noreferrer">https://docs.haskellstack.org/en/stable/install_and_upgrade/</a> </p>
  
  <p>while running <code>$ stack setup</code> I came accross </p>
  
  <blockquote>
    <p>configure: error: in '~/.stack/programs/x86_64-osx/ghc-8.6.5.temp/ghc-8.6.5':<br>
    configure: error: C compiler cannot create executables<br>
    See 'config.log' for more details<br>
    Received ExitFailure 77 when running  </p>
  </blockquote>
  
  <p>and per the Notes section of the instructions, I ran  </p>
  
  <pre><code>$ xcode-select --install
  </code></pre>
  
  <p>and it says</p>
  
  <blockquote>
    <p>xcode-select: error: command line tools are already installed, use "Software Update" to install updates</p>
  </blockquote>
  
  <p>And then (following the same instructions) I ran</p>
  
  <pre><code>$ cd /Library/Developer/CommandLineTools/Packages/
  $ open macOS_SDK_headers_for_macOS_10.14.pkg
  </code></pre>