void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

[RFC] build-style/haskell-stack: place stack root in /host to make it persistent

Open tornaria opened this issue 1 year ago • 8 comments

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

tornaria avatar Mar 25 '24 15:03 tornaria

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}".

tornaria avatar Mar 25 '24 17:03 tornaria

I would prefer subdirs within /host/stack for arch-specific stuff

classabbyamp avatar Mar 25 '24 19:03 classabbyamp

unrelated changes seem to have snuck in?

classabbyamp avatar Mar 26 '24 00:03 classabbyamp

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.

tornaria avatar Mar 26 '24 00:03 tornaria

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?

0x5c avatar Mar 26 '24 07:03 0x5c

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).

tornaria avatar Mar 26 '24 18:03 tornaria

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.

github-actions[bot] avatar Jun 25 '24 01:06 github-actions[bot]

ping

tornaria avatar Jun 25 '24 05:06 tornaria

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.

github-actions[bot] avatar Sep 24 '24 01:09 github-actions[bot]