conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.17k stars 974 forks source link

file names case sensitivity #8240

Open galikrosentalik opened 3 years ago

galikrosentalik commented 3 years ago

Hi all, I recently updated my conan version from 1.17.0 to 1.32.0. my company legacy-code has package that contains 2 files with very similar names, separated only by case sensitivity..e.g.: foo.cpp Foo.cpp in old conan, 1.17.0 can run "conan create" with no problem, however in 1.32.0 "conan create" is failing with error of not finding "foo.cpp"

Putting aside good/bad practice for filenames that are different only by case, we would like to have support for our legacy code with new conan versions.

Is this behavior created on purpose? is it a bug?

memsharded commented 3 years ago

Hi @galikrosentalik

There was actually a bug in the self.copy() that was handling the "case-insensitivity" wrong: https://github.com/conan-io/conan/pull/7704. This fix unveiled some other hidden bugs and there was some other follow up PR like this https://github.com/conan-io/conan/pull/8009, about the "excludes" argument.

In short, the declared old default ignore_case=False was simply not true, and it was mostly in practice ignore_case=True. Being this the default, it should work in your case too, and package both foo.cpp and Foo.cpp, so maybe it is a bug. Can you please provide more details how to reproduce it? Is it in the exports? or in the self.copy() of the package() method? Can you also check the excludes if you have them? Thanks.

galikrosentalik commented 3 years ago

Thank's for your super quick response..

my package name is "utilities", has 2 files, socket.cpp and Socket.cpp, when runing the conan create command getting the following errors:

WARN: Migration: Updating settings.yml
Removing temporary .tgz files, they are stored in a different location now
[HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'url'. It is recommended to add it as attribute
Exporting package recipe
utilities/2.0.1@tevel/test exports_sources: Copied 1 '.yaml' file: docker-compose.yaml
utilities/2.0.1@tevel/test exports_sources: Copied 20 '.txt' files
utilities/2.0.1@tevel/test exports_sources: Copied 1 file: .gitignore
utilities/2.0.1@tevel/test exports_sources: Copied 1 '.md' file: README.md
utilities/2.0.1@tevel/test exports_sources: Copied 30 '.hpp' files
utilities/2.0.1@tevel/test exports_sources: Copied 2 '.py' files: conanfile.py, conanfile.py
utilities/2.0.1@tevel/test exports_sources: Copied 44 '.cpp' files
utilities/2.0.1@tevel/test exports_sources: Copied 1 '.json' file: configFile.json
utilities/2.0.1@tevel/test exports_sources: Copied 1 '.xml' file: vcs.xml
utilities/2.0.1@tevel/test: A new conanfile.py version was exported
utilities/2.0.1@tevel/test: Folder: /root/.conan/data/utilities/2.0.1/tevel/test/export
utilities/2.0.1@tevel/test: Using the exported files summary hash as the recipe revision: 870c7d41eaafb5ed9e7b376c4a236cef 
utilities/2.0.1@tevel/test: Exported revision: 870c7d41eaafb5ed9e7b376c4a236cef
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=6
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

prometheus-cpp/0.7.1@tevel/master: Not found in local cache, looking in remotes...
prometheus-cpp/0.7.1@tevel/master: Trying with 'tevel-conan'...
Downloading conanmanifest.txt completed [0.16k]                                          
Downloading conanfile.py completed [4.56k]                                               
Downloading conan_export.tgz completed [0.72k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
prometheus-cpp/0.7.1@tevel/master: Downloaded recipe revision 9d130f7a2be81a1b024be05e6c36f564
civetweb-conan/1.12.1@tevel/master: Not found in local cache, looking in remotes...
civetweb-conan/1.12.1@tevel/master: Trying with 'tevel-conan'...
Downloading conanmanifest.txt completed [74.99k]                                         
Downloading conanfile.py completed [3.44k]                                               
Downloading conan_export.tgz completed [5.46k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
civetweb-conan/1.12.1@tevel/master: Downloaded recipe revision 489dcf0bb01ed8f20a157a924ad7d875
OpenSSL/1.0.2q@conan/stable: Not found in local cache, looking in remotes...
OpenSSL/1.0.2q@conan/stable: Trying with 'tevel-conan'...
Downloading conanmanifest.txt completed [0.06k]                                          
Downloading conanfile.py completed [28.71k]                                              
OpenSSL/1.0.2q@conan/stable: Downloaded recipe revision 0
zlib/1.2.11@conan/stable: Not found in local cache, looking in remotes...
zlib/1.2.11@conan/stable: Trying with 'tevel-conan'...
Downloading conanmanifest.txt completed [0.29k]                                          
Downloading conanfile.py completed [8.74k]                                               
Downloading conan_export.tgz completed [0.75k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
zlib/1.2.11@conan/stable: Downloaded recipe revision 0
utilities/2.0.1@tevel/test: Forced build from source
Version ranges solved
    Version range '3.13.*' required by 'utilities/2.0.1@tevel/test' resolved to 'cmake_installer/3.13.4@conan/stable' in local cache

utilities/2.0.1@tevel/test (test package): Installing package
Requirements
    OpenSSL/1.0.2q@conan/stable from 'tevel-conan' - Downloaded
    civetweb-conan/1.12.1@tevel/master from 'tevel-conan' - Downloaded
    gtest/1.8.0@bincrafters/stable from 'tevel-conan' - Cache
    jsoncpp/1.8.4@tevel/stable from 'tevel-conan' - Cache
    libusb/1.0.23@bincrafters/stable from 'tevel-conan' - Cache
    prometheus-cpp/0.7.1@tevel/master from 'tevel-conan' - Downloaded
    utilities/2.0.1@tevel/test from local cache - Cache
    zlib/1.2.11@conan/stable from 'tevel-conan' - Downloaded
Packages
    OpenSSL/1.0.2q@conan/stable:008f1a2b119556f550c1109663570e0f5040c13f - Download
    civetweb-conan/1.12.1@tevel/master:52077c98de7e14745e4723048e5d11168b73b51c - Download
    gtest/1.8.0@bincrafters/stable:0684540f6e0cb45e66f4c71b899d05e6220b04e7 - Cache
    jsoncpp/1.8.4@tevel/stable:1f402c3b312c1c994b289edbcae0870d15c744f7 - Cache
    libusb/1.0.23@bincrafters/stable:34e663215a1b9ac013ae31ddcbb1422a87a98a8e - Cache
    prometheus-cpp/0.7.1@tevel/master:194c39ad42ac45c1f7943d33becf73ba1c932267 - Download
    utilities/2.0.1@tevel/test:2bf07de937b0d9b5eec04039bbe68d72b0028375 - Build
    zlib/1.2.11@conan/stable:f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb - Download
Build requirements
    cmake_installer/3.13.4@conan/stable from 'tevel-conan' - Cache
Build requirements packages
    cmake_installer/3.13.4@conan/stable:44fcf6b9a7fb86b2586303e3db40189d3b511830 - Cache

Installing (downloading, building) binaries...
zlib/1.2.11@conan/stable: Retrieving package f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb from remote 'tevel-conan' 
Downloading conanmanifest.txt completed [0.34k]                                          
Downloading conaninfo.txt completed [0.42k]                                              
Downloading conan_package.tgz completed [91.97k]                                         
Decompressing conan_package.tgz completed [0.00k]                                        
zlib/1.2.11@conan/stable: Package installed f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb
zlib/1.2.11@conan/stable: Downloaded package revision 0
OpenSSL/1.0.2q@conan/stable: Retrieving package 008f1a2b119556f550c1109663570e0f5040c13f from remote 'tevel-conan' 
Downloading conanmanifest.txt completed [4.92k]                                          
Downloading conaninfo.txt completed [1.27k]                                              
Downloading conan_package.tgz completed [3318.44k]                                       
Decompressing conan_package.tgz completed [0.00k]                                        
OpenSSL/1.0.2q@conan/stable: Package installed 008f1a2b119556f550c1109663570e0f5040c13f
OpenSSL/1.0.2q@conan/stable: Downloaded package revision 0
civetweb-conan/1.12.1@tevel/master: Retrieving package 52077c98de7e14745e4723048e5d11168b73b51c from remote 'tevel-conan' 
Downloading conanmanifest.txt completed [0.68k]                                          
Downloading conaninfo.txt completed [1.43k]                                              
Downloading conan_package.tgz completed [350.85k]                                        
Decompressing conan_package.tgz completed [0.00k]                                        
civetweb-conan/1.12.1@tevel/master: Package installed 52077c98de7e14745e4723048e5d11168b73b51c
civetweb-conan/1.12.1@tevel/master: Downloaded package revision 77df2c1b66e693d8abbe60ecf7b104db
prometheus-cpp/0.7.1@tevel/master: Retrieving package 194c39ad42ac45c1f7943d33becf73ba1c932267 from remote 'tevel-conan' 
Downloading conanmanifest.txt completed [2.04k]                                          
Downloading conaninfo.txt completed [1.71k]                                              
Downloading conan_package.tgz completed [169.08k]                                        
Decompressing conan_package.tgz completed [0.00k]                                        
prometheus-cpp/0.7.1@tevel/master: Package installed 194c39ad42ac45c1f7943d33becf73ba1c932267
prometheus-cpp/0.7.1@tevel/master: Downloaded package revision fbd2e034fcbe0255213b529938067f76
cmake_installer/3.13.4@conan/stable: Already installed!
gtest/1.8.0@bincrafters/stable: Already installed!
jsoncpp/1.8.4@tevel/stable: Already installed!
libusb/1.0.23@bincrafters/stable: Already installed!
utilities/2.0.1@tevel/test: Applying build-requirement: cmake_installer/3.13.4@conan/stable
utilities/2.0.1@tevel/test: Configuring sources in /root/.conan/data/utilities/2.0.1/tevel/test/source
utilities/2.0.1@tevel/test: Copying sources to build folder
utilities/2.0.1@tevel/test: Building your package in /root/.conan/data/utilities/2.0.1/tevel/test/build/2bf07de937b0d9b5eec04039bbe68d72b0028375
utilities/2.0.1@tevel/test: Generator cmake created conanbuildinfo.cmake
utilities/2.0.1@tevel/test: Calling build()
-- The CXX compiler identification is GNU 6.5.0
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Compiler GCC>=5, checking major version 6
-- Conan: Checking correct version: 6
-- Conan: C++ stdlib: libstdc++11
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Compiler GCC>=5, checking major version 6
-- Conan: Checking correct version: 6
-- Conan: C++ stdlib: libstdc++11
-- Configuring done
CMake Error at netUtility/CMakeLists.txt:4 (add_library):
  Cannot find source file:

    src/socket.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

CMake Error at netUtility/CMakeLists.txt:4 (add_library):
  No SOURCES given to target: netUtility

-- Build files have been written to: /root/.conan/data/utilities/2.0.1/tevel/test/build/2bf07de937b0d9b5eec04039bbe68d72b0028375
utilities/2.0.1@tevel/test: 
utilities/2.0.1@tevel/test: ERROR: Package '2bf07de937b0d9b5eec04039bbe68d72b0028375' build failed
utilities/2.0.1@tevel/test: WARN: Build folder /root/.conan/data/utilities/2.0.1/tevel/test/build/2bf07de937b0d9b5eec04039bbe68d72b0028375
ERROR: utilities/2.0.1@tevel/test: Error in build() method, line 28
    cmake.configure(source_folder=".")
    ConanException: Error 1 while executing cd '/root/.conan/data/utilities/2.0.1/tevel/test/build/2bf07de937b0d9b5eec04039bbe68d72b0028375' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="6" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libstdc++11" -DBUILD_SHARED_LIBS="ON" -DCMAKE_INSTALL_PREFIX="/root/.conan/data/utilities/2.0.1/tevel/test/package/2bf07de937b0d9b5eec04039bbe68d72b0028375" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -Wno-dev '/root/.conan/data/utilities/2.0.1/tevel/test/build/2bf07de937b0d9b5eec04039bbe68d72b0028375/.'

My package conan file:


from conans import ConanFile, CMake, tools

class UtilitiesConan(ConanFile):
    name = "utilities"
    version = 1.0.0
    license = ""
    author = "XXXXX"
    description = "XXXXX"
    topics = ("utils", "utilities", "common")
    settings = "os", "compiler", "build_type", "arch"
    options = {"shared": [True, False]}
    default_options = "shared=True", "jsoncpp:use_pic=True"
    generators = "cmake"
    exports_sources = "*"
    build_requires = "cmake_installer/[3.13.*]@conan/stable"

    def build(self):
        cmake = CMake(self)
        cmake.configure(source_folder=".")
        cmake.build()

    def package(self):
        self.copy("*Utility.h*", dst="include", keep_path=False)
        self.copy("*utilities.hpp", dst="include", keep_path=False)
        self.copy("*.h*", dst="include",keep_path=True)
        self.copy("*.lib", dst="lib", keep_path=False)
        self.copy("*.dll", dst="bin", keep_path=False)
        self.copy("*test", dst="bin", keep_path=False)
        self.copy("*configFile.json.json", dst="bin", keep_path=False)
        self.copy("*.so", dst="lib", keep_path=False)
        self.copy("*.dylib", dst="lib", keep_path=False)
        self.copy("*.a", dst="lib", keep_path=False)

    def package_info(self):
        self.cpp_info.libs = ["utilities"]

Is there any more data needed??