Skip to content

data-files with --prefix is inconsistent between Windows and Linux #3305

Open
@ezyang

Description

@ezyang

I tried reading #462 and #459 but I could not decipher what was going on in the bug discussion. So here is a report of my own. It appears that the behavior of Paths getDataFile when --prefix is passed is inconsistent between Linux and Windows, in the following way:

Suppose I build but do not install an executable dist/build/myexe/myexe, configured using --prefix=/usr to be installed into usr, which attempts to retrieve a data file. When I run this executable on Linux, it will attempt to retrieve the data file from the directory /usr/share/ARCH-linux-ghc-VERSION/packagename-VERSION. However, on Windows, it will attempt to retrieve the data file from the directory dist/build/ARCH-windows-ghc-VERSION\packagename-VERSION.

The Windows behavior is especially puzzling, because I don't believe we ever install libraries at the location we're probing. Looking at the source code, it appears that in the Windows case, --prefix is still triggering some sort of "relocatable" behavior (not --enable-relocatable, which is something different, but the codepath that occurs when reloc and absolute are false) which is causing it to be doing something different. It is very puzzling.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions