Skip to content

Default for packages option should use cabal.project if it exists #76

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

Closed
srid opened this issue Feb 9, 2023 · 4 comments · Fixed by #110
Closed

Default for packages option should use cabal.project if it exists #76

srid opened this issue Feb 9, 2023 · 4 comments · Fixed by #110
Assignees
Labels
enhancement New feature or request

Comments

@srid
Copy link
Owner

srid commented Feb 9, 2023

... instead of the current */*.cabal (or *.cabal) globbing.

The algorithm would then be roughly: check for cabal.project or stack.yaml or *.cabal in the root and use that to set the packages option; if not present, require the user to set that option (or some helper option that sets it, for instance an option that specifies the location of a cabal.project file).

An error message should also be provided when the user hasn't set this option and their project has multiple-packages (no top-level .cabal) but without a cabal.project.

Originally posted by @roberth in #49 (comment)

@srid
Copy link
Owner Author

srid commented Feb 9, 2023

Regarding cabal.project parser: #49 (comment)

Haskell.nix has one, but I don't know how easily reused it is. Maybe the relevant paths can be found without much effort, I don't know. Dream2nix works with different files it seems. Maybe those contain all the needed info, but I don't think we should require them.

@srid srid added the enhancement New feature or request label Feb 9, 2023
@ParetoOptimalDev
Copy link

I was going make https://github.com/haskell/cabal a Nix flake using haskell-template today to investigate the required effort for fixing haskell/cabal#8434 and ran nix flake init -t github:srid/haskell-flake and got an error.

I think it's because this isn't implemented yet?

If so, maybe https://github.com/haskell/cabal is a good candidate to be the golden test for this feature?

@srid
Copy link
Owner Author

srid commented Feb 10, 2023

Cabal is a big project, maybe something simpler can be used to test this feature. In regards to nixifying https://github.com/haskell/cabal using haskell-flake, @ParetoOptimalDev, I'd suggest you start a post here since I'm sure there will be more to it than cabal.project support; thus general discussion about it in #76 could become somewhat off topic.

@srid
Copy link
Owner Author

srid commented Mar 10, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants