Open HinTak opened 8 years ago
FWIW, mono 4.4.2.11 is the latest, BTW.
It's possible that this has something to do with using a backslash for the directory path. As far as I'm aware xbuild should handle this just fine, but MSBuild should also be fine with forward slashes. I'll clean things up and change the backslash to a forward slash and see if that changes anything.
I was mistaken, as it turns out MSBuild doesn't like forward slashes in relative paths. I'll spin up a VM at some point to test this on xbuild.
I am now pretty sure it is a mono bug. I have managed to find two ways where the file will be copied as is without the name change.
mis-spell it - if I change the name to ShrpFont.dll.config
and adjust the project file to match, then the filename will be copied as is.
put is in a sub-directory. and also adjust the project file to match - i.e. use ..\axil\SharpFont.dll.config
instead of just ..\SharpFont.dll.config
.
So it looks like somehow mono is confused by ..\SharpFont.dll.config
the first part of which is the same as either the project file or the directory name.
I'd propose to put it inside a extra
directory or axil
directory as I did it. I am already using fairly current mono (4.8.0.495 Cycle 9 Stable Release - latest as of two months ago) ; while fixing it in mono would be nice, for years to come people will be using 4.4 or even 2.x
At the moment I don't know which part of mono it would be under, but I'd likely file a bug at Xamarin at some point. I think what happened is that, the full original path is constructed and some substitution is done to convert the original path to destination path, and it is confused by the "SharpFont" part.
it seems to be treating ..\SharpFont.dll.config
as ..\SharpFont\.dll.config
in terms of calculating the destination.
win32(?) Python under wine has an interesting issue which looks a lot like this one - https://bugs.winehq.org/show_bug.cgi?id=47766
This may be a mono bug with xbuild. I just tried upgrading to v4.0.1, and found that "SharpFont.dll.config" is being copied to ".dll.config" instead of "SharpFont.dll.config" in the destination.
The problem seems to be brought on by the refactoring/re-org in https://github.com/Robmaister/SharpFont/pull/80 . The only difference is that the "SharpFont.dll.config" source is in the directory above the csproj file, instead of in the same directory. If I edit the csproj file to copy from the same directory, as well as making a duplicate of the source "SharpFont.dll.config" into the same directory as the csproj, then the file is copied without stripping off SharpFont part.
So it looks like putting "..\" before "SharpFont.dll.config" causes it to be copied to ".dll.config". i.e. "..\SharpFont" got removed. This sounds like some sort of bug somewhere which causes "..\SharpFont" to be removed from file paths, somewhat zealously.
Any ideas?