From 6ef6e8fb6ce79cfb386a4c74814d64ec11d3cf99 Mon Sep 17 00:00:00 2001 From: Keyhan Vakil Date: Thu, 22 Jun 2023 16:19:56 +0000 Subject: [PATCH] deps: delete deps/v8/third_party/zlib [1/3] This is the first of a series of patches. This patch is contains changes to the existing zlib.gyp file to allow it to be used by our v8.gyp. --- We currently have two copies of Chromium's zlib: one in deps/zlib and another in deps/v8/third_party/zlib. This has a couple of disadvantages: 1. There is an additional cost to keeping both dependencies up-to-date, and in fact they were already out-of-sync (see the refs). 2. People who compile with --shared-zlib (i.e. distro maintainers) will probably not be thrilled to learn that there is still a copy of zlib inside. 3. It's aesthetically unpleasing. This diff (per discussion in the refs) centralizes on deps/zlib and deletes deps/v8/third_party/zlib. When the user requests compiling with a shared zlib build, we still need to compile the contents of deps/zlib/google. This is not ideal but it's also not a change in behavior: prior to this diff those files were being compiled in the deps/v8/third_party/zlib version. I tested this on Linux with the default build and a --shared-zlib build. I checked that the shared-zlib build dynamically linked zlib according to ldd, and that the regular build did not. I would appreciate if the reviewers could suggest some other build configurations to try. Refs: https://github.com/nodejs/node/pull/47145 Refs: https://github.com/nodejs/node/pull/47157 --- deps/zlib/zlib.gyp | 55 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index 49de2a6c6de903..2e8bdd4a7213d0 100644 --- a/deps/zlib/zlib.gyp +++ b/deps/zlib/zlib.gyp @@ -5,18 +5,32 @@ { 'variables': { 'ZLIB_ROOT': '.', - 'use_system_zlib%': 0, 'arm_fpu%': '', 'llvm_version%': '0.0', }, + 'targets': [ + { + 'target_name': 'zlib_google', + 'toolsets': ['host', 'target'], + 'type': 'static_library', + 'sources': [ + '