conda-forge / thrift-cpp-feedstock

A conda-smithy repository for thrift-cpp.
BSD 3-Clause "New" or "Revised" License
2 stars 17 forks source link

find_package(Thrift) doesn't work on Windows #68

Closed kou closed 1 year ago

kou commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

Library/lib/cmake/thrift/thriftTargets-release.cmake refers ${_IMPORT_PREFIX}/bin/thriftmd.lib but it doesn't exist. Because bin/thriftmd.lib is moved to lib/ by #54.

See also a real world failure log from Apache Arrow: https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/45295950

CMake Error at C:/Miniconda38-x64/envs/arrow/Library/lib/cmake/thrift/thriftTargets.cmake:85 (message):
  The imported target "thrift::thrift" references the file
     "C:/Miniconda38-x64/envs/arrow/Library/bin/thriftmd.lib"
  but this file does not exist.  Possible reasons include:
  * The file was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and contained
     "C:/Miniconda38-x64/envs/arrow/Library/lib/cmake/thrift/thriftTargets.cmake"
  but not all the files it references.
Call Stack (most recent call first):
  C:/Miniconda38-x64/envs/arrow/Library/lib/cmake/thrift/ThriftConfig.cmake:54 (include)

https://github.com/apache/arrow/pull/14597 is the pull request for the failure.

I think that we should have changed https://github.com/conda-forge/thrift-cpp-feedstock/blob/main/recipe/meta.yaml#L80

        - if not exist %PREFIX%\\Library\\lib\\thriftmd.lib exit 1          # [win]

to

        - if not exist %PREFIX%\\Library\\bin\\thriftmd.lib exit 1          # [win]

and not added https://github.com/conda-forge/thrift-cpp-feedstock/commit/f7cde2426c62b821fe43f9cc3a3b5711235cb3df in #54.

Because Apache Thrift changed the .lib directory to bin/ from lib/ by https://github.com/apache/thrift/commit/66d110bcce5c7e1b0deeacd28b046fb4a9c0249b .

Installed packages

