
#377: cabal install puts .hi files in wrong directory ----------------------------+----------------------------------------------- Reporter: cppljevans | Owner: Type: defect | Status: closed Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: invalid Keywords: | Difficulty: normal Ghcversion: 6.8.3 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * status: new => closed * resolution: => invalid Old description:
On my unbuntu OS, cabal install catagory-extras put the files as shown here: <---cut here--- [ 99 of 100] Compiling Control.Morphism.Exo ( src/Control/Morphism/Exo.hs, dist/build/Control/Morphism/Exo.o ) [100 of 100] Compiling Control.Morphism.Meta.Erwig ( src/Control/Morphism/Meta/Erwig.hs, dist/build/Control/Morphism/Meta/Erwig.o ) /usr/bin/ar: creating dist/build/libHScategory-extras-0.53.5.a Installing library in /root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2 Registering category-extras-0.53.5... Reading package info from "dist/installed-pkg-config" ... done. Saving old package config file... done. Writing new package config file... done. <---cut here--- whereas with manual install, they're put as shown here: <---cut here--- [12 of 12] Compiling Data.Generics.UniplateOn ( Data/Generics/UniplateOn.hs, dist/build/Data/Generics/UniplateOn.o ) /usr/bin/ar: creating dist/build/libHSuniplate-1.2.0.1.a /home/evansl/download/haskell/libs/uniplate-1.2.0.1 # runhaskell Setup install Installing library in /usr/local/lib/uniplate-1.2.0.1/ghc-6.8.2 Registering uniplate-1.2.0.1... Reading package info from "dist/installed-pkg-config" ... done. Saving old package config file... done. Writing new package config file... done.
---cut here--- When I compile with ghc, ghc cannot find the /root/.cabal files. If the -i flag is used, the files are found; however, another error occurs: <---cut here--- make ghc -i/root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2 -c catamorphism.example.hs
catamorphism.example.hs:19:0: Bad interface file: /root/.cabal/lib/category- extras-0.53.5/ghc-6.8.2/Control/Functor/Fix.hi Something is amiss; requested module main:Control.Functor.Fix differs from name found in the interface file category- extras-0.53.5:Control.Functor.Fix make: *** [all] Error 1
---cut here---
New description: On my unbuntu OS, cabal install catagory-extras put the files as shown here: {{{ [ 99 of 100] Compiling Control.Morphism.Exo ( src/Control/Morphism/Exo.hs, dist/build/Control/Morphism/Exo.o ) [100 of 100] Compiling Control.Morphism.Meta.Erwig ( src/Control/Morphism/Meta/Erwig.hs, dist/build/Control/Morphism/Meta/Erwig.o ) /usr/bin/ar: creating dist/build/libHScategory-extras-0.53.5.a Installing library in /root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2 Registering category-extras-0.53.5... Reading package info from "dist/installed-pkg-config" ... done. Saving old package config file... done. Writing new package config file... done. }}} whereas with manual install, they're put as shown here: {{{ [12 of 12] Compiling Data.Generics.UniplateOn ( Data/Generics/UniplateOn.hs, dist/build/Data/Generics/UniplateOn.o ) /usr/bin/ar: creating dist/build/libHSuniplate-1.2.0.1.a # runhaskell Setup install Installing library in /usr/local/lib/uniplate-1.2.0.1/ghc-6.8.2 Registering uniplate-1.2.0.1... Reading package info from "dist/installed-pkg-config" ... done. Saving old package config file... done. Writing new package config file... done. }}} When I compile with ghc, ghc cannot find the /root/.cabal files. If the -i flag is used, the files are found; however, another error occurs: {{{ make ghc -i/root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2 -c catamorphism.example.hs catamorphism.example.hs:19:0: Bad interface file: /root/.cabal/lib/category- extras-0.53.5/ghc-6.8.2/Control/Functor/Fix.hi Something is amiss; requested module main:Control.Functor.Fix differs from name found in the interface file category- extras-0.53.5:Control.Functor.Fix make: *** [all] Error 1 }}} Comment: So what you're doing is a per-user install as root. Either run `cabal install catagory-extras` as your ordinary user account or if you really want to do a global install then do: {{{ sudo cabal install catagory-extras --global }}} or {{{ cabal install catagory-extras --global --root-cmd=sudo }}} The latter will do just the install part as root. Perhaps this is suprising and we should try and detect if we are root and if so then do a global install by default. Unfortunately detecting if we are running as root is not simple and not portable (and just because we are uid=0 does not mean we have permissions under modern unix security mechanims and likewise we can have permissions to do global installs without being a root user). -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/377#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects