From 120fe42e57167ada53e5f46ac9eed3b3e75b9010 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Tue, 17 Dec 2024 08:29:58 -0500 Subject: [PATCH] Use normalized path when recursing --- .../src/Distribution/Client/ProjectConfig/Legacy.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs b/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs index a95e75ed32a..5ac40174a82 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs @@ -275,11 +275,8 @@ parseProjectSkeleton cacheDir httpTransport verbosity projectDir source (Project go :: [ParseUtils.Field] -> [ParseUtils.Field] -> IO (ProjectParseResult ProjectConfigSkeleton) go acc (x : xs) = case x of (ParseUtils.F _ "import" importLoc) -> do - let importLocPath = importLoc `consProjectConfigPath` source - -- Once we canonicalize the import path, we can check for cyclical imports - normLocPath <- canonicalizeConfigPath projectDir importLocPath - + normLocPath <- canonicalizeConfigPath projectDir $ importLoc `consProjectConfigPath` source debug verbosity $ "\nimport path, normalized\n=======================\n" ++ render (docProjectConfigPath normLocPath) if isCyclicConfigPath normLocPath @@ -287,7 +284,7 @@ parseProjectSkeleton cacheDir httpTransport verbosity projectDir source (Project else do normSource <- canonicalizeConfigPath projectDir source let fs = (\z -> CondNode z [normLocPath] mempty) <$> fieldsToConfig normSource (reverse acc) - res <- parseProjectSkeleton cacheDir httpTransport verbosity projectDir importLocPath . ProjectConfigToParse =<< fetchImportConfig normLocPath + res <- parseProjectSkeleton cacheDir httpTransport verbosity projectDir normLocPath . ProjectConfigToParse =<< fetchImportConfig normLocPath rest <- go [] xs pure . fmap mconcat . sequence $ [projectParse Nothing normSource fs, res, rest] (ParseUtils.Section l "if" p xs') -> do