Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support $STACK_ROOT environment variable #12

Merged
merged 3 commits into from
Aug 26, 2023

Conversation

PRESFIL
Copy link
Contributor

@PRESFIL PRESFIL commented Jan 12, 2023

Add support of $STACK_ROOT environment variable to follow stack's behaviour.
It allows to override the Stack Root location.

Ref: https://docs.haskellstack.org/en/stable/environment_variables/#stack_root

Add support of `$STACK_ROOT` environment variable to follow `stack`'s
behaviour. It allows to override the Stack Root location.

Ref: https://docs.haskellstack.org/en/stable/environment_variables/#stack_root
@PRESFIL
Copy link
Contributor Author

PRESFIL commented Jan 12, 2023

Usecase:

I followed instructions on ArchWiki to improve XDG compatibility of stack's folders
and set ${STACK_ROOT} environment variable:

export STACK_ROOT="$XDG_DATA_HOME"/stack

But stack-clean-old can't find Stack Root location after that.

${STACK_ROOT} introduced by stack a long time ago.

@PRESFIL
Copy link
Contributor Author

PRESFIL commented Jan 12, 2023

Related: #8 and #11 .

@PRESFIL
Copy link
Contributor Author

PRESFIL commented Jan 30, 2023

Review, please.

@juhp
Copy link
Owner

juhp commented May 29, 2023

Thanks, sorry I seemed to completely miss this...
Okay I added some pedantic review comments.

Certainly agree it is good to support STACK_ROOT but it should be presented more as "optional".
I suppose could also merge and then fix it up more to my liking. :)

@hseg
Copy link

hseg commented Aug 23, 2023

Was just bitten by this, am rebuilding with this patch since otherwise this tool is unusable for me (like OP, moved STACK_ROOT=$XDG_DATA_HOME/stack)
(EDIT: mod obvious rebasing (changelog conflicts, edits in commandline options in src/Main.hs need to be accounted for), can confirm patch works)

@hseg
Copy link

hseg commented Aug 23, 2023

Made an AUR package for this, in particular it includes my rebased versions of the PR patches
https://aur.archlinux.org/packages/stack-clean-old-static-git

@juhp
Copy link
Owner

juhp commented Aug 26, 2023

Okay thanks for the feedback - probably should have tried to merge this for the recent release hmm.
I am so used to ~/.stack.

@juhp
Copy link
Owner

juhp commented Aug 26, 2023

Okay I fixed the recent conflicts I had introduced

@juhp
Copy link
Owner

juhp commented Aug 26, 2023

Somehow I was thinking this was only needed for WINDOWS,
that is why I was kinda ignoring it - sorry my bad.

@juhp juhp merged commit 93814e1 into juhp:main Aug 26, 2023
10 checks passed
@juhp
Copy link
Owner

juhp commented Aug 26, 2023

Thanks @PRESFIL - sorry this took so long.

I will probably do some minor tweaks and put out 0.4.8 for this.

@PRESFIL
Copy link
Contributor Author

PRESFIL commented Sep 10, 2023

LGTM! I had some other ideas about stack-clean-old, I would like to recollect
them... I was already going to clean my entire stack cache completely, which
would free up some space 😃.

@PRESFIL PRESFIL deleted the support-STACK_ROOT-env branch September 10, 2023 20:02
@juhp
Copy link
Owner

juhp commented Sep 12, 2023

(Maybe you saw but I did release stack-clean-old-0.4.8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants