Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] pcre2/*: instantiation of different 2 generators lead to undefined behavior #12787

Closed
sommerbifx opened this issue Sep 2, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@sommerbifx
Copy link

Package and Environment Details

  • Package Name/Version: prce2/10:39
  • Package Name/Version: prce2/10:40
  • Operating System+version: Win10
  • Compiler+version: vc17
  • Conan version: conan 1.51.0
  • Python version: Python 3.9.10

Conan profile

[settings]
os=Windows
os_build=Windows
arch=x86_64
compiler=Visual Studio
compiler.version=17
compiler.cppstd=17
build_type=Release
[options]
libdwarf:shared=True
libelf:shared=True
xerces-c:shared=True
[conf]
[build_requires]
*: cmake/[>=3.23.2]
[env]

Steps to reproduce

Start inside a clone of the conan-center-index
Create venv:
python -m venv .venv
Activate venv (Win):
.\.venv\Scripts\activate.bat
Update venv:
python -m pip install -r requirements.txt
Export recipe to conan cache
conan export recipes/pcre2/all pcre2/10.39@
Install with build of pcre2
conan install -pr <profile> pcre2/10.39@ --build pcre2

Logs

Click to expand log
Configuration:
[settings]
arch=x86_64
build_type=Release
compiler=Visual Studio
compiler.cppstd=17
compiler.runtime=MD
compiler.version=17
os=Windows
os_build=Windows
[options]
libdwarf:shared=True
libelf:shared=True
poco:enable_data_odbc=False
xerces-c:shared=True
[build_requires]
*: cmake/[>=3.23.2]
[env]

pcre2/10.39@sommerb/79a294fc: WARN: The package pcre2/10.39@sommerb/79a294fc:fd9a9b62bf1e3522e49e4c006b72bc34a2070df3 doesn't belong to the installed recipe revision, removing folder
Version ranges solved
    Version range '>=3.23.2' required by 'pcre2/10.39@sommerb/79a294fc' resolved to 'cmake/3.24.0' in local cache

Installing package: pcre2/10.39@sommerb/79a294fc
Requirements
    bzip2/1.0.8 from 'conan-des-eden-ifxsource-local' - Cache
    pcre2/10.39@sommerb/79a294fc from local cache - Cache
    zlib/1.2.12 from 'conan-des-eden-ifxsource-local' - Cache
Packages
    bzip2/1.0.8:53b5fd22ba061620078deefdae9a437c5f693201 - Cache
    pcre2/10.39@sommerb/79a294fc:fd9a9b62bf1e3522e49e4c006b72bc34a2070df3 - Build
    zlib/1.2.12:5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b - Cache
Build requirements
    cmake/3.24.0 from 'conan-des-eden-ifxsource-local' - Cache
Build requirements packages
    cmake/3.24.0:0a420ff5c47119e668867cdb51baff0eca1fdb68 - Cache

Installing (downloading, building) binaries...
bzip2/1.0.8: Already installed!
bzip2/1.0.8: Appending PATH environment variable: C:\Users\sommerb\.conan\data\bzip2\1.0.8\_\_\package\53b5fd22ba061620078deefdae9a437c5f693201\bin
cmake/3.24.0: Already installed!
cmake/3.24.0: Appending PATH environment variable: C:\Users\sommerb\.conan\data\cmake\3.24.0\_\_\package\0a420ff5c47119e668867cdb51baff0eca1fdb68\bin
zlib/1.2.12: Already installed!
pcre2/10.39@sommerb/79a294fc: Applying build-requirement: cmake/3.24.0
pcre2/10.39@sommerb/79a294fc: Configuring sources in C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\source\src
pcre2/10.39@sommerb/79a294fc:
pcre2/10.39@sommerb/79a294fc: Copying sources to build folder
pcre2/10.39@sommerb/79a294fc: Building your package in C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3
pcre2/10.39@sommerb/79a294fc: Generator txt created conanbuildinfo.txt
pcre2/10.39@sommerb/79a294fc: Calling generate()
pcre2/10.39@sommerb/79a294fc: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
pcre2/10.39@sommerb/79a294fc: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
pcre2/10.39@sommerb/79a294fc: Aggregating env generators
pcre2/10.39@sommerb/79a294fc: Calling build()
pcre2/10.39@sommerb/79a294fc: Apply patch (backport): correct the order of cmake_minimum_required() and project()
pcre2/10.39@sommerb/79a294fc: CMake command: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/package/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src"
-- Using Conan toolchain: C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/build/generators/conan_toolchain.cmake
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Conan: Target declared 'BZip2::BZip2'
-- Conan: Including build module from 'C:/Users/sommerb/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/lib/cmake/conan-official-bzip2-variables.cmake'
-- Conan: Target declared 'ZLIB::ZLIB'
CMake Warning at CMakeLists.txt:124 (FIND_PACKAGE):
  By not providing "FindReadline.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Readline",
  but CMake did not find one.

  Could not find a package configuration file provided by "Readline" with any
  of the following names:

    ReadlineConfig.cmake
    readline-config.cmake

  Add the installation prefix of "Readline" to CMAKE_PREFIX_PATH or set
  "Readline_DIR" to a directory containing one of the above files.  If
  "Readline" provides a separate development package or SDK, be sure it has
  been installed.


CMake Warning at CMakeLists.txt:125 (FIND_PACKAGE):
  By not providing "FindEditline.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Editline",
  but CMake did not find one.

  Could not find a package configuration file provided by "Editline" with any
  of the following names:

    EditlineConfig.cmake
    editline-config.cmake

  Add the installation prefix of "Editline" to CMAKE_PREFIX_PATH or set
  "Editline_DIR" to a directory containing one of the above files.  If
  "Editline" provides a separate development package or SDK, be sure it has
  been installed.


-- Looking for dirent.h
-- Looking for dirent.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for windows.h
-- Looking for windows.h - found
-- Looking for bcopy
-- Looking for bcopy - not found
-- Looking for memfd_create
-- Looking for memfd_create - not found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for realpath
-- Looking for realpath - not found
-- Looking for secure_getenv
-- Looking for secure_getenv - not found
-- Looking for strerror
-- Looking for strerror - found
-- Performing Test HAVE_ATTRIBUTE_UNINITIALIZED
-- Performing Test HAVE_ATTRIBUTE_UNINITIALIZED - Failed
-- Performing Test INTEL_CET_ENABLED
-- Performing Test INTEL_CET_ENABLED - Failed
--
--
-- PCRE2-10.39 configuration summary:
--
--   Install prefix .................. : C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/package/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3
--   C compiler ...................... : C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
--   C compiler flags ................ : /MP8 /DWIN32 /D_WINDOWS /W3
--
--   Build 8 bit PCRE2 library ....... : True
--   Build 16 bit PCRE2 library ...... : True
--   Build 32 bit PCRE2 library ...... : True
--   Enable JIT compiling support .... : False
--   Use SELinux allocator in JIT .... : IGNORE
--   Enable Unicode support .......... : ON
--   Newline char/sequence ........... : LF
--   \R matches only ANYCRLF ......... : OFF
--   \C is disabled .................. : OFF
--   EBCDIC coding ................... : OFF
--   EBCDIC coding with NL=0x25 ...... : OFF
--   Rebuild char tables ............. : OFF
--   Internal link size .............. : 2
--   Parentheses nest limit .......... : 250
--   Heap limit ...................... : 20000000
--   Match limit ..................... : 10000000
--   Match depth limit ............... : MATCH_LIMIT
--   Build shared libs ............... : False
--   Build static libs ............... : ON
--      with PIC enabled ............. : OFF
--   Build pcre2grep ................. : True
--   Enable JIT in pcre2grep ......... : ON
--   Enable callouts in pcre2grep .... : ON
--   Enable callout fork in pcre2grep. : True
--   Buffer size for pcre2grep ....... : 20480
--   Build tests (implies pcre2test .. : OFF
--                and pcre2grep)
--   Link pcre2grep with libz ........ : True
--   Link pcre2grep with libbz2 ...... : Library not found
--   Link pcre2test with libeditline . : Library not found
--   Link pcre2test with libreadline . : Library not found
--   Support Valgrind .................: OFF
--   Use %zu and %td ..................: AUTO
--   Install MSVC .pdb files ..........: OFF
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/build
pcre2/10.39@sommerb/79a294fc: CMake command: cmake --build "C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build" --config Release
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/src/CMakeLists.txt
  pcre2_auto_possess.c
  pcre2_chartables.c
  pcre2_compile.c
  pcre2_config.c
  pcre2_context.c
  pcre2_convert.c
  pcre2_dfa_match.c
  pcre2_error.c
  pcre2_extuni.c
  pcre2_find_bracket.c
  pcre2_jit_compile.c
  pcre2_maketables.c
  pcre2_match.c
  pcre2_match_data.c
  pcre2_newline.c
  pcre2_ord2utf.c
  pcre2_pattern_info.c
  pcre2_script_run.c
  pcre2_serialize.c
  pcre2_string_utils.c
  pcre2_study.c
  pcre2_substitute.c
  pcre2_substring.c
  pcre2_tables.c
  pcre2_ucd.c
  pcre2_valid_utf.c
  pcre2_xclass.c
  pcre2-16-static.vcxproj -> C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\Release\pcre2-16-static.lib
  Building Custom Rule C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/src/CMakeLists.txt
  pcre2_auto_possess.c
  pcre2_chartables.c
  pcre2_compile.c
  pcre2_config.c
  pcre2_context.c
  pcre2_convert.c
  pcre2_dfa_match.c
  pcre2_error.c
  pcre2_extuni.c
  pcre2_find_bracket.c
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2_compile.c(8188,9): warning C4267: '=': conversion from 'size_t' to 'PCRE2_UCHAR32', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2-32-static.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2_compile.c(10318,5): warning C4244: '=': conversion from '__int64' to 'PCRE2_UCHAR32', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2-32-static.vcxproj]
  pcre2_jit_compile.c
  pcre2_maketables.c
  pcre2_match.c
  pcre2_match_data.c
  pcre2_newline.c
  pcre2_ord2utf.c
  pcre2_pattern_info.c
  pcre2_script_run.c
  pcre2_serialize.c
  pcre2_string_utils.c
  pcre2_study.c
  pcre2_substitute.c
  pcre2_substring.c
  pcre2_tables.c
  pcre2_ucd.c
  pcre2_valid_utf.c
  pcre2_xclass.c
  pcre2-32-static.vcxproj -> C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\Release\pcre2-32-static.lib
  Building Custom Rule C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/src/CMakeLists.txt
  pcre2_auto_possess.c
  pcre2_chartables.c
  pcre2_compile.c
  pcre2_config.c
  pcre2_context.c
  pcre2_convert.c
  pcre2_dfa_match.c
  pcre2_error.c
  pcre2_extuni.c
  pcre2_find_bracket.c
  pcre2_jit_compile.c
  pcre2_maketables.c
  pcre2_match.c
  pcre2_match_data.c
  pcre2_newline.c
  pcre2_ord2utf.c
  pcre2_pattern_info.c
  pcre2_script_run.c
  pcre2_serialize.c
  pcre2_string_utils.c
  pcre2_study.c
  pcre2_substitute.c
  pcre2_substring.c
  pcre2_tables.c
  pcre2_ucd.c
  pcre2_valid_utf.c
  pcre2_xclass.c
  pcre2-8-static.vcxproj -> C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\Release\pcre2-8-static.lib
  Building Custom Rule C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/src/CMakeLists.txt
  pcre2posix.c
  pcre2-posix-static.vcxproj -> C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\Release\pcre2-posix-static.lib
  Building Custom Rule C:/Users/sommerb/.conan/data/pcre2/10.39/sommerb/79a294fc/build/fd9a9b62bf1e3522e49e4c006b72bc34a2070df3/src/CMakeLists.txt
  pcre2grep.c
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(438,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(439,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(442,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(443,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(455,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(458,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(465,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(472,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(474,1): warning C4090: 'initializing': different 'const' qualifiers [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(1286,12): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(2168,49): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(2420,10): warning C4244: '=': conversion from 'intptr_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(2489,29): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(2656,17): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(3016,50): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(3076,52): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(2836,43): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(3147,15): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(3347,58): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\src\src\pcre2grep.c(4229,68): warning C4267: 'function': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2grep.obj : error LNK2019: unresolved external symbol gzread referenced in function pcre2grep [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2grep.obj : error LNK2019: unresolved external symbol gzclose referenced in function grep_or_recurse [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2grep.obj : error LNK2019: unresolved external symbol gzopen referenced in function grep_or_recurse [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2grep.obj : error LNK2019: unresolved external symbol BZ2_bzopen referenced in function grep_or_recurse [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2grep.obj : error LNK2019: unresolved external symbol BZ2_bzread referenced in function pcre2grep [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2grep.obj : error LNK2019: unresolved external symbol BZ2_bzclose referenced in function grep_or_recurse [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2grep.obj : error LNK2019: unresolved external symbol BZ2_bzerror referenced in function grep_or_recurse [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\Release\pcre2grep.exe : fatal error LNK1120: 7 unresolved externals [C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build\pcre2grep.vcxproj]
pcre2/10.39@sommerb/79a294fc: pcre2/10.39@sommerb/79a294fc: ERROR: Package 'fd9a9b62bf1e3522e49e4c006b72bc34a2070df3' build failed
pcre2/10.39@sommerb/79a294fc: WARN: Build folder C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build

ERROR: pcre2/10.39@sommerb/79a294fc: Error in build() method, line 134
        cmake.build()
        ConanException: Error 1 while executing cmake --build "C:\Users\sommerb\.conan\data\pcre2\10.39\sommerb\79a294fc\build\fd9a9b62bf1e3522e49e4c006b72bc34a2070df3\build" --config Release
Issue is caused by instantiation of 2 generators in conanfile.py 'generate':

`
def generate(self):
tc = CMakeToolchain(self) <-------------------- here
# Mandatory because upstream CMakeLists overrides BUILD_SHARED_LIBS as a CACHE variable
# (see conan-io/conan#11840)
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
if Version(self.version) >= "10.38":
tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared
tc.variables["PCRE2_BUILD_PCRE2GREP"] = self.options.build_pcre2grep
tc.variables["PCRE2_SUPPORT_LIBZ"] = self.options.get_safe("with_zlib", False)
tc.variables["PCRE2_SUPPORT_LIBBZ2"] = self.options.get_safe("with_bzip2", False)
tc.variables["PCRE2_BUILD_TESTS"] = False
if is_msvc(self):
tc.variables["PCRE2_STATIC_RUNTIME"] = is_msvc_static_runtime(self)
tc.variables["PCRE2_DEBUG"] = self.settings.build_type == "Debug"
tc.variables["PCRE2_BUILD_PCRE2_8"] = self.options.build_pcre2_8
tc.variables["PCRE2_BUILD_PCRE2_16"] = self.options.build_pcre2_16
tc.variables["PCRE2_BUILD_PCRE2_32"] = self.options.build_pcre2_32
tc.variables["PCRE2_SUPPORT_JIT"] = self.options.support_jit
tc.variables["PCRE2GREP_SUPPORT_CALLOUT_FORK"] = self.options.get_safe("grep_support_callout_fork", False)
if Version(self.version) < "10.38":
# relocatable shared libs on Macos
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
tc.generate()

    cd = CMakeDeps(self)   <------------- and here
    cd.generate()

`

Unfortunately the issue depends on the underlying python installation.
With a venv according to the attached requirements.txt I could reproduce the issue.
requirements.txt

@sommerbifx sommerbifx added the bug Something isn't working label Sep 2, 2022
@SpaceIm
Copy link
Contributor

SpaceIm commented Sep 2, 2022

If this issue depends on a specific python venv, I guess it's more a conan client issue rather than something the recipe can fix.

@SpaceIm
Copy link
Contributor

SpaceIm commented Sep 2, 2022

Actually, it might come from a regression of CMakeDeps in conan 1.51.0 (conan-io/conan#11862) fixed in 1.51.3 (conan-io/conan#11874). It's unrelated to the fact that there are 2 or 3 or n generators.

Indeed, pcre2 CMakeLists links to variables like BZIP2_LIBRARIES (1) instead of BZip2::BZip2 (because their CMakeLists supports CMake >=3.1, and BZip2::BZip2 imported target has been introduced in CMake 3.7, /cc @memsharded regarding you comment conan-io/conan#11874 (review), here is a good example why it's needed), and the regression above affected these kind of variabes from what I've understood.

=======
(1) CMakeDeps should generate BZip2_LIBRARIES variables, and in bzip2 recipe we have a custom CMake module file to set BZIP2_LIBRARIES (casing is important, and it's the official one here: https://cmake.org/cmake/help/latest/module/FindBZip2.html) from BZip2_LIBRARIES.

@sommerbifx
Copy link
Author

At least on my system the issue is reproducible with the given venv. As far as I saw it seems to be a problem regarding the 2 different generators used in the recipe. In the erroneous case the generator related files look different than in the good case. So it might be a kind of runtime problem.

@sommerbifx
Copy link
Author

Just checked it with conan 1.51.3 issues is gone there. Thanks for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants