-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed as not planned
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)area-BzlmodBzlmod-specific PRs, issues, and feature requestsBzlmod-specific PRs, issues, and feature requestsstaleIssues or PRs that are stale (no activity for 30 days)Issues or PRs that are stale (no activity for 30 days)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.External dependency handling, remote repositiories, WORKSPACE file.type: bug
Description
Almost all of the skyfunctions defined for bzlmod support have no exception handling, which means that when an exception does occur, Skyframe drops it and bazel crashes in an inconsistent state.
Issue #18567 is an example of this.
I've done a brief survey of the existing skyfunctions under src/main/java/com/google/devtools/build/lib/bazel/bzlmod/
- BazelDepGraphFunction
- key: BazelDepGraphValue.KEY -> singleton instance
- calls:
- BazelLockFileValue.KEY
- no exceptions handled
- BazelModuleResolutionValue.KEY
- no exceptions handled
- ModuleFileValue.key
- no exceptions handled
- ClientEnvironmentFunction.key
- no exceptions handled
- BazelLockFileValue.KEY
- throws:
- BazelDepGraphFunctionException
- ExternalDepsException
- BazelDepGraphFunctionException
- BazelLockFileFunction
- key: BazelLockFileValue.KEY -> singleton instance
- calls:
- FileValue.key
- no exceptions handled
- FileValue.key
- throws:
- BazelLockfileFunctionException
- ExternalDepsException
- BazelLockfileFunctionException
- BazelModuleInspectorFunction
- key: BazelModuleInspectorValue.KEY -> singleton instance
- calls:
- ModuleFileValue.KEY_FOR_ROOT_MODULE
- BazelModuleResolutionValue.KEY
- throws:
- nothing
- BazelModuleResolutionFunction
- key: BazelModuleResolutionValue.KEY -> singleton instance
- calls:
- ClientEnvironmentFunction.key
- no exceptions handled
- ModuleFileValue.KEY_FOR_ROOT_MODULE
- no exceptions handled
- ClientEnvironmentFunction.key
- throws:
- BazelModuleResolutionFunctionException
- ExternalDepsException
- BazelModuleResolutionFunctionException
- ModuleFileFunction
- key: ModuleFileValue.Key -> moduleKey, override
- calls:
- FileValue.key (twice)
- no exceptions handled
- RepositoryDirectoryValue.key
- no exceptions handled
- FileValue.key (twice)
- throws:
- ModuleFileFunctionException
- ExternalDepsException
- ModuleFileFunctionException
- SingleExtensionEvalFunction
- key: ModuleExtensionId -> bzlFileLabel, extensionName
- calls:
- SingleExtensionUsagesValue.key
- no exceptions handled
- BzlLoadValue.keyForBzlmod
- handles BzlLoadFailedException
- SingleExtensionUsagesValue.key
- throws:
- SingleExtensionEvalFunctionException
- ExternalDepsException
- IOException
- SingleExtensionEvalFunctionException
- SingleExtensionUsagesFunction
- key: ModuleExtensionId
- calls:
- BazelDepGraphValue.KEY
- throws:
- nothing
Every SkyKey can potentially throw the exceptions listed under its Skyfunction (for example, requesting BazelDepGraphValue.KEY can potentially raise ExternalDepsException.
Therefore, each of these functions needs to have existing env.getValue calls converted to env.getValueOrException calls, and then the exception needs to be handled properly, generally by re-throwing it.
fmeum
Metadata
Metadata
Assignees
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)area-BzlmodBzlmod-specific PRs, issues, and feature requestsBzlmod-specific PRs, issues, and feature requestsstaleIssues or PRs that are stale (no activity for 30 days)Issues or PRs that are stale (no activity for 30 days)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.External dependency handling, remote repositiories, WORKSPACE file.type: bug