Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Fix stack.yaml generation in example project
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Jun 21, 2020
1 parent e2ef03b commit 7598b93
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bench/lib/Experiments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,20 @@ setup = do
""
Stack -> do
callCommand $ "stack --silent unpack " <> examplePackage <> " --to " <> examplesPath
-- Generate the stack descriptor to match the one used to build ghcide
stack_yaml <- fromMaybe "stack.yaml" <$> getEnv "STACK_YAML"
resolver <- find ("resolver" `isPrefixOf`) . lines <$> readFile stack_yaml
stack_yaml_lines <- lines <$> readFile stack_yaml
writeFile (path </> stack_yaml)
(unlines [fromMaybe (error "impossible") resolver, "packages: [.]"])
(unlines $
"packages: [.]" :
[ l
| l <- stack_yaml_lines
, any (`isPrefixOf` l)
["resolver"
,"allow-newer"
,"compiler"]
]
)

writeFile
(path </> "hie.yaml")
Expand Down

0 comments on commit 7598b93

Please # to comment.