Sunday, 24 February 2013

CMS admin UI now loads

As of commit hash 2ee48f2be9 the CMS admin UI now loads successfully without any errors. Yay!

However, CMS functionality is at present not available. I have been merging in the 4.7.2 code; and on the plus side, up to now, the same fixes have been sufficient to get things working. I will keep up this plan. On the minus side, the 4.7.2 fixes were not intended to be permanent solutions, and should at some point be re-factored.

The automated build scripts work (when you build twice in succession), but are in need of re-writing, but it is not a priority at this point.

There are a number of recurring themes, which will need a closer look - but this is unlikely to happen until after I have completed the version 6 port. Here are some of those recurring themes:


  • '~' in paths: mono does not like these in file system paths. The MultiPlatform IO Helper side steps this issue for now. The mono MVC router appears to be able to deal with '~' in web paths, but that discussion is for another time.

  • In mono, creating an absolute Uri from a path that begins with a '/' will have its Host name set to an empty string - hence the login redirect check will fail. I have not addressed this yet.

  • The Current property of a mono XPathNodeIterator is uninitialised until MoveNext() is called. So accesing this property without calling MoveNext() will always throw an error.

  • The bigger issue of whether to use the same or separately branched code bases for the windows and linux / unix versions remains to be dealt with.

Install Sequence now working

Well, this has turned into a fortnightly update... But the install sequence now works and lets us install to a MySql database. The changes to achieve this were minimal. There were mostly casing changes. Commit hash: 45258f2


There is one other significant change - though this may prove to be temporary, but it is this one:



src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs

From:
if (InstanceTypes.Contains(value))
{
throw new InvalidOperationException("The Type " + value + " already exists in the collection");
};
InstanceTypes.Add(value);

To:
if (!InstanceTypes.Contains(value))
InstanceTypes.Add(value);

This was always throwing an error during boot as one key (which I have forgotten) was being added twice. But it also seems odd to throw an error before it actually occurs. The change gets us moving for now. (But might be worthwhile to look into why this is happening.)


Looking ahead at the changes required for logging in, it looks like the usual suspects are involved: for example, path mapping issues involving the "~" character, xpath issues involving referencing the Current property of an XPathNodeIterator object before calling MoveNext(), and some casing issues.

Sunday, 10 February 2013

XBuild now working with 4.11.3

OK, I got xbuild working now.


However, this is an early version, and you will need to compile twice. This is owing to circular references, which I have not yet sorted out. The easiest way to compile branch 4.11.3 is to use commit #b71c7eb with:



cd build
../tools/mono/ClearLeftOverFiles (if needed)
source ~/mono_dev-env (remember to switch to mono dev environment >= 2.11)
xbuild Build.mono.proj /p:Configuration=Debug

This will create a copy of the web application under the usual location _BuildOutputs/WebApp/. You can then run the web app with:



cd _BuildOutputs/WebApp
source ~/mono_dev-env (remember to switch to mono dev environment >= 2.11)
MONO_OPTIONS="--debug" xsp4

Of course, you will immediately get an error: System.InvalidOperationExceptionThe Type Umbraco.Web.CacheHelperExtensions+CacheHelperApplicationEventListener already exists in the collection. I will deal with this in next week's post. But for anybody who wants to get a head start, here is a neat trick, which I recently learned:



source ~/mono_dev-env (remember to switch to mono dev environment >= 2.11)
# open the umbraco solution in monodevelop
MONO_OPTIONS="--debug" MONODEVELOP_SDB_TEST="true" monodevelop &
# in monodevelop: Run > Run With > Custom Command Mono Soft Debugger > Listen
cd _BuildOutputs/WebApp
MONO_OPTIONS="--debug --debugger-agent=transport=dt_socket,address=127.0.0.1:10000" xsp4

Using the above, you can step through and debug the project code. This is the equivalent of attaching to a process in Visual Studio.


Happy computing...

Saturday, 2 February 2013

Umbraco 6 is out! Mono roadmap

Yes, Umbraco 6 is finally out! I am already planning the mono port - though the challenges here will be of a greater degree as we may run into issues in mono around MVC4 and the support of asynchronous calls. In practical terms, I plan to focus on the 4.11.3 port in the next 3-4 months, while also doing some research on the best way to proceed with U 6. This was just a quick update note, and also to say thank you to the Umbraco team and community for getting 6 ready and running, in a very short time. Happy Umbraco everyone!