[Mono-dev] Compiling on Windows
Greg Najda
gregnajda at gmail.com
Wed Jul 10 03:22:03 UTC 2013
Following up on this, I finally got it figured it. The length of my
checkout directory is too long at 49 chars, which is not really that long.
I did some digging and found that Mono uses GetFileAttributes to check for
the existence of a file in Windows. So I made a test program in C that
takes a path on the command line and calls GetFileAttributes on it.
#include <Windows.h>
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
DWORD res = GetFileAttributes(argv[1]);
if(res != -1)
{
printf("GetFileAttributes: Found.\r\n");
}
else
{
printf("GetFileAttributes: Not found. Error code: %d\r\n",
GetLastError());
}
return 0;
}
I added two files to
external\entityframework\src\EntityFramework.SqlServer\Resources\System\Data\SqlClient:
System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping123.msl
and
System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping1234.msl.
C:\Users\Greg\Documents\Programming\mono_nul_fork\mcs\class\EntityFramework.SqlServer>MonoFileExistsTest.exe
../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping123.msl
GetFileAttributes: Found.
C:\Users\Greg\Documents\Programming\mono_nul_fork\mcs\class\EntityFramework.SqlServer>MonoFileExistsTest.exe
../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping1234.msl
GetFileAttributes: Not found. Error code: 3
../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping1234.msl
is only 174 chars, much lower than MAX_PATH of 260 chars. What gives?
Well, if you put the current directory before the relative path so it
becomes
C:\Users\Greg\Documents\Programming\mono_nul_fork\mcs\class\EntityFramework.SqlServer\../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping1234.msl,
then that is exactly 260 chars. With null terminator, it's 261 and over
MAX_PATH. I guess Windows prepends the current directory before checking
path length.
Interestingly, .NET's File.Exists does not encounter the same problem. If I
run mcs using .NET instead of Mono, the particular compile step that failed
works. I wonder what sorcery it does?
Perhaps add a suggestion to
http://www.mono-project.com/Compiling_Mono_on_Windows to keep the path
length of your checkout directory extremely short.
https://wrench.mono-project.com/Wrench/index.aspx?show_all=true shows the
Windows build as still broken so this was all with the last revision that
Wrench shows to successfully build.
On Thu, Jun 27, 2013 at 10:24 PM, Greg Najda <gregnajda at gmail.com> wrote:
> I'm new to git. I'm using Atlassian SourceTree as a git gui. I'm pretty
> sure it updates submodules after cloning. I ran "git submodule update"
> anyway, which produced no output, and then tried building again and got
> the same error.
>
> After pulling the latest changes I get a new error earlier in the build:
>
> make[3]: *** No rule to make target `mono-sgen', needed by `mono'. Stop.
>
>
> On Wed, Jun 26, 2013 at 11:12 AM, Rodrigo Kumpera <kumpera at gmail.com>wrote:
>
>> Update your git submodules.
>>
>>
>> On Tue, Jun 25, 2013 at 10:05 PM, Greg Najda <gregnajda at gmail.com> wrote:
>>
>>> I'm running into some trouble compiling Mono on Windows. Here are the
>>> steps I followed:
>>>
>>> 1. Do a git clone (using 1b5ef4d3df262c66f58596bda152db5f4c34741c, "Add
>>> a GSHAREDVT_REG_IREG return marshalling convention on ARM.", 2013-06-23)
>>> 2. Install cygwin. Include packages: autoconf, automake, bison,
>>> gcc-core, gcc-g++, libtool, make, python, wget, zip (all from
>>> http://www.mono-project.com/Compiling_Mono_on_Windows), mingw-pthreads
>>> (get an error with mono/utils/atomic.c without it because it #includes
>>> <pthread.h>), gettext, gettext-devel (seem to be missing msgfmt without the
>>> devel package)
>>> 3. Start cygwin
>>> 4. Copy checkout to /home/Greg/mono
>>> 5. Run:
>>>
>>> export PATH="$PATH:/cygdrive/c/Program Files (x86)/Mono-3.0.10/bin"
>>> cd mono
>>> ./autogen.sh --prefix=/usr/local 2>&1 | tee
>>> ~/autogen_output_with_stderror.txt
>>> make V=1 2>&1 | tee ~/make_output_with_stderror_verbose.txt
>>>
>>>
>>> I did see this in the autogen output. Is it anything to be concerned
>>> about?
>>>
>>> checking winternl.h usability... no
>>> checking winternl.h presence... yes
>>> configure: WARNING: winternl.h: present but cannot be compiled
>>> configure: WARNING: winternl.h: check for missing prerequisite
>>> headers?
>>> configure: WARNING: winternl.h: see the Autoconf documentation
>>> configure: WARNING: winternl.h: section "Present But Cannot Be
>>> Compiled"
>>> configure: WARNING: winternl.h: proceeding with the compiler's result
>>> configure: WARNING: ##
>>> ----------------------------------------------------------------------------
>>> ##
>>> configure: WARNING: ## Report this to
>>> http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono ##
>>> configure: WARNING: ##
>>> ----------------------------------------------------------------------------
>>> ##
>>>
>>>
>>>
>>>
>>> Here are the last several lines of output from make:
>>>
>>> make[7]: Entering directory
>>> `/home/Greg/mono/mcs/class/EntityFramework.SqlServer'
>>> make all-local
>>> make[8]: Entering directory
>>> `/home/Greg/mono/mcs/class/EntityFramework.SqlServer'
>>> Converting EntityFramework.SqlServer.dll.sources to
>>> ../../build/deps/net_4_5_EntityFramework.SqlServer.dll.response ...
>>> MONO_PATH="./../../class/lib/net_4_5;$MONO_PATH"
>>> /home/Greg/mono/runtime/mono-wrapper ./../../class/lib/net_4_5/resgen.exe
>>> "../../../external/entityframework/src/EntityFramework.SqlServer/Properties/Resources.SqlServer.resx"
>>> "System.Data.Entity.SqlServer.Properties.Resources.SqlServer.resources"
>>> Read in 44 resources from
>>> 'C:\Users\Greg\Documents\Programs\cygwin\home\Greg\mono\external\entityframework\src\EntityFramework.SqlServer\Properties\Resources.SqlServer.resx'
>>> Writing resource file... Done.
>>> MONO_PATH="./../../class/lib/build;$MONO_PATH"
>>> /home/Greg/mono/runtime/mono-wrapper ./../../class/lib/build/mcs.exe
>>> /codepage:65001 /nologo -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5
>>> -d:NET_4_0 -d:NET_4_5 -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_5
>>> -r:mscorlib.dll /debug+ /debug:full -optimize /noconfig -r:System.dll
>>> -r:System.Xml.dll -r:System.Core.dll -r:EntityFramework.dll
>>> -r:System.Data.dll -keyfile:../ecma.pub -delaysign -warn:1
>>> -resource:System.Data.Entity.SqlServer.Properties.Resources.SqlServer.resources
>>> -resource:../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.ProviderManifest.xml
>>> -resource:../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinition.ssdl
>>> -resource:../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinition_Sql8.ssdl
>>> -resource:../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinitionVersion3.ssdl
>>> -resource:../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinitionVersion3_Sql8.ssdl
>>> -resource:../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping.msl
>>> -resource:../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMappingVersion3.msl
>>> -target:library -out:../../class/lib/net_4_5/EntityFramework.SqlServer.dll
>>> @./../../build/deps/net_4_5_EntityFramework.SqlServer.dll.response
>>> error CS1566: Error reading resource file
>>> `../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinition.ssdl'
>>> error CS1566: Error reading resource file
>>> `../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinition_Sql8.ssdl'
>>> error CS1566: Error reading resource file
>>> `../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinitionVersion3.ssdl'
>>> error CS1566: Error reading resource file
>>> `../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaDefinitionVersion3_Sql8.ssdl'
>>> error CS1566: Error reading resource file
>>> `../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMapping.msl'
>>> error CS1566: Error reading resource file
>>> `../../../external/entityframework/src/EntityFramework.SqlServer/Resources/System/Data/SqlClient/System.Data.Resources.SqlClient.SqlProviderServices.StoreSchemaMappingVersion3.msl'
>>> Compilation failed: 6 error(s), 0 warnings
>>> ../../build/library.make:256: recipe for target
>>> `../../class/lib/net_4_5/EntityFramework.SqlServer.dll' failed
>>> make[8]: *** [../../class/lib/net_4_5/EntityFramework.SqlServer.dll]
>>> Error 1
>>> make[8]: Leaving directory
>>> `/home/Greg/mono/mcs/class/EntityFramework.SqlServer'
>>> ../../build/rules.make:137: recipe for target `do-all' failed
>>> make[7]: *** [do-all] Error 2
>>> make[7]: Leaving directory
>>> `/home/Greg/mono/mcs/class/EntityFramework.SqlServer'
>>> ../build/rules.make:158: recipe for target `all-recursive' failed
>>> make[6]: *** [all-recursive] Error 1
>>> make[6]: Leaving directory `/home/Greg/mono/mcs/class'
>>> build/rules.make:158: recipe for target `all-recursive' failed
>>> make[5]: *** [all-recursive] Error 1
>>> make[5]: Leaving directory `/home/Greg/mono/mcs'
>>> Makefile:99: recipe for target `profile-do--net_4_5--all' failed
>>> make[4]: *** [profile-do--net_4_5--all] Error 2
>>> make[4]: Leaving directory `/home/Greg/mono/mcs'
>>> Makefile:95: recipe for target `profiles-do--all' failed
>>> make[3]: *** [profiles-do--all] Error 2
>>> make[3]: Leaving directory `/home/Greg/mono/mcs'
>>> Makefile:547: recipe for target `all-local' failed
>>> make[2]: *** [all-local] Error 2
>>> make[2]: Leaving directory `/home/Greg/mono/runtime'
>>> Makefile:463: recipe for target `all-recursive' failed
>>> make[1]: *** [all-recursive] Error 1
>>> make[1]: Leaving directory `/home/Greg/mono'
>>> Makefile:390: recipe for target `all' failed
>>> make: *** [all] Error 2
>>>
>>>
>>>
>>> Complete autogen log is at
>>> http://pastie.org/private/mo0bnluwmekwiws4na4zg and complete make log
>>> is at
>>> http://www.animerecs.com/Content/make_output_with_stderror_verbose.txt(too big for a pastebin site so I put it on my own site).
>>>
>>> Any ideas? Also, is there a way to only build the mono runtime and/or a
>>> way to only run the tests for a particular component? I'm primarily
>>> interested in testing a bugfix for
>>> https://bugzilla.xamarin.com/show_bug.cgi?id=12752.
>>>
>>> - Greg
>>>
>>> _______________________________________________
>>> Mono-devel-list mailing list
>>> Mono-devel-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>
>>>
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130709/578236f6/attachment-0001.html>
More information about the Mono-devel-list
mailing list