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

grpc: fix cross-build + provide all CMake executable imported targets + add shared option + modernize #9044

Merged
merged 18 commits into from
Feb 21, 2022

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Jan 23, 2022

This is a big PR fixing several issues:

  • add CMakeDeps support
  • provide all gRPC::<plugin> executable targets, not only gRPC::grpc_cpp_plugin. I've turned the custom module file to a template file reused at package time to generate one file per executable.
  • fix cross-build:
    • we can trust our protobuf::protoc target coming from conan generators. When this recipe will use CMakeToolchain, the patch could be removed thanks to CMakeToolchain: proper support of find_*() & include() commands conan#10186, because find_program() will always find executables from build context first.
    • CMAKE_MACOSX_BUNDLE forced to OFF to avoid CMake configuration error if target is iOS.
  • test package was more or less broken (issue was hidden by not calling conan_basic_setup(TARGETS), it would have never passed CI with CMakeToolchain) and using custom logic, not standard module file from protobuf => now the CMakeLists of test package shows a proper usage of protobuf + grpc.
  • add shared option

closes #6382
closes #8560


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@ghost
Copy link

ghost commented Jan 23, 2022

I detected other pull requests that are modifying grpc/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

link of targets was broken. It was working only due to global injection of many stuff through conan_basic_setup()
@SpaceIm
Copy link
Contributor Author

SpaceIm commented Jan 23, 2022

My gosh, I've realized something while trying to support shared in grpc recipe: conan_basic_setup() calls conan_set_rpath(), which force CMAKE_SKIP_RPATH on Apple.
It breaks any build where you build & call (in the build tree) an executable linked to a shared lib.
Indeed CMAKE_SKIP_RPATH is for the build tree only, and for a library like grpc (and most projects actually) you want rpath for binaries generated inside the build tree :s

When you call the install target, CMake doesn't only copy files, it removes rpath by default in installed libraries, so CMAKE_SKIP_RPATH should not be the default in conan recipes (only in recipes where we manually copy binaries in package()).
What we want in conan-center recipes is CMAKE_SKIP_INSTALL_RPATH ON and CMAKE_SKIP_RPATH OFF (the default CMake state, which is very good).

Basically conan_basic_setup(KEEP_RPATHS) fixes shared build of grpc on macOS.

Hoping it's not the default in conan v2.

/cc @memsharded @lasote

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Jan 23, 2022

Basically here is neat behavior for conan-center (grpc shared generated with conan_basic_setup(KEEP_RPATHS)):

otool -l grpc_cpp_plugin (an executable built & called during grpc project build) in build & install tree:

grpc_cpp_plugin in the build tree
grpc_cpp_plugin:
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __PAGEZERO
   vmaddr 0x0000000000000000
   vmsize 0x0000000100000000
  fileoff 0
 filesize 0
  maxprot 0x00000000
 initprot 0x00000000
   nsects 0
    flags 0x0
Load command 1
      cmd LC_SEGMENT_64
  cmdsize 632
  segname __TEXT
   vmaddr 0x0000000100000000
   vmsize 0x000000000001c000
  fileoff 0
 filesize 114688
  maxprot 0x00000005
 initprot 0x00000005
   nsects 7
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x0000000100002c10
      size 0x00000000000168aa
    offset 11280
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __stubs
   segname __TEXT
      addr 0x00000001000194ba
      size 0x00000000000003ae
    offset 103610
     align 2^1 (2)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 6 (size of stubs)
Section
  sectname __stub_helper
   segname __TEXT
      addr 0x0000000100019868
      size 0x0000000000000538
    offset 104552
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __gcc_except_tab
   segname __TEXT
      addr 0x0000000100019da0
      size 0x0000000000000cd4
    offset 105888
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __TEXT
      addr 0x000000010001aa80
      size 0x00000000000007d7
    offset 109184
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __cstring
   segname __TEXT
      addr 0x000000010001b257
      size 0x0000000000000409
    offset 111191
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __unwind_info
   segname __TEXT
      addr 0x000000010001b660
      size 0x0000000000000998
    offset 112224
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT_64
  cmdsize 312
  segname __DATA_CONST
   vmaddr 0x000000010001c000
   vmsize 0x0000000000004000
  fileoff 114688
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 3
    flags 0x10
Section
  sectname __got
   segname __DATA_CONST
      addr 0x000000010001c000
      size 0x0000000000000110
    offset 114688
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 157 (index into indirect symbol table)
 reserved2 0
