Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compartment-mapper): Collect unused module descriptors #2614

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

kriskowal
Copy link
Member

Closes: #2313

Description

This change adds instrumentation to the compartment mapper that allows it to omit module descriptors from archive compartment maps if they’re not needed to link the archived application.

Security Considerations

None.

Scaling Considerations

Should reduce bundle sizes.

Documentation Considerations

Does not merit attention and one less surprise for bundle size investigators. Noted in NEWS.

Testing Considerations

This change augments the existing test for compartment retention to cover module descriptor collection.

Compatibility Considerations

The change does not add the "retained" property to archived compartment-map.json, so new bundles should remain compatible with older versions of checkBundle. However, I relaxed the schema validator to get an unrelated test for captureCompartmentMap passing, so future deployments of checkBundle will be more lenient.

Upgrade Considerations

Should not affect upgrades.

Copy link
Contributor

@warner warner left a comment

Choose a reason for hiding this comment

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

Looks good to me. My understanding is that the generated archives will have exactly the same files as before (those are already minimal), but the compartment-map.json metadata will omit some linkage fields for unused exports, which are likely to be more common as we become more explicit about what each package exports (to discourage deep-imports).

@kriskowal kriskowal force-pushed the kriskowal-sweep-modules-2313 branch from d160c67 to e3b310d Compare October 24, 2024 23:07
@kriskowal kriskowal enabled auto-merge October 24, 2024 23:08
@kriskowal kriskowal merged commit 4ca4028 into master Oct 24, 2024
15 checks passed
@kriskowal kriskowal deleted the kriskowal-sweep-modules-2313 branch October 24, 2024 23:18
Sign up for free to 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.

feat(compartment-mapper): Collect unused module descriptors
2 participants