You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by jeking3 <gi...@git.apache.org> on 2017/01/29 16:13:49 UTC

[GitHub] thrift pull request #1171: THRIFT-4046 fix PlatformSocket.h for mingw64/msys...

GitHub user jeking3 opened a pull request:

    https://github.com/apache/thrift/pull/1171

    THRIFT-4046 fix PlatformSocket.h for mingw64/msys2 and provide instructions

    Instructions provided for building with cmake under that toolchain.
    
    See build/cmake/README-MSYS2.md


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jeking3/thrift THRIFT-4046

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1171.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1171
    
----
commit 00093c82a19838574dbd8331153c78ac88668a87
Author: James E. King, III <ji...@simplivity.com>
Date:   2017-01-29T16:12:19Z

    THRIFT-4046 fix PlatformSocket.h for mingw64/msys2 and provide instructions for building with cmake under that toolchain

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request #1171: THRIFT-4046 fix PlatformSocket.h for mingw64/msys...

Posted by jeking3 <gi...@git.apache.org>.
Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1171#discussion_r98364736
  
    --- Diff: build/cmake/README-MSYS2.md ---
    @@ -0,0 +1,63 @@
    +<!---
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +    http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +-->
    +
    +# Building thrift on Windows (MinGW64/MSYS2)
    +
    +Thrift uses cmake to make it easier to build the project on multiple platforms, however to build a fully functional and production ready thrift on Windows requires a number of third party libraries to be obtained.  Once third party libraries are ready, the right combination of options must be passed to cmake in order to generate the correct environment.
    +
    +> Note: libevent and libevent-devel do not work with this toolchain as they do not properly detect mingw64 and expect some headers to exist that do not, so the non-blocking server is not currently built into this solution.
    +
    +## MSYS2
    +
    +Download and fully upgrade msys2 following the instructions at:
    +
    +    https://msys2.github.io/
    +
    +Install the necessary toolchain items for C++:
    +
    +    $ pacman -S bison flex openssl openssl-devel \
    +                mingw-w64-x86_64-boost mingw-w64-x86_64-cmake \
    +                mingw-w64-x86_64-toolchain zlib zlib-devel
    +
    +Update your msys2 bash path to include /mingw64/bin by adding a line to your ~/.bash_profiles using this command:
    +
    +    echo "export PATH=/mingw64/bin:\$PATH" >> ~/.bash_profile
    +
    +After that, close your shell and open a new one.
    +
    +Use cmake to create a MinGW makefile, out of tree (assumes you are in the top level of the thrift source tree):
    +
    +    mkdir ../thrift-build
    +    cd ../thrift-build
    +    cmake -G"MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=/mingw64/bin/mingw32-make \
    +       -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe \
    +       -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe \
    +       -DWITH_BOOSTTHREADS=ON -DWITH_LIBEVENT=OFF \
    --- End diff --
    
    Doesn't work properly without requiring BOOST.  I tried it without this directive and it fails in TFileTransport looking for BoostThreadFactory for some reason.  I will dig into it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request #1171: THRIFT-4046 fix PlatformSocket.h for mingw64/msys...

Posted by jeking3 <gi...@git.apache.org>.
Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1171#discussion_r98771831
  
    --- Diff: build/cmake/README-MSYS2.md ---
    @@ -0,0 +1,63 @@
    +<!---
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +    http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +-->
    +
    +# Building thrift on Windows (MinGW64/MSYS2)
    +
    +Thrift uses cmake to make it easier to build the project on multiple platforms, however to build a fully functional and production ready thrift on Windows requires a number of third party libraries to be obtained.  Once third party libraries are ready, the right combination of options must be passed to cmake in order to generate the correct environment.
    +
    +> Note: libevent and libevent-devel do not work with this toolchain as they do not properly detect mingw64 and expect some headers to exist that do not, so the non-blocking server is not currently built into this solution.
    +
    +## MSYS2
    +
    +Download and fully upgrade msys2 following the instructions at:
    +
    +    https://msys2.github.io/
    +
    +Install the necessary toolchain items for C++:
    +
    +    $ pacman -S bison flex openssl openssl-devel \
    +                mingw-w64-x86_64-boost mingw-w64-x86_64-cmake \
    +                mingw-w64-x86_64-toolchain zlib zlib-devel
    +
    +Update your msys2 bash path to include /mingw64/bin by adding a line to your ~/.bash_profiles using this command:
    +
    +    echo "export PATH=/mingw64/bin:\$PATH" >> ~/.bash_profile
    +
    +After that, close your shell and open a new one.
    +
    +Use cmake to create a MinGW makefile, out of tree (assumes you are in the top level of the thrift source tree):
    +
    +    mkdir ../thrift-build
    +    cd ../thrift-build
    +    cmake -G"MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=/mingw64/bin/mingw32-make \
    +       -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe \
    +       -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe \
    +       -DWITH_BOOSTTHREADS=ON -DWITH_LIBEVENT=OFF \
    --- End diff --
    
    BOOST is used in the particular case I have because we have a hardcoded windows/config.h we are using instead of relying on the one generated by cmake.  There's already a backlog item for this, so given there's a bugfix here + some instructions I am going to merge this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request #1171: THRIFT-4046 fix PlatformSocket.h for mingw64/msys...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/thrift/pull/1171


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---