debauchee / barrier

Open-source KVM software
Other
27.14k stars 1.5k forks source link

macOS Catalina 10.15.5 build clean_build.sh not working, pthread.h not found #756

Open kittydoor opened 4 years ago

kittydoor commented 4 years ago

Operating Systems

Server: Linux

Client: macOS Catalina 10.15.5

Barrier Version

master

Steps to reproduce bug

  1. Install Xcode from App store
  2. brew install qt5 openssl pkg-config
  3. git clone && cd barrier && ./clean_build.sh
  4. Error
...
--- Check size of short - done
--- Looking for pthread.h
--- Looking for pthread.h - not found
CMake Error at /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Threads (missing: Threads_FOUND)
...
--- Configuring incomplete, errors occurred!

Other info

Latest commit at time of issue: 2393393b8897df2e18ff8a4a1754161084da2b5e

shymega commented 4 years ago

OK, I need to do further testing, as it might be that that the version of Xcode now available doesn't quite work with Barrier anymore. Not totally sure yet.

In the meantime, here's a link to an archive built by our CI for macOS. You will need to extract it, and install the Barrier-2.3.2-Release.dmg package within. This is built straight from master, so give that a go in the interim.

Thanks.

p12tic commented 4 years ago

I haven't tested on this macOS version, but I somehow suspend that command line tools have not been installed. @kittydoor could you try to launch Xcode itself? It should prompt to install any additional packages needed for full functionality.

simons-public commented 4 years ago

Looks like an issue with the toolchain, the pthread header should be installed with Xcode in the MacOSX sdk:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h
kittydoor commented 4 years ago

@p12tic

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
kittydoor commented 4 years ago

@simons-public

Files in relevant dirs ``` $ ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ AppleTextureEncoder.h dtrace.h menu.h spawn.h AssertMacros.h editline miscfs sqlite3.h Availability.h err.h module.modulemap sqlite3ext.h AvailabilityInternal.h errno.h monetary.h stab.h AvailabilityMacros.h eti.h monitor.h standards.h AvailabilityVersions.h execinfo.h mpool.h stddef.h Block.h expat.h nameser.h stdint.h CommonCrypto expat_external.h nc_tparm.h stdio.h ConditionalMacros.h fcntl.h ncurses.h stdlib.h Darwin.apinotes fenv.h ncurses_dll.h strhash.h EndpointSecurity ffi ndbm.h string.h MacTypes.h float.h net stringlist.h NSSystemDirectories.h fmtmsg.h net-snmp strings.h TargetConditionals.h fnmatch.h netdb.h struct.h Xplugin.h form.h netinet sys __cxxabi_config.h fsproperties.h netinet6 sysdir.h __wctype.h fstab.h netkey sysexits.h _ctermid.h fts.h nfs syslog.h _ctype.h ftw.h nl_types.h tar.h _locale.h get_compat.h nlist.h tcl.h _regex.h gethostuuid.h notify.h tclDecls.h _stdio.h getopt.h notify_keys.h tclPlatDecls.h _types glob.h ntsid.h tclTomMath.h _types.h grp.h objc tclTomMathDecls.h _wctype.h gssapi odmodule term.h _xlocale.h gssapi.h os term_entry.h aio.h hfs panel.h termcap.h aliasdb.h hid paths.h termios.h alloca.h histedit.h pcap tgmath.h apache2 i386 pcap-bpf.h tic.h apr-1 iconv.h pcap-namedb.h tidy ar.h ifaddrs.h pcap.h time.h architecture inttypes.h pexpert timeconv.h arpa iso646.h php tk.h asl.h kern poll.h tkDecls.h assert.h krb5 printerdb.h tkIntXlibDecls.h atm krb5.h printf.h tkMacOSX.h bank langinfo.h profile.h tkPlatDecls.h bitstring.h launch.h protocols ttyent.h bootparams.h lber.h pthread tzfile.h bootstrap.h lber_types.h pthread.h ucontext.h bsm ldap.h pthread_impl.h ulimit.h bzlib.h ldap_cdefs.h pthread_spis.h unctrl.h cache.h ldap_features.h pwd.h unistd.h cache_callbacks.h ldap_schema.h python2.7 unwind.h checkint.h ldap_utf8.h ranlib.h util.h com_err.h ldif.h readline utime.h complex.h libc.h readpassphrase.h utmp.h compression.h libcharset.h regex.h utmpx.h copyfile.h libexslt removefile.h uuid corpses libgen.h resolv.h vfs cpio.h libkern rpc vis.h crt_externs.h libproc.h rpcsvc voucher ctype.h libunwind.h rune.h vproc.h cups libxml runetype.h wchar.h curl libxml2 sandbox.h wctype.h curses.h libxslt sasl wordexp.h cxxabi.h limits.h sched.h xar db.h localcharset.h search.h xattr_flags.h default_pager locale.h secure xcselect.h device mach security xlocale dirent.h mach-o semaphore.h xlocale.h disktab.h mach_debug servers xpc dispatch machine setjmp.h zconf.h dlfcn.h malloc sgtty.h zlib.h dns.h math.h signal.h dns_sd.h membership.h simd $ ls -l /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h lrwxr-xr-x 1 root wheel 17 May 22 10:25 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h -> pthread/pthread.h $ ls -l /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread/ total 48K -rw-r--r-- 1 root wheel 4.2K Feb 29 07:25 introspection.h -rw-r--r-- 1 root wheel 19K Feb 29 07:25 pthread.h -rw-r--r-- 1 root wheel 2.0K Feb 29 07:25 pthread_impl.h -rw-r--r-- 1 root wheel 3.6K Feb 29 07:25 pthread_spis.h -rw-r--r-- 1 root wheel 11K Feb 29 07:25 qos.h -rw-r--r-- 1 root wheel 1.4K Feb 29 07:25 sched.h -rw-r--r-- 1 root wheel 2.7K Feb 29 07:25 spawn.h -rw-r--r-- 1 root wheel 2.1K Feb 29 07:25 stack_np.h ```

