[RFC] build-style/haskell-stack: place stack root in /host to make it persistent
Similar to CARGO_HOME=/host/cargo maybe we should set STACK_ROOT=/host/stack.
@leahneukirchen any thoughts?
Testing the changes
- I tested the changes in this PR: briefly
An issue seems to be that stack uses x86_64-linux as arch name for both glibc and musl builds, so the cache gets incorrect binaries when mixing builds.
A workaround could be to use STACK_ROOT="/host/stack-${XBPS_TARGET_MACHINE}".
I would prefer subdirs within /host/stack for arch-specific stuff
unrelated changes seem to have snuck in?
Thanks for the feedback. If you think this is a good idea, I'll be testing it for a bit while I try to finish the update of pandoc.
Disclaimer: I haven't used haskell too much in the last 20 years, I sure don't know anything about cabal, stack, etc.
CARGO_HOME only contains the registry, the crate cache (downloaded source contents only), some configs, and binaries installed with cargo install (not applicable here), so no build artifact gets placed there within a package build.
Is that also the case with stack?
I think STACK_ROOT contains build artifacts. Not for the current package you are building, but only for all the dependencies taken from stackage. IOW, if you build pandoc again, it's source will be recompiled each time, but the dependencies will be built only the first time (for each architecture).
It also seems to contain the registry and downloaded sources, but it's not obvious to me how to share this between architectures while having binaries separate (especially x86_64 vs x86_64-musl which they are both named x86_64-linux for stack, but are not compatible).
This seems to be working ok, but I'll test a bit more. I do have pandoc update working on x86_64 but it's failing on musl (this was fixed before in #36292 but it's not obvious to me how to bring the fix forward).
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
ping
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.