Sorry I don't have a local conda environment. Here is a list from a CI log https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/45295950 :

  + aiobotocore                           2.4.0  pyhd8ed1ab_0         conda-forge/noarch       55kB
  + aiohttp                               3.8.3  py38h91455d4_1       conda-forge/win-64      425kB
  + aioitertools                         0.11.0  pyhd8ed1ab_0         conda-forge/noarch       23kB
  + aiosignal                             1.2.0  pyhd8ed1ab_0         conda-forge/noarch       13kB
  + async-timeout                         4.0.2  pyhd8ed1ab_0         conda-forge/noarch        9kB
  + attrs                                22.1.0  pyh71513ae_1         conda-forge/noarch       49kB
  + aws-c-cal                            0.5.11  he19cf47_0           conda-forge/win-64       37kB
  + aws-c-common                          0.6.2  h8ffe710_0           conda-forge/win-64      163kB
  + aws-c-event-stream                    0.2.7  h70e1b0c_13          conda-forge/win-64       48kB
  + aws-c-io                             0.10.5  h2fe331c_0           conda-forge/win-64      130kB
  + aws-checksums                        0.1.11  h1e232aa_7           conda-forge/win-64       53kB
  + aws-sdk-cpp                         1.8.186  h93d3aa3_4           conda-forge/win-64        6MB
  + backports                               1.0  py_2                 conda-forge/noarch        4kB
  + backports.zoneinfo                    0.2.1  py38h91455d4_7       conda-forge/win-64       50kB
  + benchmark                             1.7.0  h0e60522_0           conda-forge/win-64      947kB
  + boost-cpp                            1.80.0  h9f4b32c_0           conda-forge/win-64       18MB
  + boto3                               1.24.59  pyhd8ed1ab_0         conda-forge/noarch       74kB
  + botocore                            1.27.59  pyhd8ed1ab_0         conda-forge/noarch        6MB
  + brotli                                1.0.9  hcfcfb64_8           conda-forge/win-64       19kB
  + brotli-bin                            1.0.9  hcfcfb64_8           conda-forge/win-64       23kB
  + brotlipy                              0.7.0  py38h91455d4_1005    conda-forge/win-64      340kB
  + bzip2                                 1.0.8  h8ffe710_4           conda-forge/win-64     Cached
  + c-ares                               1.18.1  h8ffe710_0           conda-forge/win-64      117kB
  + ca-certificates                   2022.9.24  h5b45459_0           conda-forge/win-64     Cached
  + certifi                           2022.9.24  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + cffi                                 1.15.1  py38h57701bc_2       conda-forge/win-64      234kB
  + charset-normalizer                    2.1.1  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + clang                                14.0.6  h8e541a6_0           conda-forge/win-64      101MB
  + clang-14                             14.0.6  default_h66ee7f4_0   conda-forge/win-64       35MB
  + clang-format                         14.0.6  default_h66ee7f4_0   conda-forge/win-64        1MB
  + clang-tools                          14.0.6  default_h66ee7f4_0   conda-forge/win-64      243MB
  + clangdev                             14.0.6  default_hf9e4a47_0   conda-forge/win-64       70MB
  + clangxx                              14.0.6  default_h66ee7f4_0   conda-forge/win-64       34MB
  + click                                 8.1.3  win_pyhd8ed1ab_2     conda-forge/noarch       77kB
  + cloudpickle                           2.2.0  pyhd8ed1ab_0         conda-forge/noarch       26kB
  + cmake                                3.24.3  h1537add_0           conda-forge/win-64       17MB
  + colorama                              0.4.6  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + cryptography                         38.0.3  py38h086c683_0       conda-forge/win-64        1MB
  + cython                              0.29.32  py38hd3f51b4_1       conda-forge/win-64        2MB
  + exceptiongroup                        1.0.1  pyhd8ed1ab_0         conda-forge/noarch       16kB
  + flatbuffers                           2.0.7  h0e60522_0           conda-forge/win-64        2MB
  + frozenlist                            1.3.1  py38h91455d4_1       conda-forge/win-64       42kB
  + fsspec                            2022.10.0  pyhd8ed1ab_0         conda-forge/noarch       98kB
  + gettext                              0.21.1  h5728263_0           conda-forge/win-64        6MB
  + gflags                                2.2.2  ha925a31_1004        conda-forge/win-64       82kB
  + glog                                  0.6.0  h4797de2_0           conda-forge/win-64       98kB
  + gmock                                1.11.0  h2d74725_0           conda-forge/win-64        8MB
  + google-cloud-cpp                      2.1.0  h1df0308_2           conda-forge/win-64       68MB
  + grpc-cpp                             1.47.1  hcb02dd0_6           conda-forge/win-64       29MB
  + gtest                                1.11.0  h2d74725_0           conda-forge/win-64        5MB
  + hypothesis                           6.56.4  pyha770c72_0         conda-forge/noarch      277kB
  + idna                                    3.4  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + iniconfig                             1.1.1  pyh9f0ad1d_0         conda-forge/noarch        8kB
  + jmespath                              1.0.1  pyhd8ed1ab_0         conda-forge/noarch       21kB
  + krb5                                 1.19.3  h1176d77_0           conda-forge/win-64      867kB
  + libabseil                        20220623.0  cxx17_h1a56200_5     conda-forge/win-64        2MB
  + libblas                               3.9.0  16_win64_openblas    conda-forge/win-64        6MB
  + libbrotlicommon                       1.0.9  hcfcfb64_8           conda-forge/win-64       69kB
  + libbrotlidec                          1.0.9  hcfcfb64_8           conda-forge/win-64       35kB
  + libbrotlienc                          1.0.9  hcfcfb64_8           conda-forge/win-64      742kB
  + libcblas                              3.9.0  16_win64_openblas    conda-forge/win-64        6MB
  + libclang                             14.0.6  default_h77d9078_0   conda-forge/win-64      147kB
  + libclang-cpp                         14.0.6  default_hf9e4a47_0   conda-forge/win-64      130kB
  + libclang13                           14.0.6  default_h77d9078_0   conda-forge/win-64       26MB
  + libcrc32c                             1.1.2  h0e60522_0           conda-forge/win-64       26kB
  + libcurl                              7.86.0  heaf79c2_1           conda-forge/win-64     Cached
  + libffi                                3.4.2  h8ffe710_5           conda-forge/win-64     Cached
  + libflang                              5.0.0  h6538335_20180525    conda-forge/win-64      531kB
  + libglib                              2.74.1  he8f3873_1           conda-forge/win-64        3MB
  + libgoogle-cloud                       2.1.0  h1df0308_2           conda-forge/win-64       11kB
  + libiconv                               1.17  h8ffe710_0           conda-forge/win-64     Cached
  + liblapack                             3.9.0  16_win64_openblas    conda-forge/win-64        6MB
  + libllvm14                            14.0.6  h97333cc_0           conda-forge/win-64       52kB
  + libopenblas                          0.3.21  pthreads_h02691f0_0  conda-forge/win-64        6MB
  + libprotobuf                          3.20.1  h12be248_4           conda-forge/win-64        3MB
  + libsqlite                            3.39.4  hcfcfb64_0           conda-forge/win-64     Cached
  + libssh2                              1.10.0  h680486a_3           conda-forge/win-64      233kB
  + libthrift                            0.16.0  h9f558f2_2           conda-forge/win-64      898kB
  + libutf8proc                           2.8.0  h82a8f57_0           conda-forge/win-64      104kB
  + libxml2                              2.10.3  hc3477c8_0           conda-forge/win-64     Cached
  + libzlib                              1.2.13  hcfcfb64_4           conda-forge/win-64     Cached
  + llvm-meta                             5.0.0  0                    conda-forge/noarch        3kB
  + llvm-tools                           14.0.6  hf00eed6_0           conda-forge/win-64      328MB
  + llvmdev                              14.0.6  h97333cc_0           conda-forge/win-64      117MB
  + lz4-c                                 1.9.3  h8ffe710_1           conda-forge/win-64     Cached
  + m2w64-gcc-libgfortran                 5.3.0  6                    conda-forge/win-64      351kB
  + m2w64-gcc-libs                        5.3.0  7                    conda-forge/win-64      532kB
  + m2w64-gcc-libs-core                   5.3.0  7                    conda-forge/win-64      219kB
  + m2w64-gmp                             6.1.0  2                    conda-forge/win-64      744kB
  + m2w64-libwinpthread-git  5.0.0.4634.697f757  2                    conda-forge/win-64       32kB
  + make                                    4.3  h3d2af85_1           conda-forge/win-64        6MB
  + msys2-conda-epoch                  20160418  1                    conda-forge/win-64        3kB
  + multidict                             6.0.2  py38h91455d4_2       conda-forge/win-64       49kB
  + ninja                                1.11.0  h2d74725_0           conda-forge/win-64      308kB
  + nlohmann_json                        3.11.2  h39d44d4_0           conda-forge/win-64      117kB
  + nomkl                                   1.0  h5ca1d4c_0           conda-forge/noarch        4kB
  + numpy                                1.23.4  py38h90ce339_1       conda-forge/win-64        7MB
  + openmp                                5.0.0  vc14_1               conda-forge/win-64      590kB
  + openssl                              1.1.1s  hcfcfb64_0           conda-forge/win-64        6MB
  + orc                                   1.7.4  hd7efde4_0           pkgs/main/win-64        674kB
  + packaging                              21.3  pyhd8ed1ab_0         conda-forge/noarch       36kB
  + pandas                                1.5.1  py38h5846ac1_1       conda-forge/win-64       12MB
  + pcre2                                 10.40  h17e33f8_0           conda-forge/win-64        2MB
  + pip                                  22.3.1  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + pkg-config                           0.29.2  h2bf4dc2_1008        conda-forge/win-64       34kB
  + pluggy                                1.0.0  pyhd8ed1ab_5         conda-forge/noarch       16kB
  + pycparser                              2.21  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + pyopenssl                            22.1.0  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + pyparsing                             3.0.9  pyhd8ed1ab_0         conda-forge/noarch       81kB
  + pysocks                               1.7.1  pyh0701188_6         conda-forge/noarch     Cached
  + pytest                                7.2.0  pyhd8ed1ab_2         conda-forge/noarch      225kB
  + pytest-faulthandler                   2.0.1  py_0                 conda-forge/noarch        5kB
  + pytest-lazy-fixture                   0.6.3  py_0                 conda-forge/noarch        8kB
  + python                               3.8.13  h9a09f29_0_cpython   conda-forge/win-64       18MB
  + python-dateutil                       2.8.2  pyhd8ed1ab_0         conda-forge/noarch      246kB
  + python_abi                              3.8  2_cp38               conda-forge/win-64        5kB
  + pytz                                 2022.6  pyhd8ed1ab_0         conda-forge/noarch      240kB
  + rapidjson                             1.1.0  ha925a31_1002        conda-forge/win-64      107kB
  + re2                              2022.06.01  h0e60522_0           conda-forge/win-64      496kB
  + s3fs                              2022.10.0  pyhd8ed1ab_0         conda-forge/noarch       28kB
  + s3transfer                            0.6.0  pyhd8ed1ab_0         conda-forge/noarch       57kB
  + setuptools                           65.5.1  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + setuptools-scm                        7.0.5  pyhd8ed1ab_1         conda-forge/noarch       36kB
  + setuptools_scm                        7.0.5  hd8ed1ab_1           conda-forge/noarch        5kB
  + six                                  1.16.0  pyh6c4a22f_0         conda-forge/noarch       14kB
  + snappy                                1.1.9  hfb803bf_2           conda-forge/win-64       58kB
  + sortedcontainers                      2.4.0  pyhd8ed1ab_0         conda-forge/noarch       26kB
  + sqlite                               3.39.4  hcfcfb64_0           conda-forge/win-64     Cached
  + thrift-compiler                      0.16.0  h9f558f2_2           conda-forge/win-64        1MB
  + thrift-cpp                           0.16.0  h9752425_2           conda-forge/win-64       12kB
  + tk                                   8.6.12  h8ffe710_0           conda-forge/win-64     Cached
  + tomli                                 2.0.1  pyhd8ed1ab_0         conda-forge/noarch       16kB
  + typing-extensions                     4.4.0  hd8ed1ab_0           conda-forge/noarch        9kB
  + typing_extensions                     4.4.0  pyha770c72_0         conda-forge/noarch       30kB
  + tzdata                                2022f  h191b570_0           conda-forge/noarch     Cached
  + ucrt                           10.0.22621.0  h57928b3_0           conda-forge/win-64     Cached
  + urllib3                             1.26.11  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + vc                                     14.3  h3d8a991_9           conda-forge/win-64     Cached
  + vs2015_runtime                  14.32.31332  h1d6e394_9           conda-forge/win-64     Cached
  + wheel                                0.38.2  pyhd8ed1ab_0         conda-forge/noarch     Cached
  + win_inet_pton                         1.1.0  pyhd8ed1ab_6         conda-forge/noarch     Cached
  + wrapt                                1.14.1  py38h91455d4_1       conda-forge/win-64       50kB
  + xsimd                                 9.0.1  h2d74725_0           conda-forge/win-64      104kB
  + xz                                    5.2.6  h8d14728_0           conda-forge/win-64     Cached
  + yarl                                  1.8.1  py38h91455d4_0       conda-forge/win-64       86kB
  + zlib                                 1.2.13  hcfcfb64_4           conda-forge/win-64      116kB
  + zstd                                  1.5.2  h7755175_4           conda-forge/win-64     Cached

