cern-fts / davix

High-performance file management over WebDAV / HTTP
GNU Lesser General Public License v2.1
83 stars 34 forks source link

Davix "master" branch fails to compile on macOS (caused by DMC-1394) #115

Closed chrisburr closed 6 months ago

chrisburr commented 6 months ago

This commit https://github.com/cern-fts/davix/commit/364d440b9072137b40efe6afac311671e49d0ba3 conflicts with a macro defined in the macOS SDK which results in errors like:

[ 16%] Building CXX object src/CMakeFiles/libdavix.dir/curl/StandaloneCurlRequest.cpp.o
/Users/cburr/Development/conda-forge/davix-feedstock/miniforge3/conda-bld/davix_1711060355645/work/src/curl/StandaloneCurlRequest.cpp:208:23: error: no matching function for call to '__tolower'
  auto header_lower = _tolower(header_name);
                      ^~~~~~~~~~~~~~~~~~~~~
/Users/cburr/Development/conda-forge/davix-feedstock/SDKs/MacOSX11.0.sdk/usr/include/_ctype.h:208:21: note: expanded from macro '_tolower'
#define _tolower(c)     __tolower(c)
                        ^~~~~~~~~
/Users/cburr/Development/conda-forge/davix-feedstock/SDKs/MacOSX11.0.sdk/usr/include/_ctype.h:189:20: note: candidate function not viable: no known conversion from 'const std::string' (aka 'const basic_string<char>') to '__darwin_ct_rune_t' (aka 'int') for 1st argument
__darwin_ct_rune_t      __tolower(__darwin_ct_rune_t);
                        ^
/Users/cburr/Development/conda-forge/davix-feedstock/miniforge3/conda-bld/davix_1711060355645/work/src/curl/StandaloneCurlRequest.cpp:211:25: error: no matching function for call to '__tolower'
    if (header_lower == _tolower(it.first)) {
                        ^~~~~~~~~~~~~~~~~~
    return 0;
/Users/cburr/Development/conda-forge/davix-feedstock/SDKs/MacOSX11.0.sdk/usr/include/_ctype.h:208:21: note: expanded from macro '_tolower'
#define _tolower(c)     __tolower(c)
                        ^~~~~~~~~
/Users/cburr/Development/conda-forge/davix-feedstock/SDKs/MacOSX11.0.sdk/usr/include/_ctype.h:189:20: note: candidate function not viable: no known conversion from 'const std::string' to '__darwin_ct_rune_t' (aka 'int') for 1st argument
__darwin_ct_rune_t      __tolower(__darwin_ct_rune_t);
                        ^
In file included from /Users/cburr/Development/conda-forge/davix-feedstock/miniforge3/conda-bld/davix_1711060355645/work/src/curl/StandaloneCurlRequest.cpp:22:
/Users/cburr/Development/conda-forge/davix-feedstock/miniforge3/conda-bld/davix_1711060355645/work/src/curl/StandaloneCurlRequest.hpp:127:8: warning: private field '_reuse_session' is not used [-Wunused-private-field]
  bool _reuse_session;
       ^
1 warning and 2 errors generated.

Renaming _tolower fixes the issue.

mpatrascoiu commented 6 months ago

Hello Chris,

Thanks for reporting this! Unfortunately, we don't have a macOS build job anymore in the pipeline. It would have spotted something like this.

I'll take care of it.

Cheers, Mihai