Skip to content

ghc-boot: Simplify writePackageDb permissions handling

ghc-boot: Simplify writePackageDb permissions handling

Commit ef8a3fbf ("ghc-boot: Fix metadata handling of writeFileAtomic")
introduced a somewhat over-engineered fix for #14017 (closed) by trying to preserve
the current permissions if the target file already exists.

The problem in the issue is simply that the package db cache file should be
world readable but isn't if umask is too restrictive. In fact the previous
fix only handles part of this problem. If the file isn't already there in a
readable configuration it wont make it so which isn't really ideal either.

Rather than all that we now simply always force all the read access bits to
allow access while leaving the owner at the system default as it's just not
our business to mess with it.

  • are either individually buildable or squashed
  • have commit messages which describe what they do (referring to [Notes][notes] and tickets using #NNNN syntax when appropriate)
  • have added source comments describing your change. For larger changes you likely should add a [Note][notes] and cross-reference it from the relevant places.
  • add a testcase to the testsuite.
Edited by Daniel Gröber (dxld)

Merge request reports