# Cabal get build directory or redirect -hidir output

**URL:** <https://discourse.haskell.org/t/cabal-get-build-directory-or-redirect-hidir-output/8737>\
**Category:** Uncategorized\
**Created:** [February 6, 2024, 7:28am UTC](https://discourse.haskell.org/t/cabal-get-build-directory-or-redirect-hidir-output/8737 "2024-02-06T07:28:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![suzzr0](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/suzzr0/32/3226_2.png) [@suzzr0](https://discourse.haskell.org/u/suzzr0)\
**Post date:** [February 6, 2024, 7:28am UTC](https://discourse.haskell.org/t/cabal-get-build-directory-or-redirect-hidir-output/8737/1 "2024-02-06T07:28:07Z")

</div>

I’m interested in having an automated way of getting cabal’s interface files (either a copy/symlink to them or redirecting the output). Unfortunately the closest thing to getting a directory is `cabal list-bin` which seems fragile for this (would require some string manipulation/isn’t guaranteed).

I would prefer against setting `-hidir` if possible as some programs (cabal/ghc-pkg) assume that the location is not changed (though I do have workarounds for this case). Notably setting `-hidir` causes build failures with cabal unless you do a build without the flag first. If anyone knows how to resolve that easily it would be helpful as well.

If anyone has any ideas here on how to do this I would greatly appreciate it.
