[Coco] Init v3.3.0 contains incorrect version number for build

Greg Law glaw at live.com
Fri May 30 11:14:03 EDT 2014


Tormod Volden wrote:

> Hi Kip,
>
> The build system uses soft links in many places, maybe this is broken
> in your build environment. Thanks for mentioning that you are using
> Cygwin, do you have more details on this and the rest of your build
> environment?
>
> My question to all the Cygwin users out there, was this always broken
> for you? The build system uses "ln -s" (see rules.mak) to create soft
> links.
>
> Are many people using Cygwin? Is there any advantage over using MinGW?
> I know that using MinGW on Windows (7 64-bit is what I have tested on)
> is super slow, more than 10 times slower than building on Linux on the
> same hardware. So if Cygwin is faster I can understand you are using
> it instead!
>
> Regards,
> Tormod

Essentially MinGW is the bare minimum environment necessary to build *nix 
applications on Windows. The advantage is that applications built with MinGW 
runs natively in Windows. The disadvantage is that MinGW does not provide a 
complete emulation or compatibility layer, so some code may require 
significant changes to build and run on Windows and it's slow as molasses in 
an ice storm.

Cygwin provides a relatively complete *nix emulation and compatibility 
layer. The advantage is that it can build and run significantly more *nix 
code either with no or very few changes and it's fast. The disadvantage is 
that applications built with Cygwin require Cygwin (or at least the base 
Cygwin DLLs) to run on Windows.

Now to the issue at hand...

This actually makes sense because by default Cygwin creates symbolic links 
with a system file and the contents of the file point to the original file 
(somewhat similar to Shell links). The contents of the symbolic link file 
(/home/Greg/nitros9/level2/sys/errmsg/ is something like this:

!<symlink>/home/Greg/nitros9/level1/sys/errmsg

The disadvantage is that symbolic links aren't really supported in Cygwin to 
the level required to NitrOS-9 because Cygwin treats them more or less as 
plain files with caveats. This means copying a symbolic link results in 
copying the !<symlink>/... contents, but listing a symbolic link (cat 
errmsg) results in a file not found error.

The solution to this problem on Windows Vista/7/8 using NTFS is to create an 
environment variable that tells Cygwin to create native NTFS symbolic links 
instead of shortcut files:

export CYGWIN=winsymlinks:native
or
export CYGWIN=winsymlinks:nativestrict

The difference is that winsymlinks:native always creates the symbolic link 
(even if the source file does not exist) whereas winsymlinks:nativestrict 
returns an error if the source file does not exist.

Unfortunately, Windows requires administrative privilege by default to 
create symbolic links so setting this environment variable will likely cause 
ln to fail right out of the box. The easy solution is to always run Cygwin 
with elevated privileges:

Right click the Cygwin Terminal shortcut, click Properties, click the 
Compatibility tab, check "Run this program as an administrator", and click 
OK. I don't particularly like this solution, but it's more or less easy 
peasy.

The more difficult solution is to run gpedit.msc (Control Panel > 
Administrative Tools > Local Security Policy) if it is available on your 
version of Windows. If the Local Group Policy Editor opens, browse to:

Local Computer Policy > Computer Configuration > Windows Settings > Security 
Settings > Local Policies > User Rights Assignment

Double click "Create symbolic links" in the right pane to open the "Create 
symbolic links Properties" dialog and click "Add User or Group" to open the 
"Select Users or Groups" dialog. Enter your username in the textbox then 
click Check Names to make you've entered it correctly. If everything is 
good, click OK to close "Select Users or Groups" then click OK to close 
"Create symbolic links Properties".

Now you need to logoff and logon again to apply the new policy. After you 
logon to refresh the security policies, run Cygwin Terminal as a regular 
user, make sure the CYGWIN environment variable is set appropriately, delete 
the errmsg and password files in level2/sys, then make dsk. If all goes 
well, errmsg and password should look like real files with real text.



More information about the Coco mailing list