Skip to content

Conversation

mszabo-wikia
Copy link
Contributor

@mszabo-wikia mszabo-wikia commented Aug 2, 2025

D74667088 marked MemoSensitiveImplicitContext as __Sealed, with only a single class permitted to directly extend it. This class is however internal to Meta, causing typechecking errors in OSS Hack.

As a fix, mark the attribute with // @oss-disable to remove it during the code export process.

NOTE: If I'm understanding the docs[1] for @oss-disable / @oss-enable correctly, this should be the correct way to make this change, which should then transform into // @oss-disable FBMemoAgnosticImplicitContext::class once this patch is merged and exported. Let me know if this assumption is incorrect.

[1] https://github.com/facebook/buck2/blob/239ab927a5be7dee3035141d29e2e9c91e8ea771/HACKING.md?plain=1#L168

@meta-cla meta-cla bot added the CLA Signed label Aug 2, 2025
@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D79505213. (Because this pull request was imported automatically, there will not be any future comments.)

@Wilfred
Copy link
Contributor

Wilfred commented Aug 5, 2025

Our HSL CI fails on this diff, I presume because you end up with <<__Sealed()>> which doesn't allow extension at all. Perhaps we should just not seal it in OSS?

D74667088 marked MemoSensitiveImplicitContext as __Sealed, with only a
single class permitted to directly extend it. This class is however
internal to Meta, causing typechecking errors in OSS Hack.

As a fix, mark the attribute with `// @oss-disable` to remove
it during the code export process.

NOTE: If I'm understanding the docs[1] for `@oss-disable` / `@oss-enable` correctly,
this should be the correct way to make this change, which should then
transform into `// @oss-disable FBMemoAgnosticImplicitContext::class`
once this patch is merged and exported. Let me know if this assumption
is incorrect.

[1] https://github.com/facebook/buck2/blob/239ab927a5be7dee3035141d29e2e9c91e8ea771/HACKING.md?plain=1#L168
@mszabo-wikia mszabo-wikia force-pushed the remove-nonpublic-type-from-sealed branch from 0133deb to a0a2c97 Compare August 5, 2025 13:32
@facebook-github-bot
Copy link
Contributor

@mszabo-wikia has updated the pull request. You must reimport the pull request before landing.

@mszabo-wikia
Copy link
Contributor Author

@Wilfred Thanks, makes perfect sense. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants