Skip to content

Commit 3b1c2ae

Browse files
committed
FEATURE: Add note about requiring 'machinekit-hal' package version
During discussion about pull request machinekit/EMCApplication#6 it became obvious that the reason why building Machinekit EMCApplication requires explicitly stating which version of Machinekit-HAL will be required is not apparent. Thus, this note was written in hopes it will shed light into the process.
1 parent 53331b1 commit 3b1c2ae

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/developing/emcapplication-developing.asciidoc

+14
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
. <<install-development-packages,Install packages required for building from source>>
1515
. <<get-source-and-build,Get and build the source>>
1616

17+
=== [[aditional-notes]]Additional notes
18+
19+
. <<machinekit-hal-pinning,Why do I have to pass Machinekit-version when building debian packages>>
20+
1721
== [[install-development-packages-docker]]Install packages required for building Debian packages with Docker
1822

1923
These instructions assume that you have `sudo` rights and that you can execute `bash` scripts on your machine. You can build the *EMCApplication* debian package this way which can be then installed on target machine by the `apt` utility. You will also need to have installed **Git** executable and for container specific instructions also **Docker CLI** and **Docker daemon**. Directions for both can be found in link:/docs/developing/common-developing[Set up common development environment for all Machinekit projects].
@@ -149,3 +153,13 @@ It is also viable to disallow _apt_ to upgrade the _machinekit-hal_ package to h
149153
----
150154
sudo apt-mark hold machinekit-hal
151155
----
156+
157+
== [[machinekit-hal-pinning]]Why do I have to pass Machinekit-version when building Debian packages?
158+
159+
It is important to understand what Machinekit EMCApplication really is. From programming point of view it is just set of patches applied over _LinuxCNC@master_ branch which it periodically tracks. (Meaning changes happening in the _upstream_ LinuxCNC@master are from time to time _merged into_ the _EMCApplication@machinekit/master_ branch.) And all what these additional patches are doing is to allow parts of LinuxCNC CNC stack (historically called **E**nhanced **M**otion **C**ontroller) to use external HAL dependency.
160+
161+
Machinekit-HAL project and LinuxCNC project both have certain development vector independent of each other, i.e. Machinekit-HAL does not care about LinuxCNC and LinuxCNC does not care about Machinekit-HAL. This represents quite interesting problem when creating **dpkg** packages, because **EMCApplication** package has to depend on **Machinekit-HAL** package, but also specific version of _EMCApplication_ has to depend on specific version of _Machinekit-HAL_ (or specific range) as later or previous versions of Machinekit-HAL can include incompatible code. And the easiest way how to guarantee the compatibility is to require the same version of Machinekit-HAL package as install dependency of EMCApplication as was used in build stage.
162+
163+
This way the _apt_ will make sure that the correct version of Machinekit-HAL is installed for the EMCApplication issue-less operation.
164+
165+
Using the _**mk-build-deps**_ script from the _devscripts_ package for creating environment capable of problem-less building of packages by invocating `dpkg-buildpackage` or compiling and linking the software during **R**un-**I**n-**P**lace build needs the `debian/control` file with correctly stated `Build-Depends: machinekit-ha (=` dependency. This is why we need to pass the _machinekit-hal_ package version early in stage when calling the `debian/configure machinekit-hal=${VERSION}` script.

0 commit comments

Comments
 (0)