Section
  sectname __mod_init_func
   segname __DATA_CONST
      addr 0x000000010001c110
      size 0x0000000000000010
    offset 114960
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000009
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __DATA_CONST
      addr 0x000000010001c120
      size 0x0000000000000930
    offset 114976
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 3
      cmd LC_SEGMENT_64
  cmdsize 312
  segname __DATA
   vmaddr 0x0000000100020000
   vmsize 0x0000000000004000
  fileoff 131072
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 3
    flags 0x0
Section
  sectname __la_symbol_ptr
   segname __DATA
      addr 0x0000000100020000
      size 0x00000000000004e8
    offset 131072
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000007
 reserved1 191 (index into indirect symbol table)
 reserved2 0
Section
  sectname __data
   segname __DATA
      addr 0x00000001000204e8
      size 0x0000000000000168
    offset 132328
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x0000000100020650
      size 0x0000000000000059
    offset 0
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 4
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __LINKEDIT
   vmaddr 0x0000000100024000
   vmsize 0x0000000000028000
  fileoff 147456
 filesize 151760
  maxprot 0x00000001
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 5
            cmd LC_DYLD_INFO_ONLY
        cmdsize 48
     rebase_off 147456
    rebase_size 152
       bind_off 147608
      bind_size 2920
  weak_bind_off 150528
 weak_bind_size 32904
  lazy_bind_off 183432
 lazy_bind_size 9432
     export_off 192864
    export_size 17312
Load command 6
     cmd LC_SYMTAB
 cmdsize 24
  symoff 211144
   nsyms 1129
  stroff 230600
 strsize 68616
Load command 7
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 280
     iextdefsym 280
     nextdefsym 670
      iundefsym 950
      nundefsym 179
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 229208
  nindirectsyms 348
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
Load command 8
          cmd LC_LOAD_DYLINKER
      cmdsize 32
         name /usr/lib/dyld (offset 12)
Load command 9
     cmd LC_UUID
 cmdsize 24
    uuid 0E082481-3384-3517-8C41-891CDB931542
Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 12.0
      sdk 12.1
   ntools 1
     tool 3
  version 711.0
Load command 11
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0
Load command 12
       cmd LC_MAIN
   cmdsize 24
  entryoff 11280
 stacksize 0
Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1311.0.0
compatibility version 1.0.0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name @rpath/libgrpc_plugin_support.1.43.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1.43.0
compatibility version 1.43.0
Load command 15
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name /usr/lib/libc++.1.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1200.3.0
compatibility version 1.0.0
Load command 16
          cmd LC_RPATH
      cmdsize 120
         path /Users/spaceim/.conan/data/openssl/1.1.1m/_/_/package/e4fbacdee83eb1a2e68227ffe19f6e9a61b36cbc/lib (offset 12)
Load command 17
          cmd LC_RPATH
      cmdsize 120
         path /Users/spaceim/.conan/data/protobuf/3.17.1/_/_/package/80f87b689c44329240fa96fdf4da01af5da79798/lib (offset 12)
Load command 18
          cmd LC_RPATH
      cmdsize 120
         path /Users/spaceim/.conan/data/c-ares/1.17.2/_/_/package/c30efb974509ebc40ac2eb16ba24cb589392f384/lib (offset 12)
Load command 19
          cmd LC_RPATH
      cmdsize 120
         path /Users/spaceim/.conan/data/abseil/20211102.0/_/_/package/1aff124b71f6d938138ecd7179ff075f4304a85d/lib (offset 12)
Load command 20
          cmd LC_RPATH
      cmdsize 120
         path /Users/spaceim/.conan/data/re2/20211101/_/_/package/1aff124b71f6d938138ecd7179ff075f4304a85d/lib (offset 12)
Load command 21
          cmd LC_RPATH
      cmdsize 120
         path /Users/spaceim/.conan/data/zlib/1.2.11/_/_/package/e4fbacdee83eb1a2e68227ffe19f6e9a61b36cbc/lib (offset 12)
Load command 22
          cmd LC_RPATH
      cmdsize 128
         path /Users/spaceim/.conan/data/grpc/1.43.0/_/_/build/70ebd75293805a009e60408c6088380b38dd5795/build_subfolder/lib (offset 12)
Load command 23
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 210176
 datasize 944
Load command 24
      cmd LC_DATA_IN_CODE
  cmdsize 16
  dataoff 211120
 datasize 24
grpc_cpp_plugin in the install tree
grpc_cpp_plugin:
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __PAGEZERO
   vmaddr 0x0000000000000000
   vmsize 0x0000000100000000
  fileoff 0
 filesize 0
  maxprot 0x00000000
 initprot 0x00000000
   nsects 0
    flags 0x0
