Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Cabal helper loader #11

Closed
wants to merge 2 commits into from

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented May 31, 2020

Just for show-casing that integrating c-h is not that difficult.

<> "\n You may need to run stack build."
pkgs <- catMaybes <$> mapM (nestedPkg pwd) (concat cfs)
putStr <$> hieYaml name $ fmtPkgs name pkgs
projM <- findCabalHelperEntryPoint $ pwd </> "Foo.hs"
Copy link
Owner

@Avi-D-coder Avi-D-coder May 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is okay, but should be optional and behind the cabal-helper and command line flag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, it is a show-case, it should also not remove the old behaviour as it is waaaaaaaaayyy faster and should be the default mode. So, adding a cli would be sensible, imo, via optparse-applicative

env <- initialiseEnvironment p
packages <- loadPackages env
pkgs <- toHieYaml env packages
let name = if | isCabalProject proj -> "cabal"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the logic of isCabalProject compare to | any (("dist-newstyle" ==)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is something to worry about for later. In this case, the project is decided based on the found files, e.g. cabal.project, stack.yaml and *.cabal files. In this order, a project type is selected.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point, we should take build directory into account first so the cabal-helper implicit logic marches the default logic and builds with the users preferred tool.

@fendor
Copy link
Collaborator Author

fendor commented Jun 21, 2020

Closed as it seems like we want to go a different way

@fendor fendor closed this Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants