Skip to content

Commit

Permalink
deps: delete deps/zlib
Browse files Browse the repository at this point in the history
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.

Centralize on the version in V8 rather than the one in deps, and delete
the one in deps. Basically I just copied deps/zlib/zlib.gyp to
tools/v8_gypfiles/zlib.gyp, since the former had a better build
configuration (see the refs). This approach seemed better than the
opposite approach of centralizing on deps/zlib because:

1. We would need to occasionally bump deps/zlib manually after bumping
   deps/v8, which seemed annoying.
2. The maintenance steps for bumping zlib seemed more onerous than the
   maintenance steps for bumping V8.

(If we would prefer the opposite approach, I actually have another patch
 locally.)

One discrepancy was that V8's version of zlib had all symbols to be
prefixed with `Cr_z_` per deps/v8/third_party/zlib/chromeconf.h, which
seemed undesirable, so I added define `CHROMIUM_ZLIB_NO_CHROMECONF`
to the build to remove it. (deps/zlib handled this by just commenting
out the relevant include, but floating a patch seemed less desirable.)

I tested this on Linux with the default build and a --shared-zlib build.
I checked that the shared-zlib build correctly linked zlib according to
ldd. I would appreciate if the reviewers could suggest some other build
configurations to try.

Refs: nodejs#47145
Refs: nodejs#47151
  • Loading branch information
kvakil committed Mar 19, 2023
1 parent 9e9f68a commit 73d92c3
Show file tree
Hide file tree
Showing 142 changed files with 6 additions and 47,421 deletions.
520 changes: 0 additions & 520 deletions deps/zlib/BUILD.gn

This file was deleted.

3 changes: 0 additions & 3 deletions deps/zlib/DIR_METADATA

This file was deleted.

28 changes: 0 additions & 28 deletions deps/zlib/GN-scraper.py

This file was deleted.

19 changes: 0 additions & 19 deletions deps/zlib/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions deps/zlib/OWNERS

This file was deleted.

32 changes: 0 additions & 32 deletions deps/zlib/README.chromium

This file was deleted.

214 changes: 0 additions & 214 deletions deps/zlib/adler32.c

This file was deleted.

Loading

0 comments on commit 73d92c3

Please sign in to comment.