Make using local sandboxes easier
passy opened this issue · 4 comments
(I had a brief look through the other open issues mentioning "sandbox", I hope I didn't miss a duplicate of this one.)
I only found out through the Giant Robots blog post that you can actually link the global sandbox config to your local project, e.g. through
ln -sf /app/sandbox/cabal.sandbox.config .
This means that my editor integration now works again as expected and I can use cabal repl
like I'd normally do. Would it be possible to set this up automatically, maybe as part of halcyon build
in a project directory? Or would this interfere with your vision of how halcyon should be used?
Thanks. This is a good question. Indeed, perhaps the sandbox config should be automatically linked into the source directory, and certainly, the possibility of doing so manually should be clearly documented.
Halcyon grew out of the Haskell on Heroku project, which is why it’s focused on workflows enabled by the halcyon install
command. There is much which could be done to improve halcyon build
workflows, especially when working without private storage. I haven’t had the time to give it much thought yet.
I forgot to mention that when installing with HALCYON_KEEP_DEPENDENCIES
set to 1
, a symlink to HALCYON_BASE/sandbox/cabal.sandbox.config
is already automatically created, although as HALCYON_PREFIX/cabal.sandbox.config
.
With the default values for both options, this amounts to:
ln -fs /app/sandbox/cabal.sandbox.config /app/cabal.sandbox.config
This is probably only useful on Heroku, where the home directory, source directory, default working directory, base directory, and prefix directory are all /app
, and should be replaced.
It occurred to me it’s possible to set the (undocumented?) CABAL_SANDBOX_CONFIG
environment variable to point to HALCYON_BASE/sandbox/cabal.sandbox.config
. This avoids the need to mess around with symlinks, and can be done automatically, as part of activating the Halcyon environment.
As part of #46, I’ll replace halcyon paths
with halcyon activate
, which will set CABAL_SANDBOX_CONFIG
.
CC @pbrisbin
Improving the related documentation is now tracked as mietek/halcyon-website#2.