Load command 1
      cmd LC_SEGMENT_64
  cmdsize 632
  segname __TEXT
   vmaddr 0x0000000100000000
   vmsize 0x000000000001c000
  fileoff 0
 filesize 114688
  maxprot 0x00000005
 initprot 0x00000005
   nsects 7
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x0000000100002c10
      size 0x00000000000168aa
    offset 11280
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __stubs
   segname __TEXT
      addr 0x00000001000194ba
      size 0x00000000000003ae
    offset 103610
     align 2^1 (2)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 6 (size of stubs)
Section
  sectname __stub_helper
   segname __TEXT
      addr 0x0000000100019868
      size 0x0000000000000538
    offset 104552
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __gcc_except_tab
   segname __TEXT
      addr 0x0000000100019da0
      size 0x0000000000000cd4
    offset 105888
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __TEXT
      addr 0x000000010001aa80
      size 0x00000000000007d7
    offset 109184
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __cstring
   segname __TEXT
      addr 0x000000010001b257
      size 0x0000000000000409
    offset 111191
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __unwind_info
   segname __TEXT
      addr 0x000000010001b660
      size 0x0000000000000998
    offset 112224
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT_64
  cmdsize 312
  segname __DATA_CONST
   vmaddr 0x000000010001c000
   vmsize 0x0000000000004000
  fileoff 114688
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 3
    flags 0x10
Section
  sectname __got
   segname __DATA_CONST
      addr 0x000000010001c000
      size 0x0000000000000110
    offset 114688
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 157 (index into indirect symbol table)
 reserved2 0
Section
  sectname __mod_init_func
   segname __DATA_CONST
      addr 0x000000010001c110
      size 0x0000000000000010
    offset 114960
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000009
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __DATA_CONST
      addr 0x000000010001c120
      size 0x0000000000000930
    offset 114976
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 3
      cmd LC_SEGMENT_64
  cmdsize 312
  segname __DATA
   vmaddr 0x0000000100020000
   vmsize 0x0000000000004000
  fileoff 131072
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 3
    flags 0x0
Section
  sectname __la_symbol_ptr
   segname __DATA
      addr 0x0000000100020000
      size 0x00000000000004e8
    offset 131072
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000007
 reserved1 191 (index into indirect symbol table)
 reserved2 0
Section
  sectname __data
   segname __DATA
      addr 0x00000001000204e8
      size 0x0000000000000168
    offset 132328
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x0000000100020650
      size 0x0000000000000059
    offset 0
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 4
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __LINKEDIT
   vmaddr 0x0000000100024000
   vmsize 0x0000000000028000
  fileoff 147456
 filesize 151760
  maxprot 0x00000001
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 5
            cmd LC_DYLD_INFO_ONLY
        cmdsize 48
     rebase_off 147456
    rebase_size 152
       bind_off 147608
      bind_size 2920
  weak_bind_off 150528
 weak_bind_size 32904
  lazy_bind_off 183432
 lazy_bind_size 9432
     export_off 192864
    export_size 17312
Load command 6
     cmd LC_SYMTAB
 cmdsize 24
  symoff 211144
   nsyms 1129
  stroff 230600
 strsize 68616
Load command 7
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 280
     iextdefsym 280
     nextdefsym 670
      iundefsym 950
      nundefsym 179
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 229208
  nindirectsyms 348
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
Load command 8
          cmd LC_LOAD_DYLINKER
      cmdsize 32
         name /usr/lib/dyld (offset 12)
Load command 9
     cmd LC_UUID
 cmdsize 24
    uuid 0E082481-3384-3517-8C41-891CDB931542
Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 12.0
      sdk 12.1
   ntools 1
     tool 3
  version 711.0
Load command 11
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0
Load command 12
       cmd LC_MAIN
   cmdsize 24
  entryoff 11280
 stacksize 0
Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1311.0.0
compatibility version 1.0.0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name @rpath/libgrpc_plugin_support.1.43.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1.43.0
compatibility version 1.43.0
Load command 15
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name /usr/lib/libc++.1.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1200.3.0
compatibility version 1.0.0
Load command 16
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 210176
 datasize 944
Load command 17
      cmd LC_DATA_IN_CODE
  cmdsize 16
  dataoff 211120
 datasize 24

You see that:

  • in the build tree, grpc_cpp_plugin can resolve all its shared dependencies whether they come from inside or outside the build tree.
  • in the install tree, grpc_cpp_plugin has no rpath => no more specific paths from build machine, it's what we expect for a relocatable binary => now if consumer adds grpc to its build requirements, he can use it with VirtualBuildEnv. Eventually he can manually edit rpath of this binary with relative paths to its dependencies if he wants to package an application, but that's another story.

