purescript / spago

🍝 PureScript package manager and build tool
BSD 3-Clause "New" or "Revised" License
793 stars 132 forks source link

Error: Remote host not found on `spago build` inside container #196

Closed ericbmerritt closed 5 years ago

ericbmerritt commented 5 years ago

Versions:

Problem:

I am attempting to run spago build installed via npm inside of a container. When I do that on an empty project after running spago init I get the following error. The same command run on the host (mac osx) works fine. Also running curl https://raw.githubusercontent.com/purescript/package-sets/psc-0.12.5-20190427/src/mkPackage.dhall in the host container works just fine. That seems to indicate that the problem lies in how spago is resolving the host.

$> npx spago build
spago: 
↳ ./packages.dhall
  ↳ https://raw.githubusercontent.com/purescript/package-sets/psc-0.12.5-20190427/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57

Error: Remote host not found

      https://raw.githubusercontent.com/purescript/package-sets/psc-0.12.5-20190427/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57

/iogine/packages.dhall:112:7
f-f commented 5 years ago

Hi @ericbmerritt! Would it be possible to share a Dockerfile that replicates the issue?

ericbmerritt commented 5 years ago

Dockerfile and related stuff is located here: https://gitlab.com/metadrift/iogine/tree/feature/migrate-to-purescript/tooling.

You can pull the image directly here: https://gitlab.com/metadrift/iogine/container_registry. The tag is latest

f-f commented 5 years ago

@ericbmerritt I pulled the image (with docker pull registry.gitlab.com/metadrift/iogine/iogine-ci:latest) but it doesn't have npm nor spago installed, in order to be able to replicate I'd need to know how you installed them

Also did you take a look at https://github.com/spacchetti/spago/issues/192?

f-f commented 5 years ago

Update: I built the image off your branch and installed spago with npm install -g --unsafe-perm spago, and I can replicate your issue, looking into it

f-f commented 5 years ago

@ericbmerritt works for me after apt install netbase as per https://github.com/snoyberg/http-client/issues/292

f-f commented 5 years ago

I think this is solved, so I'll go ahead and mark this as a thing to document for the upcoming 0.8

ericbmerritt commented 5 years ago

That solved my problem. Thank you very much.

f-f commented 5 years ago

You're welcome! 🙂

I'll reopen this so we can mark it as fixed once we document it

ericbmerritt commented 5 years ago

199 - may not be in the right form/layout, but hope it helps.