Hi all,
While building Docker containers, I had an error that turned out to be due to the lack of a $USER environment variable. When makeBaseApp.pl is called, it tries to figure out the username in the GetUser subroutine, using the following command:
$user =
$opt_u ||
$ENV{USER}
|| $ENV{USERNAME}
|| Win32::LoginName();
This command is problematic on Linux machines since it will fail if a username is not supplied via the –u flag and $USER and $USERNAME are not set. This means that the remainder of that subroutine (where the user is queried for their name), will not be
executed.
It seems to me that the Win32::LoginName() call should only be attempted if the host architecture is verified to be a Windows machine, or perhaps it could be wrapped in a try/catch in order to prevent the non-existence of Win32::LoginName from crashing
the code.
Of course, it’s very possible that this issue is caused by something that I am doing wrong….
Thanks,
Steve
|