How to use Purescript tool chain without internet access

In one specific environment I have no direct internet access.

I was able to install purs and spago, but when I use spago init it takes a long time to create the project skeleton.

What’s a good workflow on a machine without internet access?


I like this question. I’m reminded a few months ago how I couldn’t use nix on my system because Fastly was down.

Not an expert, but…

For rebuilding an existing project, you could build your Spago cache on a machine with access and transfer it to $XDG_CACHE_HOME/spago. You would also need to freeze your Dhall files for dhallfile in *.dhall; do dhall freeze < $dhallfile > /dev/null; done and copy the $XDG_CACHE_HOME/dhall so Dhall can skip the network.

Initializing a new project, I assume they fetch the latest package-set from their Git which makes it impossible. Spago (and Dhall) need access to the network to initialize without any caches. The solution could be copying an existing spago.dhall file from a project that has been build to a new directory and assuming both caches are primed, it should just work.


I’ll leave a quick reply because I don’t have much time. What @toastal writes is correct. For the Exercism project we needed to do something similar so the compiler can run in a sandbox with no network connectivity. Perhaps there is something here that will help you out.


Cool. Thanks a lot.

Looks like I better initialise a project on a machine with Internet access and then transfer it for further development to the sanboxed dev machine.