Created attachment 147004 [details]
Any port that writes to Environment.SpecialFolder.Personal during build or when running tests may end up with files outside of stage area that aren't cleaned up by the ports framework. The issue lies with Mono looking in /etc/passwd first and only if no entry found there in HOME.
Patch based on discussion in
devel/glib20 provides some background:
* Gets the current user's home directory.
* As with most UNIX tools, this function will return the value of the
* <envar>HOME</envar> environment variable if it is set to an existing
* absolute path name, falling back to the <filename>passwd</filename>
* file in the case that it is unset.
* If the path given in <envar>HOME</envar> is non-absolute, does not
* exist, or is not a directory, the result is undefined.
* Before version 2.36 this function would ignore the
* <envar>HOME</envar> environment variable, taking the value from the
* <filename>passwd</filename> database instead. This was changed to
* increase the compatibility of GLib with other programs (and the XDG
* basedir specification) and to increase testability of programs
* based on GLib (by making it easier to run them from test
* If your program has a strong requirement for either the new or the
* old behaviour (and if you don't wish to increase your GLib
* dependency to ensure that the new behaviour is in effect) then you
* should either directly check the <envar>HOME</envar> environment
* variable yourself or unset it before calling any functions in GLib.
* Returns: the current user's home directory
Ugh, I didn't notice this before committing openra. It's been long since timed out. I have to take it.
A commit references this bug:
Date: Fri Oct 31 13:13:10 UTC 2014
New revision: 371813
lang/mono: allow overriding Environment.SpecialFolder.Personal
Any port that writes to Environment.SpecialFolder.Personal during build
or when running tests may end up with files outside of the stage area that
aren't cleaned up by the ports framework. The issue lies with Mono
looking in /etc/passwd first and only if no entry found there in $HOME.
This PR was an unnoticed prerequisite for the new port games/openra.
Patch based on discussion in https://github.com/mono/mono/pull/371
Submitted by: Jan Beich
Approved by: maintainer timeout (8 weeks)
Thanks. I hope the patch is correct because I don't currently have access to facilities that can quickly build this port. I really would have preferred mono@ review and commit this but 8 weeks is long enough.
I did confirm the patch target completes though.