Windows & Source Control (May 18)

So far, our staff has only worked on the Mac version for our new Qt-based accounting software. It’s time to start building it for Windows, too.

The first step was to move the latest code from source control to a Windows machine. Source control is the backup system we use these days. It saves changes, and shows the entire project history in case there’s need to revert.

Our staff has been using two tools from Atlassian: SourceTree is a desktop app that saves on the local drive, and BitBucket is a website that saves in the cloud. We push (update from here to there) a few times a day, and pull (there to here) to update machines with the latest.

The pull to Windows used to work fine, but this time it gave error messages. Online, there were many reports from other users having the same problem. The cause: Atlassian changed the way it handles passwords a few weeks ago. The update was smooth for Mac, but very rocky on Windows.

Atlassian had a long list of possible fixes. Forum users also gave suggestions. We tried them all several times, trying to find the magic combination. After 3 days of frustration, it still did not work.

Atlassian also had a big outage last month for their other cloud services. It took them two weeks to fix it. Uh-oh. We decided to switch to GitHub and GitHub Desktop for source control. Those are working OK. Their workflow and interface are different, but we will get used to it.

All of these source control tools are wrappers for git, a Unix applet that first appeared in 2005. Pure git is cranky and confusing from the command line, but the GUI apps and websites make it friendlier. Not super friendly, but enough to get by.

Before source control we saved zip files, and put dates in the comments to help locate the right files. We still do that, but it’s less vital now.

As for the Windows version, the next step was to install Qt and start building the app. As expected, there were snags. Downloading the latest Qt libraries just gave a bad link error. Fortunately, we already have an earlier version of Qt on an older machine. It won’t build 64-bit, but the 32-bit app was a success. It’s enough to start testing.

The app didn’t run at first: another source control problem. Github automatically switches text line endings from Mac format (LF) to Windows (CR/LF). It screwed up our text resources. Once that was fixed, TurtleSoft Pro ran OK on Windows. After some tweaking, it even looks good.

Getting the Win version purring in less than a week is faster than expected. It could easily have taken longer. From here on out we can test for Mac & Windows in parallel. It’s also good to use two different compilers: Windows Qt caught a few errors that the Mac version missed.

Incidentally, that line feed thing comes from manual typewriters. They have a lever to slide the platen (CR carriage return) and also move down a line (LF line feed). With a careful push on an old manual, you can do just one or the other.

The original Macintosh used CR for line ends. Unix and newer Macs use LF. Windows uses CR plus LF. Line endings are just one of many irksome problems that programmers face, when writing software for more than one operating system.

Dennis Kolva
Programming Director
TurtleSoft.com

Author: Dennis Kolva

Programming Director for Turtle Creek Software. Design & planning of accounting and estimating software.