Skip to content

Linux: gate WSC source files and zlib system deps on HC_NOWEBSOCKETS/HC_NOZLIB - #990

Closed
Patrick (v-patrickpe) wants to merge 1 commit into
microsoft:mainfrom
v-patrickpe:user/v-patrickpe/linux-wsc-deps-conditional
Closed

Linux: gate WSC source files and zlib system deps on HC_NOWEBSOCKETS/HC_NOZLIB#990
Patrick (v-patrickpe) wants to merge 1 commit into
microsoft:mainfrom
v-patrickpe:user/v-patrickpe/linux-wsc-deps-conditional

Conversation

@v-patrickpe

Copy link
Copy Markdown
Contributor

Addresses the first two checklist items in #989.

After #965, Linux consumers opting out of WebSockets (HC_NOWEBSOCKETS) or zlib (HC_NOZLIB) still paid the cost of building websocketpp_websocket.cpp and installing zlib1g/zlib1g-dev system packages.

Changes

  1. Build/libHttpClient.Linux/CMakeLists.txt — wrap websocketpp_websocket.{cpp,h} + x509_cert_utilities.hpp addition to LINUX_SOURCE_FILES in if (NOT DEFINED HC_NOWEBSOCKETS). Matches the existing pattern at line 89 (if (NOT DEFINED HC_NOZLIB) guards the zlib source list).

  2. Build/libHttpClient.Linux/install_dependencies.bash — skip zlib1g / zlib1g-dev when HC_NOZLIB=true or HC_NOWEBSOCKETS=true. WSC is the only consumer of zlib on Linux, so both opt-outs make zlib unnecessary. Build toolchain deps (clang/make/autoconf/automake/libtool) are unchanged.

Validation

  • No CMakeLists.txt logic change for the default path (HC_NOWEBSOCKETS undefined → same source list as before).
  • install_dependencies.bash default behavior unchanged when neither env var is set.
  • --check mode adapts automatically (loops over the same library_dependencies array, which is empty in the opt-out case).

Not in this PR (tracked in #989)

Resolves first two boxes of #989.

…HC_NOZLIB
After microsoft#965, websocketpp_websocket.cpp was added to LINUX_SOURCE_FILES unconditionally
and install_dependencies.bash installed zlib1g/zlib1g-dev unconditionally. Consumers
opting out via HC_NOWEBSOCKETS or HC_NOZLIB still paid the build/dep cost.
- CMakeLists.txt: gate websocketpp_websocket.{cpp,h} + x509_cert_utilities.hpp on
NOT DEFINED HC_NOWEBSOCKETS (matches existing HC_NOZLIB gating pattern at line 89).
- install_dependencies.bash: skip zlib1g/zlib1g-dev when HC_NOZLIB=true or
HC_NOWEBSOCKETS=true (compression cannot run without zlib, and websockets are
the only consumer of compression).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@v-patrickpe

Copy link
Copy Markdown
ContributorAuthor

Superseded by #992 (re-opened on this repo, not my fork, to enable ADO CI auto-trigger per Raul Gomez Rodriguez (@rgomez391)'s request). Closing this one.

Sign up for freeto 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.

1 participant

@v-patrickpe