Bug#1125673: ghc: Please do not ship files under /var
Stéphane Glondu
glondu at debian.org
Mon Apr 20 07:16:07 BST 2026
Le 17/04/2026 à 15:13, Gioele Barabucci a écrit :
>>>> >1105 Haskell packages (all Haskell packages?) install one or more
>>>> >files in /var/lib/ghc/package.conf.d/.
>>>> >
>>>> >Would it be possible to change the way these packages are built, so
>>>> >that they do not ship any files under /var, a directory meant to
>>>> >"[contain] _variable_ data files" (FHS)?
>>>>
>>>> Kari, can you give us some insight about why they were moved to
>>>> /var in the first place?
>>>
>>> From conversations in IRC it seems that it would be easy to move
>>> these files away from /var, but what is missing is to understand
>>> (Chesterton's Fence-like) for which historical reasons these files
>>> are installed there.
>>
>> I guess the same applies to OCaml packages... And (as far as OCaml is
>> concerned), I am partly responsible.
>
> Should I open a new bug for OCaml and add there some OCaml-specific data?
After an exchange with my coauthors (and thinking), /var/lib/dpkg/info
might have been an inspiration for the choice of /var/lib/ocaml in the
first place...
> Or do you (Haskell and OCaml dev) think that is makes more sense to try
> to seek a common solution (location, at least) for both languages?
It may.
/var/lib/ocaml currently contains static data, computed at build time
over build artifacts, that are used to easy the work of dh_ocaml (and
lintian). It is similar in spirit to dune-package files that exist
outside Debian (and are installed in /usr/lib).
What would be the canonical location for that? I'm thinking about
"$(ocamlc -where)/.dh-ocaml" (aka "/usr/lib/$arch/ocaml/.dh-ocaml"), or
spreading each package's data in each package's dir in /usr/lib, e.g.
"$(ocamlc -where)/$pkg/.dh-ocaml". Any opinions?
> Truth be told, the kind of information that OCaml packages store in `/
> var/lib/ocaml/` strikes me as very different from what Haskell/GHC
> packages store in `/var/lib/ghc/package.conf.d/`. But I'm just a
> bystander. :)
I just had a look. Actually, the data in /var/lib/ghc/package.conf.d
makes me think of dune-package files (which are built by upstream
toolchain, but not everyone uses dune).
All in all, in OCaml world, the difference between /usr/lib and /var/lib
is: /usr/lib is built by upstream toolchain, and /var/lib is built by
Debian toolchain. The distinction made sense back at the time, but I'm
no longer convinced now.
Any thoughts?
Cheers,
--
Stéphane
More information about the Pkg-haskell-maintainers
mailing list