<HTML><BODY><br>Fixed Mojave Mac build with MACOSX_DEPLOYMENT_TARGET<br> environment setup. Specified the minimum version of OS X<br> on which the target binaries are to be deployed. CMake<br> uses this value for the make environment and the<br> -mmacosx-version-min flag to help choose the default SDK<br> <br> Fixed #3757<br> ---<br>  .travis.mk | 5 +++++<br>  .travis.yml | 11 ++++++++---<br>  cmake/luajit.cmake | 15 ++++++++++++---<br>  3 files changed, 25 insertions(+), 6 deletions(-)<br> <br> diff --git a/.travis.mk b/.travis.mk<br> index edd94cd7d..fd93ef1b9 100644<br> --- a/.travis.mk<br> +++ b/.travis.mk<br> @@ -47,6 +47,11 @@ test_ubuntu: deps_ubuntu<br>  deps_osx:<br>   brew update<br>   brew install openssl readline curl icu4c --force<br> + virtualenv -h >/dev/null 2>&1 || \<br> + ( pip -h >/dev/null 2>&1 || \<br> + ( curl --silent --show-error --retry 5 <a href="https://bootstrap.pypa.io/get-pip.py" rel="noopener" target="_blank" data-mce-href="https://bootstrap.pypa.io/get-pip.py">https://bootstrap.pypa.io/get-pip.py</a> | python && \<br> + pip --version ) && \<br> + pip install virtualenv )<br>  <br>  test_osx: deps_osx<br>   cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfoWError ${CMAKE_EXTRA_PARAMS}<br> diff --git a/.travis.yml b/.travis.yml<br> index ffe2e8247..8a118a7f2 100644<br> --- a/.travis.yml<br> +++ b/.travis.yml<br> @@ -8,7 +8,7 @@ language: cpp<br>  os: linux<br>  compiler: gcc<br>  <br> -osx_image: xcode9<br> +osx_image: xcode10.2<br>  <br>  cache:<br>      directories:<br> @@ -24,11 +24,16 @@ jobs:<br>        - name: RelWithDebInfoWError build + test (Linux, clang)<br>          env: TARGET=test<br>          compiler: clang<br> - - name: RelWithDebInfoWError build + test (OS X)<br> + - name: RelWithDebInfoWError build + test (OS X Mojave 10.14)<br>          env: TARGET=test<br>          os: osx<br>        - name: Debug build + test + coverage (Linux, gcc)<br>          env: TARGET=coverage<br> + - name: RelWithDebInfoWError build + test (OS X High Sierra 10.13)<br> + env: TARGET=test<br> + os: osx<br> + osx_image: xcode9.4<br> + if: branch = "2.1"<br>        - name: LTO build + test (Linux, gcc)<br>          env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON<br>          if: branch = "2.1"<br> @@ -36,7 +41,7 @@ jobs:<br>          env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON<br>          if: branch = "2.1"<br>          compiler: clang<br> - - name: LTO build + test (OS X)<br> + - name: LTO build + test (OS X Mojave 10.14)<br>          os: osx<br>          env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON<br>          if: branch = "2.1"<br> diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake<br> index ea4878a93..e84fb21aa 100644<br> --- a/cmake/luajit.cmake<br> +++ b/cmake/luajit.cmake<br> @@ -196,10 +196,19 @@ macro(luajit_build)<br>          if ("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")<br>              # Default to 10.6 since @rpath support is NOT available in<br>              # earlier versions, needed by AddressSanitizer.<br> - set (luajit_osx_deployment_target 10.6)<br> + execute_process(COMMAND sw_vers -productVersion<br> + OUTPUT_VARIABLE PRODUCT_VERSION)<br> + message(STATUS "PRODUCT_VERSION=${PRODUCT_VERSION}")<br> + if (${PRODUCT_VERSION} VERSION_LESS 10.14)<br> + set (luajit_osx_deployment_target 10.6)<br> + else ()<br> + set (luajit_osx_deployment_target 10.14)<br> + endif ()<br>          else()<br>              set (luajit_osx_deployment_target ${CMAKE_OSX_DEPLOYMENT_TARGET})<br>          endif()<br> + set(macosx_deployment_target_env MACOSX_DEPLOYMENT_TARGET=${luajit_osx_deployment_target})<br> + message(STATUS "${macosx_deployment_target_env}")<br>          set(luajit_ldflags<br>              ${luajit_ldflags} -Wl,-macosx_version_min,${luajit_osx_deployment_target})<br>      endif ()<br> @@ -238,7 +247,7 @@ macro(luajit_build)<br>          add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/third_party/luajit/src/libluajit.a<br>              WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/third_party/luajit<br>              COMMAND $(MAKE) ${luajit_buildoptions} clean<br> - COMMAND $(MAKE) -C src ${luajit_buildoptions} jit/vmdef.lua libluajit.a<br> + COMMAND ${macosx_deployment_target_env} $(MAKE) -C src ${luajit_buildoptions} jit/vmdef.lua libluajit.a<br>              DEPENDS ${CMAKE_SOURCE_DIR}/CMakeCache.txt<br>          )<br>      else()<br> @@ -249,7 +258,7 @@ macro(luajit_build)<br>              WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/third_party/luajit<br>              COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/third_party/luajit ${PROJECT_BINARY_DIR}/third_party/luajit<br>              COMMAND $(MAKE) ${luajit_buildoptions} clean<br> - COMMAND $(MAKE) -C src ${luajit_buildoptions} jit/vmdef.lua libluajit.a<br> + COMMAND ${macosx_deployment_target_env} $(MAKE) -C src ${luajit_buildoptions} jit/vmdef.lua libluajit.a<br>              DEPENDS ${PROJECT_BINARY_DIR}/CMakeCache.txt ${PROJECT_BINARY_DIR}/third_party/luajit<br>          )<br>      endif()<br> -- <br> 2.17.1<br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        Вторник,  5 марта 2019, 23:27 +03:00 от Alexander Turenko <alexander.turenko@tarantool.org>:<br>
        <br>
        <div id="">