@conan-center-bot

This comment has been minimized.

this a limitation of current conan model. Could be enabled again with CMakeToolchain + VirtualBuildEnv.
@conan-center-bot

This comment has been minimized.

@SpaceIm SpaceIm changed the title grpc: fix cross-build + provide all CMake executable imported targets + modernize grpc: fix cross-build + provide all CMake executable imported targets + add shared option + modernize Jan 23, 2022
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Jan 23, 2022

[ 98%] Linking CXX shared library ../lib/libgrpc++.so
/usr/bin/ld: /home/conan/w/BuildSingleReference/.conan/data/abseil/20211102.0/_/_/package/b173bbda18164d49a449ffadc1c9e817f49e819d/lib/libabsl_strings.a(charconv.cc.o): undefined reference to symbol 'nan@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

seriously?

Ok, so it turns out that abseil uses non-namespace nan. It means that they may not use nan from libstdc++, therefore requiring to link libm in abseil recipe: https://github.com/abseil/abseil-cpp/blob/fbbb5865a562c9a9167d71c1cf56b82025a8f065/absl/strings/charconv.cc#L86-L91

abseil/abseil-cpp#1100

I'll fix it in #6383

@lasote
Copy link
Contributor

lasote commented Jan 24, 2022

@SpaceIm In develop2 there is no CMAKE_SKIP_RPATH by default. You can set it to True adjusting the context of the rpath block. https://docs.conan.io/en/latest/reference/conanfile/tools/cmake/cmaketoolchain.html#extending-and-customizing-cmaketoolchain

@SpaceIm SpaceIm mentioned this pull request Feb 4, 2022
4 tasks
uilianries
uilianries previously approved these changes Feb 4, 2022
Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice!

@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Feb 4, 2022

?

@SpaceIm SpaceIm closed this Feb 4, 2022
@SpaceIm
Copy link
Contributor Author

SpaceIm commented Feb 4, 2022

Not really sure to understand why CI tried to build again.

@SpaceIm SpaceIm reopened this Feb 4, 2022
@conan-center-bot

This comment has been minimized.

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

All green in build 33 (065d57921d1cabe0534a6f8aa4899f3cf7ed7917):

  • grpc/1.43.0@:
    All packages built successfully! (All logs)

  • grpc/1.41.1@:
    All packages built successfully! (All logs)

  • grpc/1.42.0@:
    All packages built successfully! (All logs)

  • grpc/1.41.0@:
    All packages built successfully! (All logs)

  • grpc/1.37.1@:
    All packages built successfully! (All logs)

  • grpc/1.40.0@:
    All packages built successfully! (All logs)

  • grpc/1.39.1@:
    All packages built successfully! (All logs)

  • grpc/1.38.0@:
    All packages built successfully! (All logs)

  • grpc/1.38.1@:
    All packages built successfully! (All logs)

  • grpc/1.37.0@:
    All packages built successfully! (All logs)

@ghost ghost mentioned this pull request Feb 18, 2022
4 tasks
@conan-center-bot conan-center-bot merged commit 8803456 into conan-io:master Feb 21, 2022
@SpaceIm SpaceIm deleted the grpc-modernize branch February 21, 2022 07:47
SSE4 pushed a commit to madebr/conan-center-index that referenced this pull request Feb 21, 2022
…imported targets + add shared option + modernize

* modernize

* provide all CMake executables targets

* fix cross-build & patch in build() instead of source()

* fix test package

link of targets was broken. It was working only due to global injection of many stuff through conan_basic_setup()

* simplify test package

* add shared option

* do not test shared if cross-building

this a limitation of current conan model. Could be enabled again with CMakeToolchain + VirtualBuildEnv.

* fix cross-build to iOS

* handle codegen option in package_info()

* secure option doesn't affect package_id

this option doesn't exist upstream. It's a hack to hide unsecure components in global target generated by conan.

* drop shared with libstdc++/libstdc++11 for the moment

* test package: help gprc_cpp_plugin to find grpc_plugin_support if shared at build time

* handle cross-build in test package

* typo

* gRPC shared buils fine with clang on Linux

* fix install of plugins if cross-building

this bug exists in all versions of the range [1.39.0;1.42.0[

* with gcc allow grpc shared if abseil shared

it allows folks to create grpc shared, but we should find a way to compile with gcc grpc shared against abseil static

* really use @relative_path@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[request] grpc: Add shared option to recipe
6 participants