Looking for instruction, advice, and/or (ideally free) resources for learning how to efficiently and reliably implement source repositories and version and maintain backups of build histories using Microchip X IDE, and XC series of compilers.
<...> Especially since we're using Microchip Harmony framework, which through forced updates of the configurator has broken my software more than once by overwriting modifications and bug-fixes I had made. <...>
Any useful resources (from primary sources) can be found by mature professional himself by keywords. Some keywords are below.
I see three parts of question.
1) selection of versioning system
2) organization of system environment: server, maintenance, ...
3) repository layout specific to Harmony framework
SELECTION OF VERSIONING SYSTEMThere are two camps: centralized and distributed VCS. Both of them require a beginner to become familiar with new concepts, terms, use-case scenarios, etc. Part of required new knowledge is common for both approaches. Bigger part is somehow different. So knowing only one is not enough to use another without additional study.
I use both but have much more experience with centralized version control systems. Bear it in mind taking my advices. And I do not consider myself as expert in VCS, just experienced user. I used Source Safe, TFS, Subversion, Git. Svn and Git are currently in use.
I use Git for episodic unrelated projects where I am the sole developer. Advantage - I just "git here" on project folder tree and do not bother about repository location, access, etc.
The task that I do not want to solve regarding DVCS is how to arrange hierarchy of repositories and how to maintain it by team. I believe that with DVCS users must maintain arrangement themselves with almost no help from DVCS. This is the part of lack in my experience. In other words I use DVCS in very very limited way.
There are some other unresolved questions that I leave about DVCS, since ...
... For the major part of my work I use Subversion. The truth is - a consolidated work of team is centralized naturally at least by final product. So I appreciate that most part of this centralization is supported by VCS.
VERSION CONTROL SYSTEM ENVIRONMENTThere are several ways to use Subversion that differ by access to repository.
The most easy way to start is to use just client without server executables using file:// access. Badly suited for team work. Do not waste your time trying it. Believe - it works, but not enough.
Instead decide will you use your working PC as a server for your team or better setup separate server. There are some choices: to use third party installers that will do most of configuration or to configure server manually. "installers" usually setup Apache server. For manual configuration I suggest simple svnserve server.
Beginner friendly "installers" are VisualSVN, Collabnet Subversion Edge (and others). First time I used CollabNet built executables (svnserve), then Edge. After occasional fail of Edge on subsequent update (due to java incompatibility issue) I step from CollabNet to VisualSVN. It looked slightly easier for novices.
Currently I use intermediate and flexible solution. I run Debian minimal server on VirtualBox virtual machine running (currently) on my working PC.
Virtual PC allows me to easily relocate server between different PCs (that happened couple of times in case of upgrade). Server has its name and dynamic IP (obtained from our router). DNS on the router is configured to resolve this name for all LAN users. Also full server backup is trivial in case of virual PC.
Running server on the same working PC reduces maintenance efforts for small team. Also backup is easier and faster if backup media is connected to the same PC.
Use of Linux was more foolpfoof for me to setup Trac and its proper integration with Subversion forth and back (comparing my efforts doing the same on Windows).
I use Subversion and Trac from stable Debian packages.
BACKUPFrom working PC I run servername_backup.bat script that uses plink.exe to run backup script on server (as custom "backup" user).
This script on server do following:
a) run "svnadmin hotcopy" for all SVN repositories and "trac-admin hotcopy" for Trac.
b) archives hot copied repositories with other key setting of server (init.d/svnserve, init.d/tracd, passwd, group, ${0##*/},...) to lrzip archive "server_date_time.tar.lrz".
Then servername_backup.bat uses pscp.exe to copy lrz file from server to locally connected media - on local hard disk and on one of removable Compact Flash cards in rotation.
REPOSITORY LAYOUT FOR HARMONY BASED PROJECTSI am trying to be king and polite talking about difficulties in handling of Microchip Harmony projects. There are plenty of them.
Key specifics related to version control are:
1) This is mainly raw product. You should consider corrections made by yourself to this framework.
2) Parts of framework rely on relative paths to locate each other.
3) Harmony framework is supposed to be extensible. For example if you like to add new BSP configuration it is supposed to be located in framework's official folder for BSPs
4) Harmony is not a mature product. Interfaces even of comparatively "production ready" modules sometimes changes with new version.
5) Harmony framework is supplied in plain zip format without information of relation between files in current version and between versions. Maybe this is the case where Git is more able than Subversion. Any opinions are welcome!
6) New versions of MPLAB Harmony Configurator may require new MPLABX and vise versa, and it is a possible issue that it could work only with new Harmony revisions. So opening old project may require to install old MPLABX in addition to old framework.
7) There are no official recommendations from Microchip about repository layout for Harmony based projects.
My current solution is the following. I will appreciate any comments about it.
Variant A:/repository
/branches
/microchip
/harmony /*here are exact copies of distributives*/
/v1_02
/apps
/bin
...
...
/v1_07_01
/apps
/bin /*candidate not to store in repository to lessen its size*/
/bsp
/build
/config
/framework
/third_party
/utilities
/tags
/trunk
/harmony /*made your corrections to Harmony here*/
/apps /*all demo projects are here*/
/bin
/bsp
/build
/config
/framework
/third_party
/utilities
/work /*I prefer to locate my projects separately from official apps*/
/my_project_A
/my_project_B
/firmware
/my_project_B.X
/src
/system_config
/software_for_pc_that_may_share_the_same_sources_with_firmware
Then your working folder is supposed to be check out of /trunk/harmony
In case of update of Harmony I do following actions:
1) Checkout previous version /microchip/harmony/v1_x
2) Make modifications to working copy of v1_x that it becomes identical with new version. This is awkward because changing of files locations and its presence is not handled automatically. Maybe Git is more suited for this task.
3) Branch modifications to new /microchip/harmony/v1_y
then I see two ways:
I:
4) Merge modifications of just made commit (/microchip/harmony/v1_y) to /trunk/harmony
5) Consequently migrate ALL /work/my_projects to be fine with new harmony
II: (That is the correct scalable variant for team.)
4) copy trunk/harmony to trunk/harmony_Y
5) work with your current project (trunk/harmony_Y/work/my_project_A) leaving others intact.
Variant B: /trunk
/harmony /* version_X */
...
/work
/my_project_A
/my_project_B /*other team members can continue theirs work here*/
/harmony_version_Y
...
/work
/my_project_A /*current project under migration process*/
/my_project_B
The following variant could be an alternative that i did not test:
Variant C: /trunk
/harmony_version_X
/harmony_version_Y
...
/work
/my_project_A /*current project under migration process*/
/my_project_B /*other team members can continue theirs work here*/
In this case your working copy for each project is check out of /trunk that will contain multiple Harmony versions. Another drawback - all relative paths in project configurations must be updated and I know only manual way.
I see another extreme - each project contain its own copy or Harmony.
I am going to try this variant next time when I find that a modification to layout is cheaper than handling old one.
Variant D: /trunk
/my_project_A
/firmware
/harmony /* copy or appropriate /microchip/harmony/v1_xx */
/my_project_B
/firmware
/harmony /* copy or appropriate /microchip/harmony/v1_yy */
/framework
...
/software
Here local changes and corrections in Harmony framework required by one project will not affect others unintentionally. Otherwise just merge modification of Harmony between projects.