clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.3'

Mojca Miklavec mojca at macports.org
Sat May 1 11:33:29 UTC 2021


Hi,

On Sat, 1 May 2021 at 12:22, Joshua Root wrote:
>
> This usually indicates that your Command Line Tools are outdated. If
> Software Update won't update them, you are affected by an Apple bug, and
> will need to follow the instructions here:
> <https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt>

I wasn't experiencing the exact same problem, but it might be related,
and I'm confused.

Basically my problems started after I upgraded Big Sur and rebooted
two days ago. I never installed Xcode, only the command-line tools.

I had a repository that would be automatically built with CMake &
Ninja (triggered via buildbot). The problem can be summarized as [1]:

/Library/Developer/CommandLineTools/usr/bin/cc test.c -o test
test.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.

(Note that just "clang test.c -o test" works just fine.)

Curiously it helped when I made a clean checkout of the repository
without doing anything else. Apparently CMake picked the compiler in a
different way then(???), I have no clue [2].

I initially planned to somewhat ignore the problem I had earlier, but
then MacPorts started pointing me to the above link on the Trac about
how to reinstall CLT. I followed the steps. It downloaded 1 GB of
stuff, and (as expected) kept saying that I needed to update CLT for
Xcode 12.4 and 12.5 even after the download was completed. I tried
running it again, just in case, but I never actually saw anything
being updated, I just saw the files being downloaded (it took too long
to watch till the end) and when I came back to the computer,
everything was as if nothing had happened, just prompting me to
install the two updates again.

I believe that MacPorts stopped complaining about broken CLT, but the
above command that initially failed
    /Library/Developer/CommandLineTools/usr/bin/cc test.c -o test
still fails to work.

I'm just totally confused.

Mojca


[1] https://build.contextgarden.net/#/builders/92/builds/35
[2] https://build.contextgarden.net/#/builders/92/builds/36


More information about the macports-users mailing list