Skip to content

Conversation

@lambdageek
Copy link
Member

@lambdageek lambdageek commented Jan 4, 2022

Instead of deciding whether features are enabled based on the presence or absence of zlib, add switches to control features (embedded PDB support, and compressed log profiler output) and based on that require zlib.

On some platforms we use the in-tree copy of zlib from src/native/external/zlib, otherwise we want to link against the system zlib.

Previously, if zlib was missing the build would quietly succeed, but the feature support would be missing. Now, if the feature isn't disabled but zlib is missing, we fail the build.

If both features are disabled, don't depend on zlib at all.

In particular this re-enables embedded PDB support on iOS and Android

The corresponding release/6.0-maui PR is #63359 and is more conservative - it just duplicates the mono/mono HAVE_SYS_ZLIB check. In this PR, we get rid of HAVE_SYS_ZLIB entirely.

In particular this re-enables embedded PDB support on iOS and Android
@lambdageek
Copy link
Member Author

/azp run runtime-manual

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lambdageek lambdageek self-assigned this Jan 4, 2022
@marek-safar marek-safar requested a review from thaystg January 5, 2022 13:51
thaystg
thaystg previously approved these changes Jan 5, 2022
@lambdageek lambdageek marked this pull request as draft January 5, 2022 14:21
@lambdageek
Copy link
Member Author

See #63365 (comment)

I think we can do better for net7: have explicit options for enable/disable Embedded PDB support and compressed log profiler output, and use those to decide whether zlib is required or not, and if it is required, whether we should depend on the system zlib, or the in-tree copy.

Instead of deciding whether features are enabled based on the presence or
absense of zlib, add switches to control features (embedded PDB support, and
compressed log profiler output) and based on that require zlib.

On some platforms we use the in-tree copy of zlib from
src/native/external/zlib, otherwise we want to link against the system zlib.

Previously, if zlib was missing the build would quietly succeed, but the
feature support would be missing.  Now, if the feature isn't disabled but zlib
is missing, we fail the build.

If both features are disabled, don't depend on zlib at all.
@lambdageek lambdageek changed the title [mono] Add back HAVE_SYS_ZLIB support [mono] Reorganize zlib dependency logic Jan 5, 2022
@lambdageek lambdageek marked this pull request as ready for review January 5, 2022 17:31
@lambdageek lambdageek dismissed thaystg’s stale review January 5, 2022 17:32

Changed pretty much everything

#cmakedefine DISABLE_QCALLS 1

/* Embedded PDB support disabled */
#cmakedefine DISABLE_EMBEDDED_PDB 1
Copy link
Member

Choose a reason for hiding this comment

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

nit: when DISABLE_EMBEDDED_PDB is defined in cmake config, this produces:

#define DISABLE_EMBEDDED_PDB 1

in coreclr, src/native etc., we use these two variants:

#cmakedefine TOKEN
#cmakedefine01 TOKEN

when TOKEN is defined in cmake config, it generates:

#define TOKEN // usage: #ifdef TOKEN
#define TOKEN 1 // usage: #if TOKEN

and when undefined, produces:

// nothing for the first line
#define TOKEN 0  // usage: #if TOKEN

lambdageek and others added 2 commits January 5, 2022 12:59
Co-authored-by: Adeel Mujahid <[email protected]>
- reverse if() logic to avoid negation

- use cmakedefine without a value in config.h.in, same as CoreCLR
@steveisok steveisok self-requested a review January 6, 2022 21:14
@lambdageek lambdageek merged commit 0e800a6 into dotnet:main Jan 6, 2022
steveisok pushed a commit that referenced this pull request Jan 10, 2022
In particular this re-enables embedded PDB support on iOS and Android

The corresponding PR for main is #63365
@ghost ghost locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants