Archive for April, 2014

MSBuild MSB6003 Work Around

Wednesday, April 16th, 2014

One of the QC items not fixed in the XE6 release is 98008, probably because it is still in the Reported state even though it was submitted August 23, 2011. I have previously blogged about the state of QC, so I won’t get into that issue again, suffice to say I hope the QPS initiative continues, and QC incidents get reviewed.

I have been encountering the same error as QC98008 because between DevX, TeeChart, and TMS the search paths for units (stored in OPTSETS) has exceeded the 32,000 character limit primarily because the same paths are used multiple times by MSBuild when constructing the build command.  It was included in the ResourcePath, IncludePath, UnitSearchPath and ObjectPath.  Since no OBJ files were in use, and resources are included in the project files, we simply changed the CodeGear.Delphi.Targets file located in the Delphi Bin folder, setting both the ResourcePath and ObjPath to an empty string (lines 192 & 194) as follows:

ResourcePath=""
IncludePath="$(IncludePath)"
ObjPath=""

This resolved the duplicate path issue that resulted in the exceedance of the 32000 character limit.

XE6 Released with some Interesting Features

Wednesday, April 16th, 2014

I attended the webinar today announcing Delphi XE6. It’s been a long road for the EMBT dev team to provide both C++ and Object Pascal support for iOS, Android, OS X, and Windows in the same environment. Kudos to them for accomplishing that feat, and incorporating over 2000 bug fixes into the XE6 release.  The article lists 500+ fixes for customer reported issues.  I assume the remaining 1500+ items were issues found internally.  Using QC for Windows I found that there are already 17 bug reports for XE6 build 20.0.15596.9843.  Unfortunately I cannot get a listing of all the issues fixed because querying using 20.0 or the full build # in Resolved in Build field yields 0 results.

I am looking forward to installing a trial in a VM, and checking out the latest “Key New Features” - Quality, performance and stability!  It was great to see that the VCL got some love and of special interest to me was the tethering capabilities for mobile devices.  I can’t wait until 64 bit OS X apps and Linux are supported, but the product is definitely heading in the right direction.

Using CodeSite to Spot Peformance Optimization Opportunities

Monday, April 14th, 2014

I have been using CodeSite for a long time now (since v2 days), but I am still continually impressed by the product and it’s capabilities.  If you want to do something with your log data, chances are CodeSite has you covered, you just need to figure out how it is implemented.

Today, I wanted to see if I could filter on the TimeStamp column shown as a TimeDifference in order to only see log entries where the difference between one line and the next was over a second.  I figured this would show me potential opportunities for code optimization.  Initially I thought I would have to write some sort of log mining tool since there didn’t seem to be any capability to filter the log in this manner.  Developers often immediately jump to “I can solve this by writing some code”, but instead I asked my trusted friend Google.

Google showed me some release notes from a few versions back that documented a new feature in 4.62.  I hadn’t used this version so I had no idea the following was possible:

5. The CodeSite Viewers now support Time Difference Navigation. Specifically, a
   new mode has been added to the Message Navigation buttons (First, Previous,
   Next, and Last) to allow navigating to a message where the amount of time
   that has passed since the previously logged message exceeds some threshold.
   This new navigation mode is extremely helpful is locating time gaps in a
   message log.

   To use Time Difference Navigation, simply click on the "Browse for ..."
   drop-down button located between the Previous and Next navigation buttons.
   At the end of the popup menu, a new Time Difference menu item is available.
   Clicking the Time Difference menu item results in a dialog box asking for a
   threshold value (in milliseconds). Clicking OK closes the dialog box and
   puts the Viewer into Time Difference Navigation mode.  You can then use the
   First, Previous, Next, and Last navigation buttons to locate messages where
   the Time Difference of that message exceeds the specified threshold.

   To toggle back into normal Message Navigation mode, simply select the Time
   Difference menu item again from the drop down list of message types. The
   previous Message Navigation settings will be restored.

This is a sweet suite feature….thanks Ray!

How to Avoid Getting Upset with OptSets

Friday, April 4th, 2014

OptSets are a great thing for using consistent settings across multiple projects and machines (such as a build machine). Although they were introduced in D2009, I have found that there are still issues using them in XE4 which I believe are problems in the software and not my wetware.

The first issue is the DPROJ. Settings are present in the DPROJ that when checked in can have adverse effects on the build machine and other developers unless the same setting is present in the OPTSET (such as compiler related ones). This means you have to make sure when editing the OPTSET that the desired changes are in fact being saved, and understand the difference between Applying an OPTSET and adding a Reference to it.

Some of the settings in the DPROJ should be local IMO (the selection of the build config for instance, or run parameters), but they’re not, so I would recommend not checking in the DPROJ unless you have to. At a minimum, you might want to check in one version, and enable VCS-ignore, only updating the DPROJ under version control when absolutely necessary. This can cause issues with GIT when trying to switch branches, so it’s not ideal, but it has the added advantage that Delphi won’t screw up the DPR file when adding units.

If you utilize Search paths in the OPTSET files, you don’t have to add more than the core application classes to your Delphi project. Error Insight will produce more false positives, but in my experience most developers ignore it anyway or disable it. Other side effects might include the IDE refactoring support, but I find that most refactorings don’t work reliably enough, or across units so I rely on manual refactoring as recommended by Michael Feathers from Object Mentor.

OPTSET files are a subset of MSBuild XML including BuildEvents. Unfortunately, these just don’t work as indicated here.  It’s only been 3 releases, so give it time!

For the most part, OPTSET files work, but beware, editing them in the IDE can produce results other than what you might expect. This may be PEBKAC, but for that reason I use NotePad++, or another external editor, but beware that you will have to close and re-start the IDE for any changes to take effect. Likewise, if you switch between GIT branches with other versions of the OPTSET files, you should re-start the IDE to be sure the correct settings are in use.

It would be nice to have OPTSETS that work as you would expect 100% of the time, but the existing implementation is usable if you understand the limits, and while I am sure this article doesn’t cover all of them, I hope it alleviates some grief.

Vote for Me!

Friday, April 4th, 2014

Actually I am not running for an office of any kind.  I would actually appreciate some votes for my QC items (if that truly counts for anything in terms of prioritization).  Specifically, I would like to see QC # 123768 and 93267 fixed, but feel free to search through all my reports and vote for them ;-)

Out of Memory - Solved!

Wednesday, April 2nd, 2014

I recently read EMBT’s Delphi RoadMap and was very happy so see that QPS (Quality, Performance, Stability) is item #2 on the Delphi 2014 list.  I certainly hope that these items appear in order of priority.  One of the primary issues I keep hitting is the Out of Memory error, although far less frequently thanks to Andreas’ workaround.  If you can’t see the QC report in your web browser, perhaps like me, you are not authorized to see it on the web.  I can view it fine in the QC Windows Client:

Out of Memory Error - solved internally

Out of Memory Error - solved internally

I am happy to see that this bug has finally been fixed according to the QC # and many other duplicate ones.  It appears to have been fixed as early as January 30, 2014 according to the Closed status replicated from the internal bug tracking system.  For those SA purchasers suffering from this problem, it kind of makes you wonder why this hasn’t been shipped as an update.

I was just going through my QC reports since I wanted to see if the QPS initiative had resulted in some of my long standing reports being addressed.  Sadly I don’t see any movement in that direction yet as a great number of my QC items are still in the Reported state with no comments of any kind.  Perhaps the QPS initiative will mean that QC will no longer be administered by “volunteers”, or perhaps they will recruit additional volunteers to help with the backlog.  I know I would happily volunteer to screen QC reports if it meant helping the product get better and I received a free license for my efforts…