haskell / directory

Platform-independent library for basic file system operations
https://hackage.haskell.org/package/directory
Other
58 stars 47 forks source link

haiku: introduce platform directory layout. #156

Closed jessicah closed 1 year ago

jessicah commented 1 year ago

Haiku's directory layout is unique compared to other POSIX systems, and also stores app data in a settings folder without leading dots.

Additionally, hard linking is replaced with symlinks, as hard links are not supported on Haiku's primary file system, BFS.

jessicah commented 1 year ago

I did try creating a Haiku.hsc file and trying to import and re-export symbols from Posix.hsc, but I couldn't figure that out, and not entirely sure it was worth the effort to do so?

Rufflewind commented 1 year ago

Thank you for the Pull Request and I appreciate the effort that went into this!

Unfortunately, there is a significant maintenance cost in having logic targeted to specific platforms. Since Haiku is not currently a widely used platform, it is unlikely that Haiku-specific logic will be accepted into the directory codebase. If the circumstances change in the future, the decision may be revisited.

Here are some potential alternatives for consideration:

  1. If downstream software is attempting to hard link but fails on BFS, then the ideal solution is to redesign that software to avoid hard links when the file system does not support it. This improves the situation not just for BFS on Haiku but also other unusual file systems without hard link support.

  2. The situation with XDG directories could be worked around by following the override processes described in the XDG specification. The user could set their XDG_* environment variables to Haiku-compliant paths.

Thanks again for your contribution and I wish you the best of luck in finding a solution.

Bodigrim commented 1 year ago

@jessicah From my perspective the problem is that maintainers of core packages have zero ways to verify Haiku patches or ensure that they do not bitrot tomorrow. In such case there is limited utility to accept them in the first place.

Is it possible to setup a Haiku CI job somehow?