Open WebFreak001 opened 1 year ago
Is this the same as https://github.com/dlang/dub/issues/2651 ?
Note that you need --temp-build
to make Dub not try to write to the package cache. https://github.com/dlang/dub/pull/2652 fixes a remaining occurrence of an attempt to write there even with --temp-build
.
seems to be a related, but different, issue
@WebFreak001 : This is very much on purpose.
The help text for --cache
mentions:
--cache=VALUE Puts any fetched packages in the specified location
[local|system|user].
So I never thought someone would think the build cache would follow the --cache
argument. For Nix build, can you not provide a DUB_HOME
via the env ?
Bug Description
See issue posted on the forum: https://forum.dlang.org/post/xbsyphzxokwtpjmpkxqv@forum.dlang.org
This may be introduced by #2542, although I haven't verified this yet.
The problem here is that $DUB_HOME may not be writable, which is the case here for example on nix. A workaround would be changing the path of it to somewhere writable, but you don't want to do that for every project.
The real fix here would be fixing the build cache to use the local .dub path when building with --cache=local, as well as adding a dub.settings.json entry to be able to default the cache location to always be local on OSes where this is needed.
How to reproduce?
Expected Behavior
Dependencies are fetched into
project/.dub/packages
and build cache is done inproject/.dub/cache
.Actual Behavior
Build cache attempts to write to
$DUB_HOME/cache
Logs