Closed CyberTailor closed 1 year ago
The --local
flag affects the repository cache, not the lib directory where dependencies are checked out.
I figure the documentation for this option should be improved to make that clear.
If you want to have dependencies installed in a custom path, you can set the environment variable SHARDS_INSTALL_PATH
.
However, if you simply want to use dependencies already installed in that path and not do any dependency resolution, there's no point in using shards
at all. It has nothing to do.
After adding that path to CRYSTAL_PATH
you can just run crystal build
directly.
If you want to have dependencies installed in a custom path, you can set the environment variable
SHARDS_INSTALL_PATH
.
Same error.
After adding that path to CRYSTAL_PATH you can just run crystal build directly.
With shards build
I don't have to write targets manually ;-)
Same error.
Yes. --local
tells shards to not update the repository cache. But it needs all dependency repositories to be available in the cache.
When dependencies are missing, it asks to run without --local
to be able to fetch them. Without a populated repository cache, shards cannot work.
Shards' job is to resolve dependencies. Your use case seems to have no need for that, so you should better do without trying to mess with shards to prevent it from its job.
If you want build recipes, I'd recommend to use a build system like make
.
Steps to reproduce
/tmp/crystalpath
/tmp/crystalpath
to the CRYSTAL_PATH environment variableshards --local build
Expected behavior
Actual behavior