KEMBAR78
Use feature flags for CFNetworkHandler and NSUrlSessionHandler by mcumming · Pull Request #22703 · dotnet/macios · GitHub
Skip to content

Conversation

@mcumming
Copy link
Contributor

@mcumming mcumming commented Apr 30, 2025

Continuation of #19003

This means the linker will remove either CFNetworkHandler or NSUrlSessionHandler depending on which is chosen at build time (or both, if neither is chosen).

This will shrink app size a little bit, here are the types and members that are no longer included when using NSUrlSessionHandler: https://gist.github.com/rolfbjarne/102d77d5f105a7c98ac6be19de725dd5

A very basic app is ~55kb / 0.2% smaller: https://gist.github.com/rolfbjarne/a1cb6898aa560f0a891286be20b9bc3e

Fixes #14298.

@mcumming mcumming changed the title USe feature flags for CFNetworkHandler and NSUrlSessionHandler Use feature flags for CFNetworkHandler and NSUrlSessionHandler Apr 30, 2025
@mcumming mcumming requested a review from rolfbjarne April 30, 2025 16:05
@github-actions
Copy link
Contributor

⚠️ Your code has been reformatted. ⚠️

If this is not desired, add the actions-disable-autoformat label, and revert the reformatting commit.

If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@github-actions
Copy link
Contributor

⚠️ Your code has been reformatted. ⚠️

If this is not desired, add the actions-disable-autoformat label, and revert the reformatting commit.

If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2025

⚠️ Your code has been reformatted. ⚠️

If this is not desired, add the actions-disable-autoformat label, and revert the reformatting commit.

If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne self-assigned this May 19, 2025
@rolfbjarne
Copy link
Member

I'll take over this.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #909d1ed] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #909d1ed] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

.NET ( No breaking changes )

✅ API diff vs stable

.NET ( No breaking changes )

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #909d1ed] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #909d1ed] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #909d1ed] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #909d1ed] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #909d1ed] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #909d1ed] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 118 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 909d1ed220dc85aec278274fbdfe21a344abfe14 [PR build]

@rolfbjarne rolfbjarne merged commit 30ebb25 into main May 20, 2025
44 checks passed
@rolfbjarne rolfbjarne deleted the dev/mcumming/feature-switch-cfnetworkhandler branch May 20, 2025 17:27
rolfbjarne added a commit that referenced this pull request Jul 4, 2025
…eHttpHandler='false'.

This makes this code in project files work (which it used to, until #22703,
because our submission tests do this):

```xml
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
```
rolfbjarne added a commit that referenced this pull request Jul 10, 2025
…eHttpHandler='false'. (#23261)

This makes this code in project files work (which it used to, until #22703,
because our submission tests do this):

```xml
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider using a Feature Switch for CFNetworkHandler and NSUrlSessionHandler

7 participants