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

"Cannot determine project root directory for Docker sandbox." error even when Docker support is disabled #4864

Closed
Kleidukos opened this issue Jun 14, 2019 · 11 comments

Comments

@Kleidukos
Copy link

Kleidukos commented Jun 14, 2019

General summary/comments (optional)

Stack produces a docker-related error when trying to create a new project

❯ stack new lol
Cannot determine project root directory for Docker sandbox.

Steps to reproduce

  1. Configure `config.yaml to explicitly disable Docker:
docker:
  enable: false
  1. Run stack new <name>

  2. Weep.

Stack version

❯ Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2

Method of installation

  • stack upgrade from the latest version

How to resolve this

  1. Removing ~/.stack and /usr/local/bin/stack
  2. Reinstall Stack

Does it solve it entirely?

No. It comes back after a while.

@Kleidukos
Copy link
Author

@borsboom Hi! Do you have any idea about what is happening here?

@dbaynard
Copy link
Contributor

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?

@Kleidukos
Copy link
Author

Kleidukos commented Jun 15, 2019

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.

@borsboom
Copy link
Contributor

A couple of questions:

  • Does this happen if you remove the docker section (but keep the nix section)?
  • Alternatively, what happens if you remove the nix section but keep the docker section?
  • And finally, what happens if you remove both?

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.

@Kleidukos
Copy link
Author

Kleidukos commented Jun 16, 2019

Hi @borsboom!

  • When the docker section is removed but the nix section is kept, it still doesn't work 😞;
  • When the nix section is removed, it works 🎉;
  • When both sections are removed, it works 🎉.

@qrilka
Copy link
Contributor

qrilka commented Jun 17, 2019

@Kleidukos but I guess 2nd and 3rd options disable nix integration - are you OK with disabling it?
What OS are you on?

@Kleidukos
Copy link
Author

Kleidukos commented Jun 17, 2019

@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 🤷‍♀️

Edit: I'm running Fedora 30

@qrilka
Copy link
Contributor

qrilka commented Jun 17, 2019

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.

@ttuegel
Copy link
Contributor

ttuegel commented Jun 18, 2019

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.

@qrilka
Copy link
Contributor

qrilka commented Jun 18, 2019

@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

@qrilka
Copy link
Contributor

qrilka commented Jun 19, 2019

@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

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

No branches or pull requests

5 participants