{"action":"created","comment":{"url":"https://api.github.com/repos/apache/arrow/pulls/comments/213671505","pull_request_review_id":150554809,"id":213671505,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzY3MTUwNQ==","diff_hunk":"@@ -39,45 +39,76 @@ elseif ( ZLIB_HOME )\n     list( APPEND _zlib_roots ${ZLIB_HOME} )\n endif()\n \n+set(ZLIB_LIB_NAME z)\n+if (MSVC)\n+  if (NOT ZLIB_MSVC_STATIC_LIB_SUFFIX)\n+    set(ZLIB_MSVC_STATIC_LIB_SUFFIX libstatic)\n+  endif ()\n+  set(ZLIB_MSVC_SHARED_LIB_SUFFIX lib)\n+endif ()\n+set(ZLIB_STATIC_LIB_NAME\n+  ${CMAKE_STATIC_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${ZLIB_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})\n+set(ZLIB_SHARED_LIB_NAME\n+  ${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${ZLIB_MSVC_SHARED_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})\n+\n # Try the parameterized roots, if they exist\n-if ( _zlib_roots )\n-    find_path( ZLIB_INCLUDE_DIR NAMES zlib.h\n-        PATHS ${_zlib_roots} NO_DEFAULT_PATH\n-        PATH_SUFFIXES \"include\" )\n-    find_library( ZLIB_LIBRARIES NAMES libz.a zlib\n-        PATHS ${_zlib_roots} NO_DEFAULT_PATH\n-        PATH_SUFFIXES \"lib\" )\n+if (_zlib_roots)\n+  find_path(ZLIB_INCLUDE_DIR NAMES zlib.h\n+    PATHS ${_zlib_roots} NO_DEFAULT_PATH\n+    PATH_SUFFIXES \"include\")\n+  find_library(ZLIB_STATIC_LIB NAMES ${ZLIB_STATIC_LIB_NAME}\n+    PATHS ${_zlib_roots} NO_DEFAULT_PATH\n+    PATH_SUFFIXES \"lib\")\n+  find_library(ZLIB_SHARED_LIB NAMES ${ZLIB_SHARED_LIB_NAME}\n+    PATHS ${_zlib_roots} NO_DEFAULT_PATH\n+    PATH_SUFFIXES \"lib\")\n else ()\n-    find_path( ZLIB_INCLUDE_DIR NAMES zlib.h )\n-    # Only look for the static library\n-    find_library( ZLIB_LIBRARIES NAMES libz.a zlib )\n+  pkg_check_modules(ZLIB zlib)\n+  if (ZLIB_FOUND)\n+    set(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDEDIR})\n+    find_library(ZLIB_STATIC_LIB NAMES ${ZLIB_STATIC_LIB_NAME}\n+      PATHS ${ZLIB_LIB_DIR} NO_DEFAULT_PATHS)\n+    find_library(ZLIB_SHARED_LIB NAMES ${ZLIB_SHARED_LIB_NAME}\n+      PATHS ${ZLIB_LIB_DIR} NO_DEFAULT_PATHS)\n+  else ()\n+    find_path(ZLIB_INCLUDE_DIR NAMES zlib.h)\n+    find_library(ZLIB_STATIC_LIB NAMES ${ZLIB_STATIC_LIB_NAME})\n+    find_library(ZLIB_SHARED_LIB NAMES ${ZLIB_SHARED_LIB_NAME})\n+  endif ()\n endif ()\n \n-\n-if (ZLIB_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR ZLIB_LIBRARIES))\n+if (ZLIB_INCLUDE_DIR AND (ZLIB_STATIC_LIB OR ZLIB_SHARED_LIB))\n   set(ZLIB_FOUND TRUE)\n-  get_filename_component( ZLIB_LIBS ${ZLIB_LIBRARIES} PATH )\n-  set(ZLIB_HEADER_NAME zlib.h)\n-  set(ZLIB_HEADER ${ZLIB_INCLUDE_DIR}/${ZLIB_HEADER_NAME})\n-  set(ZLIB_LIB_NAME z)\n-  if (MSVC)\n-    if (NOT ZLIB_MSVC_STATIC_LIB_SUFFIX)\n-      set(ZLIB_MSVC_STATIC_LIB_SUFFIX libstatic)\n-    endif()\n-    set(ZLIB_MSVC_SHARED_LIB_SUFFIX lib)\n-  endif()\n-  set(ZLIB_STATIC_LIB ${ZLIB_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${ZLIB_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})\n-  set(ZLIB_SHARED_LIB ${ZLIB_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${ZLIB_MSVC_SHARED_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})\n else ()\n   set(ZLIB_FOUND FALSE)\n endif ()\n \n+\n+if (ZLIB_FOUND)\n+  set(ZLIB_LIBS)\n+  if (ZLIB_STATIC_LIB)\n+    get_filename_component(ZLIB_STATIC_LIB_DIR ${ZLIB_STATIC_LIB} DIRECTORY)\n+    list(APPEND ZLIB_LIBS ${ZLIB_STATIC_LIB_DIR})\n+  endif ()\n+  if (ZLIB_SHARED_LIB)\n+    get_filename_component(ZLIB_SHARED_LIB_DIR ${ZLIB_SHARED_LIB} DIRECTORY)\n+    list(APPEND ZLIB_LIBS ${ZLIB_STATIC_LIB_DIR})\n+  endif ()\n+  set(ZLIB_HEADER_NAME zlib.h)\n+  set(ZLIB_HEADER ${ZLIB_INCLUDE_DIR}/${ZLIB_HEADER_NAME})\n+endif ()\n+\n if (ZLIB_FOUND)\n   if (NOT ZLIB_FIND_QUIETLY)\n     if (PARQUET_MINIMAL_DEPENDENCY)","path":"cpp/cmake_modules/FindZLIB.cmake","position":null,"original_position":89,"commit_id":"1433593feea51d6911aff516a6ff2f88779a7a0a","original_commit_id":"59f93c854dd715ce08bef692f6f98db31b278b42","user":{"login":"xhochy","id":70274,"node_id":"MDQ6VXNlcjcwMjc0","avatar_url":"https://avatars2.githubusercontent.com/u/70274?v=4","gravatar_id":"","url":"https://api.github.com/users/xhochy","html_url":"https://github.com/xhochy","followers_url":"https://api.github.com/users/xhochy/followers","following_url":"https://api.github.com/users/xhochy/following{/other_user}","gists_url":"https://api.github.com/users/xhochy/gists{/gist_id}","starred_url":"https://api.github.com/users/xhochy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xhochy/subscriptions","organizations_url":"https://api.github.com/users/xhochy/orgs","repos_url":"https://api.github.com/users/xhochy/repos","events_url":"https://api.github.com/users/xhochy/events{/privacy}","received_events_url":"https://api.github.com/users/xhochy/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2018-08-29T13:17:36Z","updated_at":"2018-08-29T13:17:36Z","html_url":"https://github.com/apache/arrow/pull/2483#discussion_r213671505","pull_request_url":"https://api.github.com/repos/apache/arrow/pulls/2483","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apache/arrow/pulls/comments/213671505"},"html":{"href":"https://github.com/apache/arrow/pull/2483#discussion_r213671505"},"pull_request":{"href":"https://api.github.com/repos/apache/arrow/pulls/2483"}},"in_reply_to_id":213285786},"pull_request":{"url":"https://api.github.com/repos/apache/arrow/pulls/2483","id":211315249,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExMzE1MjQ5","html_url":"https://github.com/apache/arrow/pull/2483","diff_url":"https://github.com/apache/arrow/pull/2483.diff","patch_url":"https://github.com/apache/arrow/pull/2483.patch","issue_url":"https://api.github.com/repos/apache/arrow/issues/2483","number":2483,"state":"open","locked":false,"title":"ARROW-3128: [C++] Support system shared zlib","user":{"login":"kou","id":27350,"node_id":"MDQ6VXNlcjI3MzUw","avatar_url":"https://avatars3.githubusercontent.com/u/27350?v=4","gravatar_id":"","url":"https://api.github.com/users/kou","html_url":"https://github.com/kou","followers_url":"https://api.github.com/users/kou/followers","following_url":"https://api.github.com/users/kou/following{/other_user}","gists_url":"https://api.github.com/users/kou/gists{/gist_id}","starred_url":"https://api.github.com/users/kou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kou/subscriptions","organizations_url":"https://api.github.com/users/kou/orgs","repos_url":"https://api.github.com/users/kou/repos","events_url":"https://api.github.com/users/kou/events{/privacy}","received_events_url":"https://api.github.com/users/kou/received_events","type":"User","site_admin":false},"body":"Debian package recommends not static linking zlib for security reason. If we use zlib as a static library, Debian package lint reports the following error:\r\n\r\n    E: libarrow10: embedded-library usr/lib/x86_64-linux-gnu/libarrow.so.10.0.0: zlib\r\n\r\nembedded-library error detail: https://lintian.debian.org/tags/embedded-library.html\r\n\r\nzlib detection by pkg-config is also added because system zlib provides zlib.pc.\r\n\r\nDetect order:\r\n\r\n  * ZLIB_HOME environment\r\n  * Vendored zlib\r\n  * pkg-config\r\n\r\nThis is backward compatible. If we use -DARROW_WITH_VENDORED=OFF\r\n-DARROW_ZLIB_USE_SHARED=ON, we can use zlib installed by zlib1g-dev on\r\nDebian. We can't use zlib installed by zlib1g-dev without\r\n-DARROW_ZLIB_USE_SHARED=ON. Because libz.a in zlib1g isn't built with\r\n-fPIC.","created_at":"2018-08-28T06:33:42Z","updated_at":"2018-08-29T13:17:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf91a5e5db2d853bd855e40d721c9200f9a59472","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/arrow/pulls/2483/commits","review_comments_url":"https://api.github.com/repos/apache/arrow/pulls/2483/comments","review_comment_url":"https://api.github.com/repos/apache/arrow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/arrow/issues/2483/comments","statuses_url":"https://api.github.com/repos/apache/arrow/statuses/1433593feea51d6911aff516a6ff2f88779a7a0a","head":{"label":"kou:cpp-system-zlib","ref":"cpp-system-zlib","sha":"1433593feea51d6911aff516a6ff2f88779a7a0a","user":{"login":"kou","id":27350,"node_id":"MDQ6VXNlcjI3MzUw","avatar_url":"https://avatars3.githubusercontent.com/u/27350?v=4","gravatar_id":"","url":"https://api.github.com/users/kou","html_url":"https://github.com/kou","followers_url":"https://api.github.com/users/kou/followers","following_url":"https://api.github.com/users/kou/following{/other_user}","gists_url":"https://api.github.com/users/kou/gists{/gist_id}","starred_url":"https://api.github.com/users/kou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kou/subscriptions","organizations_url":"https://api.github.com/users/kou/orgs","repos_url":"https://api.github.com/users/kou/repos","events_url":"https://api.github.com/users/kou/events{/privacy}","received_events_url":"https://api.github.com/users/kou/received_events","type":"User","site_admin":false},"repo":{"id":77059106,"node_id":"MDEwOlJlcG9zaXRvcnk3NzA1OTEwNg==","name":"arrow","full_name":"kou/arrow","owner":{"login":"kou","id":27350,"node_id":"MDQ6VXNlcjI3MzUw","avatar_url":"https://avatars3.githubusercontent.com/u/27350?v=4","gravatar_id":"","url":"https://api.github.com/users/kou","html_url":"https://github.com/kou","followers_url":"https://api.github.com/users/kou/followers","following_url":"https://api.github.com/users/kou/following{/other_user}","gists_url":"https://api.github.com/users/kou/gists{/gist_id}","starred_url":"https://api.github.com/users/kou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kou/subscriptions","organizations_url":"https://api.github.com/users/kou/orgs","repos_url":"https://api.github.com/users/kou/repos","events_url":"https://api.github.com/users/kou/events{/privacy}","received_events_url":"https://api.github.com/users/kou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kou/arrow","description":"Mirror of Apache Arrow","fork":true,"url":"https://api.github.com/repos/kou/arrow","forks_url":"https://api.github.com/repos/kou/arrow/forks","keys_url":"https://api.github.com/repos/kou/arrow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kou/arrow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kou/arrow/teams","hooks_url":"https://api.github.com/repos/kou/arrow/hooks","issue_events_url":"https://api.github.com/repos/kou/arrow/issues/events{/number}","events_url":"https://api.github.com/repos/kou/arrow/events","assignees_url":"https://api.github.com/repos/kou/arrow/assignees{/user}","branches_url":"https://api.github.com/repos/kou/arrow/branches{/branch}","tags_url":"https://api.github.com/repos/kou/arrow/tags","blobs_url":"https://api.github.com/repos/kou/arrow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kou/arrow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kou/arrow/git/refs{/sha}","trees_url":"https://api.github.com/repos/kou/arrow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kou/arrow/statuses/{sha}","languages_url":"https://api.github.com/repos/kou/arrow/languages","stargazers_url":"https://api.github.com/repos/kou/arrow/stargazers","contributors_url":"https://api.github.com/repos/kou/arrow/contributors","subscribers_url":"https://api.github.com/repos/kou/arrow/subscribers","subscription_url":"https://api.github.com/repos/kou/arrow/subscription","commits_url":"https://api.github.com/repos/kou/arrow/commits{/sha}","git_commits_url":"https://api.github.com/repos/kou/arrow/git/commits{/sha}","comments_url":"https://api.github.com/repos/kou/arrow/comments{/number}","issue_comment_url":"https://api.github.com/repos/kou/arrow/issues/comments{/number}","contents_url":"https://api.github.com/repos/kou/arrow/contents/{+path}","compare_url":"https://api.github.com/repos/kou/arrow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kou/arrow/merges","archive_url":"https://api.github.com/repos/kou/arrow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kou/arrow/downloads","issues_url":"https://api.github.com/repos/kou/arrow/issues{/number}","pulls_url":"https://api.github.com/repos/kou/arrow/pulls{/number}","milestones_url":"https://api.github.com/repos/kou/arrow/milestones{/number}","notifications_url":"https://api.github.com/repos/kou/arrow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kou/arrow/labels{/name}","releases_url":"https://api.github.com/repos/kou/arrow/releases{/id}","deployments_url":"https://api.github.com/repos/kou/arrow/deployments","created_at":"2016-12-21T14:34:59Z","updated_at":"2018-08-22T02:52:56Z","pushed_at":"2018-08-29T08:00:01Z","git_url":"git://github.com/kou/arrow.git","ssh_url":"git@github.com:kou/arrow.git","clone_url":"https://github.com/kou/arrow.git","svn_url":"https://github.com/kou/arrow","homepage":null,"size":14701,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"d20147e7e3f506f03de9002da3f65467500869dc","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":51905353,"node_id":"MDEwOlJlcG9zaXRvcnk1MTkwNTM1Mw==","name":"arrow","full_name":"apache/arrow","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/arrow","description":"Apache Arrow is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. Languages currently supported include C, C++, Java, JavaScript, Python, and Ruby.","fork":false,"url":"https://api.github.com/repos/apache/arrow","forks_url":"https://api.github.com/repos/apache/arrow/forks","keys_url":"https://api.github.com/repos/apache/arrow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/arrow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/arrow/teams","hooks_url":"https://api.github.com/repos/apache/arrow/hooks","issue_events_url":"https://api.github.com/repos/apache/arrow/issues/events{/number}","events_url":"https://api.github.com/repos/apache/arrow/events","assignees_url":"https://api.github.com/repos/apache/arrow/assignees{/user}","branches_url":"https://api.github.com/repos/apache/arrow/branches{/branch}","tags_url":"https://api.github.com/repos/apache/arrow/tags","blobs_url":"https://api.github.com/repos/apache/arrow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/arrow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/arrow/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/arrow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/arrow/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/arrow/languages","stargazers_url":"https://api.github.com/repos/apache/arrow/stargazers","contributors_url":"https://api.github.com/repos/apache/arrow/contributors","subscribers_url":"https://api.github.com/repos/apache/arrow/subscribers","subscription_url":"https://api.github.com/repos/apache/arrow/subscription","commits_url":"https://api.github.com/repos/apache/arrow/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/arrow/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/arrow/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/arrow/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/arrow/contents/{+path}","compare_url":"https://api.github.com/repos/apache/arrow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/arrow/merges","archive_url":"https://api.github.com/repos/apache/arrow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/arrow/downloads","issues_url":"https://api.github.com/repos/apache/arrow/issues{/number}","pulls_url":"https://api.github.com/repos/apache/arrow/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/arrow/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/arrow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/arrow/labels{/name}","releases_url":"https://api.github.com/repos/apache/arrow/releases{/id}","deployments_url":"https://api.github.com/repos/apache/arrow/deployments","created_at":"2016-02-17T08:00:23Z","updated_at":"2018-08-29T06:53:36Z","pushed_at":"2018-08-29T11:48:33Z","git_url":"git://github.com/apache/arrow.git","ssh_url":"git@github.com:apache/arrow.git","clone_url":"https://github.com/apache/arrow.git","svn_url":"https://github.com/apache/arrow","homepage":"https://arrow.apache.org","size":14799,"stargazers_count":2366,"watchers_count":2366,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":636,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":636,"open_issues":53,"watchers":2366,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/arrow/pulls/2483"},"html":{"href":"https://github.com/apache/arrow/pull/2483"},"issue":{"href":"https://api.github.com/repos/apache/arrow/issues/2483"},"comments":{"href":"https://api.github.com/repos/apache/arrow/issues/2483/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/arrow/pulls/2483/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/arrow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/arrow/pulls/2483/commits"},"statuses":{"href":"https://api.github.com/repos/apache/arrow/statuses/1433593feea51d6911aff516a6ff2f88779a7a0a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"xhochy"}}