darlinghq / darling

Darwin/macOS emulation layer for Linux
http://www.darlinghq.org
GNU General Public License v3.0
11.55k stars 446 forks source link

invalid version number in '-mmacosx-version-min=11.0' #1419

Closed fzoric8 closed 1 year ago

fzoric8 commented 1 year ago

Build Log What is the build error?

[  0%] Building C object src/libsimple-darling/CMakeFiles/libsimple_darling.dir/src/lock.c.o
clang: error: invalid version number in '-mmacosx-version-min=11.0'
make[2]: *** [src/libsimple-darling/CMakeFiles/libsimple_darling.dir/build.make:76: src/libsimple-darling/CMakeFiles/libsimple_darling.dir/src/lock.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:14194: src/libsimple-darling/CMakeFiles/libsimple_darling.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

System Information

Software Version
Clang clang version 10.0.0-4ubuntu1
CMake 3.27.20230820-gdcdc80c
Linux Kernel 5.15.0-78-generic
Darling 9d2984bd
Linux Ubuntu 20.04.
CuriousTommy commented 1 year ago

Does Ubuntu 18.04 offer clang 11? Looks like the macOS 11 version number was added in clang 11.

fzoric8 commented 1 year ago

I'm sorry, I've written wrong, my Ubuntu version is 20.04. But I'm not sure what's causing this error?

CuriousTommy commented 1 year ago

@fzoric8 It's your clang version, it's too old. Try using version 11 or later.

bugaevc commented 1 year ago

Could we perhaps do something about this on our side? Like if we detect older Clang, pass an older macosx-version-min?

CuriousTommy commented 1 year ago

I disagree. I believe there is a point where people should move on from older distros/compilers. Plus it will cause some newer apps to stop working.

fzoric8 commented 1 year ago

Hi @CuriousTommy, I'm using 20.04 and I would argue with the fact that current 22.04 distro is currently not ready for certain stuff I'm using/developing atm. I could consider that comment seriously if I had 14.04 or something like that.

I'm not sure how this error message relate to the clang version because there's no trace of the clang in the error message.

Besides that, I would also like to point out that following official instructions didn't install llvm-distutils, and I had to install it manually.

It would also be nice to specify which version of the CMake is needed to succesfuly build darling because 3.16 was not sufficient, and I had to update to the newest CMake and build it from source.

Bear in mind that I have few years of experience with building software such as darling, and that many of the beginners, may not be that skilled and may give up because of unclear error build messages.

Maybe, and just maybe, there should be more clear warning message which gives hint or idea which clang should be used, and this issue wouldn't exist.

Cheers.

CuriousTommy commented 1 year ago

Hi @CuriousTommy, I'm using 20.04 and I would argue with the fact that current 22.04 distro is currently not ready for certain stuff I'm using/developing atm. I could consider that comment seriously if I had 14.04 or something like that.

I setup a Ubuntu 20.04 VM just to be sure, clang-11 and clang-12 are provided, so you should be fine if you install those versions (The default clang is clang version 10.0.0-4ubuntu1, so the docs will need to be updated to use clang-11 or 12 instead of clang).

user@user-Standard-PC-Q35-ICH9-2009:~$ apt-cache search clang | grep "C, C++ and Objective-C compiler"
clang - C, C++ and Objective-C compiler (LLVM based)
clang-10 - C, C++ and Objective-C compiler
clang-10-doc - C, C++ and Objective-C compiler - Documentation
clang-6.0 - C, C++ and Objective-C compiler
clang-7 - C, C++ and Objective-C compiler
clang-8 - C, C++ and Objective-C compiler
clang-8-doc - C, C++ and Objective-C compiler - Documentation
clang-9 - C, C++ and Objective-C compiler
clang-9-doc - C, C++ and Objective-C compiler - Documentation
libclang1 - C, C++ and Objective-C compiler (LLVM based)
clang-11 - C, C++ and Objective-C compiler
clang-11-doc - C, C++ and Objective-C compiler - Documentation
clang-12 - C, C++ and Objective-C compiler
clang-12-doc - C, C++ and Objective-C compiler - Documentation

Besides that, I would also like to point out that following official instructions didn't install llvm-distutils, and I had to install it manually.

Okay, I'll add that in the docs. But in the future, I recommend submitting a PR if you find any issues with the install instruction. We don't always have the man-power to keep all of our instructions up to date.

It would also be nice to specify which version of the CMake is needed to successfully build darling because 3.16 was not sufficient, and I had to update to the newest CMake and build it from source.

Do you recall what errors you encountered with cmake (before you updated it).

Maybe, and just maybe, there should be more clear warning message which gives hint or idea which clang should be used, and this issue wouldn't exist.

@bugaevc What I could do instead is remove the old clang version and force a CMake error if CMAKE_C_COMPILER or CMAKE_CXX_COMPILER. Would you be fine with that?

bugaevc commented 1 year ago

Maybe, and just maybe, there should be more clear warning message which gives hint or idea which clang should be used, and this issue wouldn't exist.

@bugaevc What I could do instead is remove the old clang version and force a CMake error if CMAKE_C_COMPILER or CMAKE_CXX_COMPILER. Would you be fine with that?

This isn't me you're quoting, but yes, if you think we should drop support for older versions of Clang (which I wouldn't be thrilled about, but then I'm also not volunteering to maintain the support), this is the way to go.

fzoric8 commented 1 year ago

@CuriousTommy wow, thanks for the fast and detailed response. Regarding PR, will do, I didn't know what was the contribution policy.

If I'm remembed correctly CMake 3.16. couldn't find REAL_PATH (or something quite similar). If I could guess I would say that something has change from the side of CMake from versions 3.16 to the newest version in following: command1, command2.

CuriousTommy commented 1 year ago

@fzoric8 Try out my ubuntu_20.04_adjustments branch. Let me know if it does/does not work well on your end. It should work with the CMake version that comes with Ubuntu 20.04.

Regarding PR, will do, I didn't know what was the contribution policy.

We don't have a strict contribution policy, sometimes we make updates ourselves, other times we accept other people PR. It's just that we don't always have the man power to keep our instructions up to date.

Besides that, I would also like to point out that following official instructions didn't install llvm-distutils, and I had to install it manually.

It turns out that llvm-distutils is actually an optional dependency (it only useful for people who want to do debug builds of Darling). But I'll still add it in after I make sure the ubuntu_20.04_adjustments works for you.

CuriousTommy commented 1 year ago

The changes have been merged in and the wiki was updated.