On Saturday, 20 September 2025 01:03:22 CDT Yuxuan Shui wrote:
Question: what's the right thing to do here? Considering hardlinked files indistinguishable for mapping purposes seems reasonable, and I won't be surprised if there are testcases testing specifically this. But adding unixlibs to the mix and things change. Now the path from which a module is accessed becomes significant too, because it will be used to find the .so. In this case the result was the wrong unixlib being used.
I think NixOS is doing the wrong thing here personally. I don't know if I can point to spec language, but if I create two different files with the same content, they are still different files and should by definition have different serial numbers. I don't think it's wrong that Wine depends on this.
On the other hand, I am reminded of an unrelated bug, involving a program (I don't have the name unfortunately) which copies ws2_32.dll to a temp file with a randomly generated name and attempts to load the copy. This fails on Wine because ws2_32 has a unixlib, and we derive the name of the unixlib from the path of the DLL. In order to fix this bug we would probably need to embed the name of the unixlib in the DLL itself rather than relying on its path. If we did that the DLLs for winepulse and winealsa would no longer be identical.