[ModuleInterface] Determine package-only resolution need based on input mode

Instead of requested action. In implicit builds, implicit interface build sub-invocations inherit their parent invocation's requested action, which the code was failing to detect that we were building an interface, not source, and erroneously resulted in enabling in-package module dependency resolution.

Resolves rdar://143505814
This commit is contained in:
Artem Chikin
2025-01-23 14:11:16 -08:00
parent 2e92644b68
commit a00c1ee7e5
2 changed files with 38 additions and 2 deletions

View File

@@ -2306,9 +2306,10 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args,
Opts.ScannerModuleValidation |= Args.hasFlag(OPT_scanner_module_validation,
OPT_no_scanner_module_validation,
CASOpts.EnableCaching);
bool buildingFromInterface =
FrontendOptions::doesActionBuildModuleFromInterface(
FrontendOpts.RequestedAction);
FrontendOpts.InputMode ==
FrontendOptions::ParseInputMode::SwiftModuleInterface;
auto firstInputPath =
FrontendOpts.InputsAndOutputs.hasInputs()
? FrontendOpts.InputsAndOutputs.getFilenameOfFirstInput()