thentos icon indicating copy to clipboard operation
thentos copied to clipboard

Make file handling more robust and transparent.

Open fisx opened this issue 9 years ago • 3 comments

There is some code that tries to accomodate various dev and op scenarios and elaborates on the cabal Path.getDataFileName functionality. This code could use some more love, understanding, and probably pruning. An imcomplete list of relevant code locations:

  • git grep getDataFileName
  • git grep getPackageSourceRoot
  • thentos-adhocracy/src/Paths_thentos_adhocracy__.hs
  • thentos-core/src/Paths_thentos_core__.hs
  • thentos-core/src/Thentos/Frontend/TH.hs #448 has improved things a bit.

One problem with the cabal Path_package_name is that it doesn't appear to be available in repl mode, but perhaps there is a better way to address this than introducing our own __-suffixed modules. At very least we should get rid of the bizarre TH hackery (I don't think it's even used anywhere any more).

fisx avatar Jan 13 '16 14:01 fisx

I just tried this in commit 77dfa4b7208bb73d47f02c9783359bb1ef7ab6a8:

    Copy sql schema from thentos-core to thentos-adhocracy.

    We do not want to use cabal data files because they pollute
    the executable with absolute path names, and we want to distribute
    the executables in a tarball to be deployed in any path.

    Therefore, thentos-adhocracy does not have access to
    thentos-core.  A simple solution chosen here is to simply
    not use thentos-dore datafiles from thentos-adhocracy.

    See also: https://www.reddit.com/r/haskell/comments/3kjpwe/how_to_eas

... but then realized that not only is that ugly, but it doesn't solve the problem for thentos-test. Perhaps this is something to discuss over at the cabal repo?

fisx avatar Jan 14 '16 10:01 fisx

(make sure README.md, docs/dev-howtos.md are still up to date when done with this!)

fisx avatar Jan 14 '16 13:01 fisx

(may be obsolete, but i need to check again-)

fisx avatar Jan 25 '16 14:01 fisx