Skip to content

Use root package by default for Stack #41

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

Merged
merged 1 commit into from
Mar 8, 2019

Conversation

qrilka
Copy link
Contributor

@qrilka qrilka commented Mar 7, 2019

packages is optional in stack.yaml but if I try stack-to-nix on such a project I get a failure:

stack-to-nix: nix/pkgs.nix: openFile: does not exist (No such file or directory)

@angerman
Copy link
Collaborator

angerman commented Mar 8, 2019

@qrilka isn't the source of the error the lack of nix folder? I'd rather we just create the nix folder if it's missing, than move the pkgs file around.

The reasoning is the following: if someone starts adding packages, things would stay in place instead of moving around then and there.

@qrilka
Copy link
Contributor Author

qrilka commented Mar 8, 2019

That missing directory error is just a side-effect of having no packages. We could create it sure but that means that we'll have just default.nix and pkgs.nix as end result - there will be no nix derivation for the root package itself. And that is not correct if the aim is to replicate what you'd have with Stack - stack build works fine for such a project and produces any components that the root package has.

@angerman
Copy link
Collaborator

angerman commented Mar 8, 2019

@qrilka ahh! Sorry I missed that. So what you say is that stack defaults to . as the empty package set if no packages is specified.

LGTM.

@angerman angerman merged commit 982d89a into input-output-hk:master Mar 8, 2019
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