You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(ConnectionFailure getProtocolByName: does not exist (no such protocol name: tcp))
I have been trying to build a Stack project with a Nix shell but it fails with the above error. There are other issues (#18038, #15168) matching these symptoms, but they are using Docker. It looks like stack is unable to find /etc/protocols from within the shell, but I can't figure out why or how to fix it.
I appreciate I may be doing something entirely wrong with these Nix files, and have mostly been guessing from what I've read about Stack/Nix integration.
Full output for nix-build shell.nix:
derivations will be built:
/nix/store/bym9a09d256q7idj8nw1df87f0m90phw-stack-test-project.drv
/nix/store/04i3r3shlszzl541ynm5k0pbjcr3m5xj-stack-test.drv
building path(s) ‘/nix/store/qkczba1fh57jcsykk6g1ahfjy39mx77i-stack-test-project’
unpacking sources
unpacking source archive /nix/store/ixhfwb2r15rwj0l4c830dbj0rwgraqcm-test
source root is test
patching sources
configuring
Downloading lts-6.21 build plan ...
HttpExceptionRequest Request {
host = "raw.githubusercontent.com"
port = 443
secure = True
requestHeaders = []
path = "/fpco/lts-haskell/master//lts-6.21.yaml"
queryString = ""
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
(ConnectionFailure getProtocolByName: does not exist (no such protocol name: tcp))
builder for ‘/nix/store/bym9a09d256q7idj8nw1df87f0m90phw-stack-test-project.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/04i3r3shlszzl541ynm5k0pbjcr3m5xj-stack-test.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/04i3r3shlszzl541ynm5k0pbjcr3m5xj-stack-test.drv’ failed
shell.nix tries to add a compiled version of the project you're developing into your development environment, i.e. you're compiling the entire project within Nix. Nix builds, however, don't have access to the name server. Thus, your build fails complaining about the absence of /etc/services.
Ah, gotcha. Thanks; what I should be doing, then, is treating the haskell part as a normal Nix package (I've got the output of cabal2nix as a starting point) and building it as usual.
Issue description
(ConnectionFailure getProtocolByName: does not exist (no such protocol name: tcp))
I have been trying to build a Stack project with a Nix shell but it fails with the above error. There are other issues (#18038, #15168) matching these symptoms, but they are using Docker. It looks like stack is unable to find
/etc/protocols
from within the shell, but I can't figure out why or how to fix it.I appreciate I may be doing something entirely wrong with these Nix files, and have mostly been guessing from what I've read about Stack/Nix integration.
Full output for
nix-build shell.nix
:Steps to reproduce
shell.nix
stack.nix
stack.yaml
Technical details
The text was updated successfully, but these errors were encountered: