Stack produces a docker-related error when trying to create a new project
โฏ stack new lol
Cannot determine project root directory for Docker sandbox.
docker:
enable: false
Run stack new <name>
Weep.
โฏ Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2
stack upgrade from the latest versionNo. It comes back after a while.
@borsboom Hi! Do you have any idea about what is happening here?
Hello, thanks for reporting. Would you share some project information (e.g. stack.yaml, package.yaml/cabal files)? Also, precisely which config.yaml do you mean?
Hi @dbaynard!
The config.yaml I was talking about was ~/.stack/config.yaml.
stack.yaml
nix:
enable: true
pure: false
packages: [glpk, pcre, curl, zlib]
docker:
enable: false
I am unable to give you the content of any package.yaml / cabal, because they cannot be generated due to the aforementioned error.
I am indeed running this command (but any other, actually) from my home directory.
A couple of questions:
docker section (but keep the nix section)?nix section but keep the docker section?I suspect the mention of Docker in the error message is a red herring, because the Nix code was initially based on the Docker code and it looks like it re-uses this error message.
Hi @borsboom!
docker section is removed but the nix section is kept, it still doesn't work :disappointed:;nix section is removed, it works :tada:;@Kleidukos but I guess 2nd and 3rd options disable nix integration - are you OK with disabling it?
What OS are you on?
@qrilka I enabled it at the project level, and it works :/ I don't understand why it would fail at the global level and not at the project level, but it seems to be working :woman_shrugging:
Edit: I'm running Fedora 30
That sounds like some odd bug to me :)
Some moths ago it was decided that there is no sense to use nix and docker modes of Stack simultaneously - probably we've added some improper config handling with that change. I hope to have time check it out later in the day.
I guess 2nd and 3rd options disable nix integration - are you OK with disabling it?
For what it's worth, NixOS users can't use Stack and disable Nix integration, so this effectively makes certain commands unusable there.
@ttuegel that's not quite correct: nix mode is the default but it's not 100% required but you need to supply GHC by some other way (Nix seems to be the most obvious choice in this case) as an example see https://gist.github.com/qrilka/2b21576e541412656bde0c4ca6c2064e
@Kleidukos there was a Stack bug in stack.yaml being required for any commands in Nix mode which resulted in that misleading error message about Docker, #4885 fixed that
Most helpful comment
That sounds like some odd bug to me :)
Some moths ago it was decided that there is no sense to use nix and docker modes of Stack simultaneously - probably we've added some improper config handling with that change. I hope to have time check it out later in the day.