<div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
        <div>
                
                
            <div id="style_15518176520000000164_BODY">On Sat, Feb 23, 2019 at 10:59:55PM +0300, Alexander Tikhonov wrote:<br>
                                 > <br>
> Hi!<br>
> <br>
> Once more time sorry, that I didn't see your comments from the first time ))<br>
> <br>
> 1) <br>
> > It seems that we install pip twice: here and in test_osx.<br>
> <br>
> Right, pip is needed twice:<br>
>  - for virtualenv to be installed while easy_install is depricated<br>
>  - inside the virtualenv<br>
> > I wonder whether all problems are resolved if we just add<br>
> > pyenv-virtualenv into 'brew install' command in deps_osx?<br>
> <br>
> pyenv-virtualenv into 'brew install' command in deps_osx  can be installed - I'll do it<br>
> <br>
> but the virtualenv on the new OSX versions is not installed by default and it<br>
> needs additional pip routine installation for 'pip install virtualenv' final install,<br>
> otherwise check the following bugus build without additional pip install command:<br>
> <a href="https://travis-ci.org/tarantool/tarantool/jobs/497450467" target="_blank">https://travis-ci.org/tarantool/tarantool/jobs/497450467</a>  <br>
> <br>
      <br>
ld: library not found for -lgcc_s.10.4<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
<br>
I don't understood how it is related to pip.<br>
<br>
I don't understood your description too to be honest. Let's discuss it<br>
tommorow voicely.<br>
<br>
> 2)<br>
> > 9.4 is not OS X version, it is xcode version. Proposed name:<br>
> <br>
> > RelWithDebInfoWError build + test (OS X 10.13 High Sierra)<br>
> <br>
> > Now I see both versions are High Sierra. I don't see a reason to have<br>
> > two target of the same Mac OS versions (even despite different xcode<br>
> > versions).<br>
> <br>
> Right, I'll do your suggestion<br>
> <br>
> > Also consider: Travis-CI added Mojave builds:<br>
> >  <a href="https://blog.travis-ci.com/2019-02-12-xcode-10-2-beta-2-is-now-available" target="_blank">https://blog.travis-ci.com/2019-02-12-xcode-10-2-beta-2-is-now-available</a><br>
> <br>
> I missed it, thanks!<br>
> <br>
> > Also I still think fix cmakes for Mojave and tweak travis targets should<br>
> > be in the separate commits.<br>
> <br>
> Right, I'll do it in this way<br>
> <br>
> 3)<br>
> > Since we set 10.6 for some targets, the comment seems to be still<br>
> > actual. I don't think we should remove it.<br>
> Restored back.<br>
> <br>
> 4)<br>
> > Can we use VERSION_LESS operation to simplify the code?<br>
> <br>
> Right, changed as suggested<br>
> <br>
> > I think only the first 'message' directive is useful, others are<br>
> > redundant.<br>
> <br>
> Ok, sure<br>
> <br>
> > Why the edge is between 10.12-10.13, while a problem we trying to solve<br>
> > appears only on 10.14 (Mojave)?<br>
> <br>
> Right, corrected<br>
> <br>
> Patches below to check the changes made on suggestions:<br>
> <a href="https://github.com/tarantool/tarantool/compare/2.1...e4beb12d7d3e" target="_blank">https://github.com/tarantool/tarantool/compare/2.1...e4beb12d7d3e</a>   <br>
> <a href="https://travis-ci.org/tarantool/tarantool/builds/497561631" target="_blank">https://travis-ci.org/tarantool/tarantool/builds/497561631</a>  <br>
> <a href="https://travis-ci.org/tarantool/tarantool/builds/497554600" target="_blank">https://travis-ci.org/tarantool/tarantool/builds/497554600</a>  <br>
> <br>
<br>
I'll paste your commits below as plaintext to comment them per line.<br>
<br>
> commit e265d6686761471301a1de2bf0ca7eab157527cc<br>
> Author: Alexander V. Tikhonov <<a href="mailto:avtikhon@tarantool.org">avtikhon@tarantool.org</a>><br>
> Date:   Sun Feb 24 05:18:58 2019 -0500<br>
> <br>
>     travis-ci: OSX version image updated<br>
>     <br>
>     Changed the OSX image from 9.4 to 10.2,<br>
>     added 9.4 version image to 2.1 release criteria<br>
<br>
The commit message assumes this a reading person has xcode version -><br>
mac os version mapping in a head. 9.4 is not 'OSX image', it is xcode<br>
version. I think nobody is interested in xcode versions, so it is better<br>
to use Mac OS version in messages.<br>
<br>
I would also say 'CI for 2.1 branch' instead of vague '2.1 release<br>
criteria'.<br>
<br>
Note: 'OS X' should be written with a whitespace as I see.<br>
<br>
> <br>
> diff --git a/.travis.mk b/.travis.mk<br>
> index edd94cd7d..35ed2612f 100644<br>
> --- a/.travis.mk<br>
> +++ b/.travis.mk<br>
> @@ -46,7 +46,12 @@ test_ubuntu: deps_ubuntu<br>
>  <br>
>  deps_osx:<br>
>    brew update<br>
> -  brew install openssl readline curl icu4c --force<br>
> +  brew install openssl readline curl icu4c pyenv-virtualenv --force<br>
> +  virtualenv -h >/dev/null 2>&1 || \<br>
> +          ( pip -h >/dev/null 2>&1 || \<br>
> +                  ( curl --silent --show-error --retry 5 <a href="https://bootstrap.pypa.io/get-pip.py" target="_blank">https://bootstrap.pypa.io/get-pip.py</a> | python && \<br>
> +                  pip --version ) && \<br>
> +          pip install virtualenv )<br>
>  <br>
<br>
Answered above.<br>
<br>
>  test_osx: deps_osx<br>
>    cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfoWError ${CMAKE_EXTRA_PARAMS}<br>
> diff --git a/.travis.yml b/.travis.yml<br>
> index ffe2e8247..90af044ff 100644<br>
> --- a/.travis.yml<br>
> +++ b/.travis.yml<br>
> @@ -8,7 +8,7 @@ language: cpp<br>
>  os: linux<br>
>  compiler: gcc<br>
>  <br>
> -osx_image: xcode9<br>
> +osx_image: xcode10.2<br>
<br>
Please, add comment like 'Max OS 10.14'<br>
<br>
>  <br>
>  cache:<br>
>      directories:<br>
> @@ -24,11 +24,16 @@ jobs:<br>
>        - name: RelWithDebInfoWError build + test (Linux, clang)<br>
>          env: TARGET=test<br>
>          compiler: clang<br>
> -      - name: RelWithDebInfoWError build + test (OS X)<br>
> -        env: TARGET=test<br>
> +      - name: RelWithDebInfoWError build + test (OS X 10.14 Mojave)<br>
> +        env: TARGET=test MACOSX_DEPLOYMENT_TARGET=10.14<br>
<br>
Other targets are named like 'Ubuntu Trusty (14.04) build + deploy DEB':<br>
name of a release, then release number. So I think it should be 'OS X<br>
Mojave 10.14'.<br>
<br>
Why do you add MACOSX_DEPLOYMENT_TARGET=10.14 here? As I understand your<br>
work is about allowing to don't set it.<br>
<br>
>          os: osx<br>
>        - name: Debug build + test + coverage (Linux, gcc)<br>
>          env: TARGET=coverage<br>
> +      - name: RelWithDebInfoWError build + test (OS X 10.13 High Sierra)<br>
> +        env: TARGET=test<br>
> +        os: osx<br>
> +        osx_image: xcode9.4<br>
> +        if: branch = "2.1"<br>
<br>
OS X High Sierra 10.13.<br>
<br>
>        - name: LTO build + test (Linux, gcc)<br>
>          env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON<br>
>          if: branch = "2.1"<br>
> @@ -36,9 +41,9 @@ jobs:<br>
>          env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON<br>
>          if: branch = "2.1"<br>
>          compiler: clang<br>
> -      - name: LTO build + test (OS X)<br>
> +      - name: LTO build + test (OS X 10.14 Mojave)<br>
>          os: osx<br>
> -        env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON<br>
> +        env: TARGET=test CMAKE_EXTRA_PARAMS=-DENABLE_LTO=ON MACOSX_DEPLOYMENT_TARGET=10.14<br>
<br>
The same: 'OS X Mojave 10.14' and why MACOSX_DEPLOYMENT_TARGET=10.14 is<br>
added?<br>
<br>
>          if: branch = "2.1"<br>
>        - name: Create and deploy tarball<br>
>          env: TARGET=source<br>
> <br>
> commit 0e703e04704de59a29f2f38f2bcb2ec0f028f046<br>
> Author: Alexander V. Tikhonov <<a href="mailto:avtikhon@tarantool.org">avtikhon@tarantool.org</a>><br>
> Date:   Sun Feb 24 02:38:07 2019 -0500<br>
> <br>
>     travis-ci: fixed Mojave mac build<br>
>     <br>
>     Fixed Mojave Mac build with CMAKE_OSX_DEPLOYMENT_TARGET.<br>
>     Specified the minimum version of OS X on which the target<br>
>     binaries are to be deployed. CMake uses this value for the<br>
>     -mmacosx-version-min flag and to help choose the default SDK<br>
> <br>
> diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake<br>
> index ea4878a93..40f2472ef 100644<br>
> --- a/cmake/luajit.cmake<br>
> +++ b/cmake/luajit.cmake<br>
> @@ -196,10 +196,20 @@ macro(luajit_build)<br>
>          if ("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")<br>
>              # Default to 10.6 since @rpath support is NOT available in<br>
>              # earlier versions, needed by AddressSanitizer.<br>
<br>
Hm. Now the comment is only partially valid. We need to expand it.<br>
<br>
> -            set (luajit_osx_deployment_target 10.6)<br>
> +            execute_process(COMMAND sw_vers -productVersion<br>
> +                OUTPUT_VARIABLE PRODUCT_VERSION)<br>
> +            message(STATUS "PRODUCT_VERSION=${PRODUCT_VERSION}")<br>
> +            if (${PRODUCT_VERSION} VERSION_LESS 10.14)<br>
> +                set (luajit_osx_deployment_target 10.6)<br>
> +            else ()<br>
> +                set (luajit_osx_deployment_target 10.14)<br>
> +            endif ()<br>
> +            set(CMAKE_OSX_DEPLOYMENT_TARGET "${luajit_osx_deployment_target}"<br>
> +          CACHE STRING "Minimum OS X deployment version")<br>
<br>
Please, don't mix whitespaces and tabs.<br>
<br>
BTW, why we're set CMAKE_OSX_DEPLOYMENT_TARGET if it is not used<br>
anywhere else?<br>
<br>
>          else()<br>
>              set (luajit_osx_deployment_target ${CMAKE_OSX_DEPLOYMENT_TARGET})<br>
>          endif()<br>
> +        message(STATUS "LUAJIT_OSX_DEPLOYMENT_TARGET=${luajit_osx_deployment_target}")<br>
>          set(luajit_ldflags<br>
>              ${luajit_ldflags} -Wl,-macosx_version_min,${luajit_osx_deployment_target})<br>
>      endif ()<br>
<br>
</div>
            
        
                
        </div>

        
</div>


</div>
</blockquote>
<br>
<br>-- <br>Alexander Tikhonov<br></BODY></HTML>