Environment info

Sorry I don't have a local conda environment. Here is an output from a CI log https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/45295950 :

C:\projects\arrow>conda info -a 
     active environment : None
       user config file : C:\Users\appveyor\.condarc
 populated config files : C:\Users\appveyor\.condarc
          conda version : 4.8.2
    conda-build version : not installed
         python version : 3.8.1.final.0
       virtual packages : 
       base environment : C:\Miniconda38-x64  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Miniconda38-x64\pkgs
                          C:\Users\appveyor\.conda\pkgs
                          C:\Users\appveyor\AppData\Local\conda\conda\pkgs
       envs directories : C:\Miniconda38-x64\envs
                          C:\Users\appveyor\.conda\envs
                          C:\Users\appveyor\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.8.2 requests/2.22.0 CPython/3.8.1 Windows/10 Windows/10.0.17763
          administrator : True
             netrc file : None
           offline mode : False
# conda environments:
#
base                  *  C:\Miniconda38-x64
sys.version: 3.8.1 (default, Mar  2 2020, 13:06:26) [...
sys.prefix: C:\Miniconda38-x64
sys.executable: C:\Miniconda38-x64\python.exe
conda location: C:\Miniconda38-x64\lib\site-packages\conda
conda-build: None
conda-env: C:\Miniconda38-x64\Scripts\conda-env.exe
user site dirs: 
ANDROID_NDK_PATH: C:\Microsoft\AndroidNDK64\android-ndk-r16b
APR_ICONV_PATH: C:\Program Files (x86)\Subversion\iconv
CIO_TEST: <not set>
CONDA_ROOT: C:\Miniconda38-x64
GIT_LFS_PATH: C:\Program Files\Git LFS
HOMEPATH: \Users\appveyor
PATH: C:\Miniconda38-x64;C:\Miniconda38-x64\Scripts;C:\Miniconda38-x64\Library\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\Program Files\Git\cmd;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;C:\Program Files\7-Zip;C:\Program Files\Microsoft\Web Platform Installer\;C:\Tools\NuGet;C:\Tools\PsTools;C:\Program Files\Git\usr\bin;C:\Program Files\Git LFS;C:\Program Files\Mercurial\;C:\Program Files (x86)\Subversion\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;C:\Tools\xUnit;C:\Tools\xUnit20;C:\Tools\NUnit\bin;C:\Tools\NUnit3\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\TestPlatform;C:\Ruby31\bin;C:\Tools\WebDriver;C:\Python311;C:\Python311\Scripts;C:\Program Files (x86)\nodejs\;C:\Program Files\nodejs;C:\Program Files (x86)\iojs;C:\Program Files\iojs;C:\Users\appveyor\AppData\Roaming\npm;C:\Program Files (x86)\Yarn\bin\;C:\go\bin;C:\Program Files\Java\jdk1.8.0\bin;C:\Program Files\erl10.7\bin;C:\flutter\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Amazon\AWSCLI\bin\;C:\Program Files\Amazon\AWSCLI;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft DirectX SDK;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Tools\Doxygen;C:\Tools\Graphviz\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\LLVM\bin;C:\Tools\vcpkg;C:\Tools\Coverity\bin;C:\Program Files (x86)\NSIS;C:\Tools\Octopus;C:\Program Files\Meson\;C:\Program Files (x86)\Apache\Maven\bin;C:\Tools\GitVersion;C:\Users\appveyor\AppData\Local\Microsoft\WindowsApps;C:\Users\appveyor\.dotnet\tools;C:\Users\appveyor\AppData\Roaming\npm;C:\Users\appveyor\AppData\Local\Yarn\bin;C:\Program Files\AppVeyor\BuildAgent\
PSMODULEPATH: C:\Users\appveyor\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\AppVeyor\BuildAgent\Modules;C:\Users\appveyor\Documents\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell
PYTHON: 3.8
REQUESTS_CA_BUNDLE: <not set>
SSL_CERT_FILE: <not set>
h-vetinari commented 1 year ago

I think that we should have changed https://github.com/conda-forge/thrift-cpp-feedstock/blob/main/recipe/meta.yaml#L80

        - if not exist %PREFIX%\\Library\\lib\\thriftmd.lib exit 1          # [win]

to

        - if not exist %PREFIX%\\Library\\bin\\thriftmd.lib exit 1          # [win]

and not added f7cde24 in #54.

I think it's the other way around. The import libraries .lib (for each .dll) are usually in %LIBRARY_PREFIX/lib while the .dll files are in %LIBRARY_PREFIX/bin.

But definitely, it should be consistent; current status is:

  "Library/bin/thriftmd.dll",
  "Library/bin/thriftnbmd.dll",
  "Library/bin/thriftnbmd.lib",
  "Library/bin/thriftzmd.dll",
  "Library/bin/thriftzmd.lib",
  [... other stuff...]
  "Library/lib/thriftmd.lib"

It should also not be moved around manually in the build script after installation, because that will break the installed CMake metadata files.