[Hackage] #270: Build executables that can be run "in-place"
#270: Build executables that can be run "in-place" ----------------------------+----------------------------------------------- Reporter: waern | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | ----------------------------+----------------------------------------------- It would be nice if Cabal could build executables that could be told where to get their data files (etc), instead of always hard-wiring them to the installation dirs. Perhaps an environmental variable could be used to specify where the data files are. This would enable us to run applications "in-place", i.e. from the source directory directly, which would be useful for test suites, for example. David -- Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/270> Hackage <http://haskell.org/cabal/> Hackage: Cabal and related projects
#270: Build executables that can be run "in-place" ----------------------------+----------------------------------------------- Reporter: waern | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * difficulty: normal => easy (<4 hours) Comment: Yes, we could have the generated `Paths_<pkgname>` module check an environment variable and if it exists, use that in preference to the normal value. Doesn't sound too hard. It might also be a good opportunity to clean up that code and move it into it's own module. -- Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/270#comment:1> Hackage <http://haskell.org/cabal/> Hackage: Cabal and related projects
#270: Build executables that can be run "in-place" ----------------------------+----------------------------------------------- Reporter: waern | Owner: Type: defect | Status: closed Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: fixed Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * status: new => closed * resolution: => fixed Comment: This is now done. However as the last patch notes it's not all that convenient yet. You'd have to invoke the program like: {{{ $ foo_datadir="." dist/build/foo/foo }}} And if the program looked at its bindir, libdir or libexecdir then those would need to be specified too. Someone could add a feature to cabal /cabal-install to launch the program or or ghci/hugs with the right env vars. {{{ Sun Apr 13 14:41:55 BST 2008 Johan Tibell <johan.tibell@gmail.com> * Made it possible to run executeables with data files in place. Added an environment variable, DATA_DIR, that is checked before the installation data directory is used. Wed May 14 10:42:03 BST 2008 Duncan Coutts <duncan@haskell.org> * Prefix the datadir env var with the package name Partly as it is more likely not to clash with other users and since in general different libs within a program may need different paths. Mon May 19 18:38:08 BST 2008 Duncan Coutts <duncan@haskell.org> * Allow the bindir, libdir and libexec dir to be specified via env vars too Same as for the datadir. Eg for package Foo, you'd use Foo_bindir=... Foo_datadir=... Foo_libexecdir=... ./Foo The next step would be generating a wrapper script that allows running the program inplace. It should also work for a library. }}} -- Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/270#comment:2> Hackage <http://haskell.org/cabal/> Hackage: Cabal and related projects
participants (1)
-
Hackage