From my understanding, everything looks good? I'm not sure why Cmake is not liking it. Maybe some environment variables are being overridden by me that is causing the issue?

Testing this theory with bash (which I have not made any modifications to the rc of, just updated via brew, the error is the same.

Building with Bash ``` bash-5.0$ ls Build.properties LICENSE azure-pipelines build_installer.bat cmake doc pre-build.bat src CMakeLists.txt README.md azure-pipelines.yml clean_build.bat debian ext res ChangeLog _config.yml build clean_build.sh dist osx_environment.sh snap bash-5.0$ ./clean_build.sh Modifying environment for Barrier build... /usr/local/bin/brew Detected Homebrew done Starting Barrier Debug build... CMake Warning at /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/Platform/Darwin-Initialize.cmake:221 (message): Ignoring CMAKE_OSX_SYSROOT value: /Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk because the directory does not exist. Call Stack (most recent call first): /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:21 (include) CMakeLists.txt:19 (project) -- The C compiler identification is AppleClang 11.0.3.11030032 -- The CXX compiler identification is AppleClang 11.0.3.11030032 -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Full Barrier version string is '2.3.2-snapshot-snapshot.b1-2393393b' -- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") -- Looking for C++ include istream -- Looking for C++ include istream - not found -- Looking for C++ include ostream -- Looking for C++ include ostream - not found -- Looking for C++ include sstream -- Looking for C++ include sstream - not found -- Looking for include file inttypes.h -- Looking for include file inttypes.h - not found -- Looking for include file locale.h -- Looking for include file locale.h - not found -- Looking for include file memory.h -- Looking for include file memory.h - not found -- Looking for include file stdlib.h -- Looking for include file stdlib.h - not found -- Looking for include file strings.h -- Looking for include file strings.h - not found -- Looking for include file string.h -- Looking for include file string.h - not found -- Looking for include file sys/select.h -- Looking for include file sys/select.h - not found -- Looking for include file sys/socket.h -- Looking for include file sys/socket.h - not found -- Looking for include file sys/stat.h -- Looking for include file sys/stat.h - not found -- Looking for include file sys/time.h -- Looking for include file sys/time.h - not found -- Looking for include file sys/utsname.h -- Looking for include file sys/utsname.h - not found -- Looking for include file unistd.h -- Looking for include file unistd.h - not found -- Looking for include file wchar.h -- Looking for include file wchar.h - not found -- Looking for getpwuid_r -- Looking for getpwuid_r - found -- Looking for gmtime_r -- Looking for gmtime_r - found -- Looking for nanosleep -- Looking for nanosleep - found -- Looking for poll -- Looking for poll - found -- Looking for sigwait -- Looking for sigwait - found -- Looking for strftime -- Looking for strftime - found -- Looking for vsnprintf -- Looking for vsnprintf - found -- Looking for inet_aton -- Looking for inet_aton - found -- Looking for sys/types.h -- Looking for sys/types.h - not found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of char -- Check size of char - done -- Check size of int -- Check size of int - done -- Check size of long -- Check size of long - done -- Check size of short -- Check size of short - done -- Looking for pthread.h -- Looking for pthread.h - not found CMake Error at /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE) /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:128 (find_package) -- Configuring incomplete, errors occurred! See also "/Users//Documents/Git/barrier/build/CMakeFiles/CMakeOutput.log". See also "/Users//Documents/Git/barrier/build/CMakeFiles/CMakeError.log". bash-5.0$ ```
shymega commented 4 years ago

Hm, interesting. I did come across a Stackoverflow page about cmake not finding pthread.h on Mojave..

simons-public commented 4 years ago

@kittydoor Can you try building without the clean_build.sh script?

mkdir tempbuild
cd tempbuild
cmake -DCMAKE_BUILD_TYPE=Release ..
make

CMake builds just fine on my machine without a lot of the variables set in clean_build.sh and osx_environment.sh (as long as the prerequisites are installed). I am using macports though, so I can't say for sure that it will work that way with homebrew.

If it works fine that might indicate an issue in the script, if it fails at least we can rule it out a problem with those scripts and go from there.

Also, what version of Xcode do you have installed?

kittydoor commented 4 years ago

@simons-public

Manual build ```sh $ mkdir tempbuild $ cd tempbuild $ cmake -DCMAKE_BUILD_TYPE=Release .. -- The C compiler identification is AppleClang 11.0.3.11030032 -- The CXX compiler identification is AppleClang 11.0.3.11030032 -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Full Barrier version string is '2.3.2-snapshot-snapshot.b1-2393393b' -- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") -- Looking for C++ include istream -- Looking for C++ include istream - found -- Looking for C++ include ostream -- Looking for C++ include ostream - found -- Looking for C++ include sstream -- Looking for C++ include sstream - found -- Looking for include file inttypes.h -- Looking for include file inttypes.h - found -- Looking for include file locale.h -- Looking for include file locale.h - found -- Looking for include file memory.h -- Looking for include file memory.h - found -- Looking for include file stdlib.h -- Looking for include file stdlib.h - found -- Looking for include file strings.h -- Looking for include file strings.h - found -- Looking for include file string.h -- Looking for include file string.h - found -- Looking for include file sys/select.h -- Looking for include file sys/select.h - found -- Looking for include file sys/socket.h -- Looking for include file sys/socket.h - found -- Looking for include file sys/stat.h -- Looking for include file sys/stat.h - found -- Looking for include file sys/time.h -- Looking for include file sys/time.h - found -- Looking for include file sys/utsname.h -- Looking for include file sys/utsname.h - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file wchar.h -- Looking for include file wchar.h - found -- Looking for getpwuid_r -- Looking for getpwuid_r - found -- Looking for gmtime_r -- Looking for gmtime_r - found -- Looking for nanosleep -- Looking for nanosleep - found -- Looking for poll -- Looking for poll - found -- Looking for sigwait -- Looking for sigwait - found -- Looking for strftime -- Looking for strftime - found -- Looking for vsnprintf -- Looking for vsnprintf - found -- Looking for inet_aton -- Looking for inet_aton - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of char -- Check size of char - done -- Check size of int -- Check size of int - done -- Check size of long -- Check size of long - done -- Check size of short -- Check size of short - done -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Found CURL: /usr/lib/libcurl.dylib (found version "7.64.1") -- Configuring directory /Users//Documents/Git/barrier/tempbuild/bundle -- Copying file Barrier.app/Contents/PkgInfo -- Copying file Barrier.app/Contents/Resources/Barrier.icns -- Copying file reref_dylibs.sh -- Configuring file Barrier.app/Contents/Info.plist -- Configuring file build_dist.sh -- Configuring file build_installer.sh CMake Error at src/gui/CMakeLists.txt:3 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/Users//Documents/Git/barrier/tempbuild/CMakeFiles/CMakeOutput.log". $ brew install qt5 Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae amp doctest hasura-cli nest pwncat ==> Updated Formulae abcm2ps broot devspace git-extras javacc mdcat phpstan spotbugs aliyun-cli calicoctl dhall gitlab-runner juju menhir phpunit swiftgen allure cbmc diamond gor katago minio plantuml switch-lan-play alot cfn-lint diffoscope gpac kettle minio-mc pnpm tcping alpine chapel dvc harfbuzz keystone mockolo prometheus tnftp ansible check eslint haxe libgweather mutt proteinortho toot auditbeat clojure-lsp exploitdb heartbeat libphonenumber neomutt rancher-cli topgrade aws-cdk consul fdroidserver hledger libpulsar open-image-denoise rke wabt awscli contentful-cli filebeat hlint librdkafka openblas robotfindskitten watchexec awscli@1 corsixth fuse-zip httpie libtorch opendetex rsync whistle babel crystal gatsby-cli imagemagick libwebsockets openstackclient scipy wslay balena-cli dav1d genometools imagemagick@6 logstash packetbeat sentencepiece yle-dl bde deno ghq ipfs lynis percona-xtrabackup skopeo berglas desktop-file-utils git-annex janet mavsdk perltidy sparse ==> Updated Casks abscissa craftmanager hazeover matterhorn psi-plus splashtop-streamer abstract curio hbuilderx melodics publish-or-perish springtoolsuite airmedia datadog-agent hyperswitch middle qgis squeak amazon-chime detectx-swift imazing min qownnotes stella araxis-merge dictionaries insync netron qsync-client subsurface archipelago dynobase jamf-migrator nosqlbooster-for-mongodb qtum syncplay atext electerm joplin orka quicksync tiled avira-antivirus elpass kext-updater pagico retroarch tribler beekeeper-studio epichrome keymanager paletro ripcord universal-media-server bitwig-studio exodus kite pdf-squeezer screenflow vivaldi browserosaurus fork kitty pext scrutiny vscodium burp-suite freac kui portfolioperformance seadrive wickrme busycal funter ledger-live postbox securesafe xcodeclangformat cacher geotag local postman sejda-pdf yyets chromium grandperspective loom prepros sim-daltonism codespace grandtotal mark-text proclaim sonic-visualiser Warning: qt 5.15.0 is already installed and up-to-date To reinstall 5.15.0, run `brew reinstall qt` ```

Xcode Version 11.5 (11E608c) xcode-select version 2373.

We appear to have made progress, which means the script does seem to be at least partially guilty. However, I'm unsure why Cmake is now having issues with finding Qt5 libs.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.

p12tic commented 3 years ago

Let's not close valid bugs without a valid reason.

hakan-theren commented 3 years ago

I had to change my xcode path in clean_build.sh from:

B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"

to

B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"

go8ose commented 3 years ago

I had to change my xcode path in clean_build.sh from:

B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"

to

B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"

I found the same was true on macOS Big Sur 11.4.

In case it's relevant, I was using cmake 3.21.1 from homebrew.