-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3 support 🙲 locking of dependencies #2
Comments
Didn't LinuxCNC finish porting from Python 2 to 3? After installing EMCApplication on top of MachineKit-HAL, I can only import linuxcnc from Python 2. |
@jallwine,
|
When I build LinuxCNC from source using this configure command, I do get a python3 version of the linuxcnc module: ./configure --with-realtime=uspace --with-python=python3 --with-boost-python=boost_python-py35 |
@jallwine, Looks like @rene-dev is busy working and actually has support for Python 3 based packages in LinuxCNC/linuxcnc#943. |
Gotcha, so following the instructions in the EMCApplication README I can build it from source to have Python 3 support? Copied mostly from the README, but with the python flags:
|
linuxcnc master works with python3, but no python3 packages have been released, and it is currently not the default. |
It is basically patched LinuxCNC@master branch to build and work against Machinekit-HAL repository (RuntimeAPI, HAL, modules etc.). Only the EMC application (+ at least one GUI) is expected to work. The whole idea is to have a bunch of Featured Applications running against Machinekit-HAL and support that way the modularized approach. (Another one is the HAL ROS integration.)
Thanks, but the idea behind EMCApplication is to have minimal patching and LinuxCNC@master tracking. So I will have to wait until it is merged to master. |
Is there any reason the updated build system can't be merged into linuxcnc master? |
It would be fantastic if the LCNC project could merge the changes for building EMC against an external HAL. When I wrote them, I deliberately made them as minimal as possible, both to make them easier to merge into updated LCNC, and also in hopes they would be easier to review for LCNC inclusion. @cerna knows best the latest status, but once the EMCApplication is building smoothly in CI and we've worked out any remaining issues, I'd consider the changes ready for inclusion upstream. |
Because I didn't think (@zultron probably too) that it would fly. I still don't. This is basically packaging parts of the LinuxCNC for use in other programs, it could be a precursor to splitting the LinuxCNC into HAL, CNC and GUIs parts. And I just cannot see the community going for it. Or you mean the Python 3 packaging for Debian? Well, I wouldn't be too much considerate to the non-Python 3 supporting parts. One GUI is good enough for me. And now you, heavyweight in LinuxCNC development community, are doing it. The status is that now the CI part must be done. Given that the Machinekit wants to use Machinekit-CI repository for most CI related tasks, I need to abstract away the differences between all repositories to some useable and not-too-stupid level. Then there are the tests, which not all pass because of environment/executable mismatch. I haven't really spent any time on this recently and considered it lower priority. (It was working). So, so far I would consider good plan to implement |
@rene-dev how much more is there to do to get your changes into LinuxCNC master? It seems like the move to Python 3 is actively progressing and rolling back to Python 2 isn't the best plan. I would love to see LinuxCNC split up into HAL, CNC and GUIs. Encapsulation is the name of the game in software development. It's more maintainable, understandable and flexible. We don't use any of the GUIs, so its frustrating that they seem to be the main thing holding back progress. Python 2 has been EOL for almost a year now. I understand open source projects can lag behind due to the nature of volunteers driving development, and it can be difficult to get buy-in on large changes due to the limited resources to implement them, but if LinuxCNC was split up into more manageable pieces, it seems like it would be better for long term development. @cerna, @zultron what do you think the main resistance to splitting up would be? |
Of course, this question should be asked in the LCNC project, but I do remember the idea being broached in the past. I recall seeing only tepid support. Speculating, perhaps a lack of enthusiasm stems from not understanding the benefits, or a low benefit to effort ratio. (FWIW, I'm obviously in favor of splitting!) The only concrete reason opposing a split that I recall concerned a fear that users submitting issues would be confused about which repo to file the issue in, for example the UI, the EMC or the HAL repo. IMO, if that's actually a significant problem, there are ways to mitigate it. |
Thinking about it for a couple of days, I consider the main hurdles:
|
It sounds like LinuxCNC has now fully implemented Python 3 support. Perhaps this issue can now be resolved? Also, I'd like to continue our conversation about the possibility of merging EMCApplication upstream, but I'm not sure the best place to do that (so I'm going to here for now). It would be great to have the conversation somewhere both LinuxCNC an MachineKit developers could weigh in (maybe a pull request?). I've been in contact with a LinuxCNC developer (@SebKuzminsky) as well as their sponsor into Debian (@smoe) (they are in the process of integrating packages officially into Debian, see LinuxCNC/linuxcnc#1269). The impression I get is they are in favor of splitting things out where it makes sense (HAL, GUIs, etc.) and of course the amount of work that is involved is a key factor. It seems like it would be fairly straight forward to merge EMCApplication upstream, but there could be complications about dependencies and package management? @cerna, I've seen a lot of work on your part with respect to package management and the build system (machinekit/machinekit-hal#349 and machinekit/machinekit-hal#353). Any thoughts? Another concern is providing an environment for GUI developers to be able to focus on GUI concerns and less about package management concerns. Like you mentioned, the dependency graph could get complicated, so ensuring there's a reasonable development workflow is key. Anyway, I definitely think bringing these forks back together somehow would have benefits for everyone! For what it's worth, we recently released software for all Pocket NC machines that includes EMCApplication+MachineKit-HAL. A major reason was to get the best of both worlds: the HAL improvements from MachineKit-HAL and the CNC improvements from LinuxCNC. If LinuxCNC started using MachineKit-HAL, we'd be onboard with using LinuxCNC+MachineKit-HAL. |
Very probably yes. As I have been working on the buildsystem for Machinekit-HAL, I haven't looked into it yet.
Without any code, the issues are probably better than pull requests. Not sure if this one or something more neutral. But the EMCApplication already is pretty much upstream, with only minor patches to allow building the EMC portion against externally packaged HAL. As far as I know, @rene-dev is currently working on CMake port of the Makefile based buildsystem of LinuxCNC. I am not sure how far along this is, but in connection to my rework of Machinekit-HAL, it could (maybe) be fairly straightforward. Or just require some wrapping CMake targets.
Interesting. I sent some feelers how hard it would be to include Machinekit-HAL into Debian proper and was told that there is almost zero chance with the current package structure et al. (Mixing executables, libraries and development files, Python and all into almost one.) Which is one reason why I started doing the restructuralization of packaging. (The current status can be seen here.) Using
I am all in favor of splitting the stuff into multiple repositories and packages. Unfortunately, there is no hard standard for specifying dependencies. For the build itself, you can use the basic From the GUI tools standpoint, these should just declare the dependency version they currently support but live on their own. Kind of like the group around the @kcjengr is currently doing with QtPyVCP or the @qtquickvcp. To summarize, what I think is important:
|
I need to exempt myself from this discussion until I understand more of LinuxCNC (and MachineKit-HAL). My hunch is that all @cerna outlined above will happen, albeit unlikely for 2.9 of LinuxCNC (now at 2.8.2). I am not sure if the modularisation needs to happen all in one go, and if not, which parts should be isolated first. The advantage of Make over all other build systems is that everyone thinks to understand it. And from what I oversee, there is no need to move away from it. |
@zultron mentions a few problems with the current buld system here: machinekit/machinekit#336 |
We likely agree that it is all less about the merger of code than it is about the concentration of eyeballs and brain-power that the merge is helping with for the benefit of an accelerated development of LinuxCNC at large. Someone forking is not necessarily something negative - technically, every branch does that. So, forks shall be encouraged. And so should be merges for the benefit of all. The modularisation is about helping forks to "fork small" and keep diffs humanely traceable, so merges are easier, too. The situation now is a very natural one of projects becoming big. If CMake is a way to help a partial merge with LinuxCNC's most prominent fork - so go for it, I'd say. I'll likely learn something. @rene-dev , I presume you are in close contact with the other LinuxCNC devs, so you know better than me how to overcome last hurdles for a transition to CMake. Concerning the Debian packaging I happily adjust to what you core devs are agreeing on. To help the forking it may be reasonable to introduce sonames to package names to reflect the API versions. This would then be the formal representation of dependencies that @cerna asked for. |
@zultron @cerna @rene-dev, what concrete steps are necessary before a merge upstream is possible (ignoring developer buy-in for the moment)? @cerna, like you said, it seems like EMCApplication only has minimal changes, the main one being it separates the HAL side of LinuxCNC so it can be built on an external HAL. This is exactly what everyone here seems to be suggesting is a good idea. If the latest LinuxCNC changes were merged into EMCApplication, could we put together a pull request from EMCApplication back up to LinuxCNC? Obviously, there will be a big dependency change in doing so, but it seems like it would be straight forward to at least formalize the effort and move the conversation to a directly relevant place. @rene-dev you mentioned merging LinuxCNC HAL and MachineKit-HAL. Is there functionality in LinuxCNC that is missing from MachineKit-HAL? Or, do you see MachineKit-HAL as a suitable replacement for LinuxCNC HAL? Merging EMCApplication into LinuxCNC seems like the right first step from my perspective, but am I missing something obvious? |
In Machinekit, the first step of modularization was to separate the Machinekit-HAL and Machinekit-CNC. After that the Machinekit-CNC was kind of dropped in favor of EMCApplication, which is mostly upstream LinuxCNC patched so it supports building against external HAL. This kind of separation is what I think would be interesting for LinuxCNC project as well. What I have been trying to do with Machinekit-HAL is to separate the HAL portion even more - for example put each Python logical module into its own package and build a wheel from it. Or separate the NanoPB library, the PRU Assembler etc - basically things which were included in the past and which I think should not have been. CMake supports interesting pattern called Superbuild which allows you to download (or otherwise get) external dependencies and parts during the build itself, so you don't need to have them in the base repository.
Do you have it somewhere public for me to take a look? Trying to look up branches named "cmake" or "buildsystem" in your fork was not very fruitful.
This! Trying to make changes one needs to keep track of all possible friction points. Having many small projects instead of one big one should help with this problem.
True. Small problem with this is that nobody really cared about it before, because everything was rebuild in one go. So it will require additional step (which might annoy developers).
I think the current changes could be merged pretty much as is upstream. Of course there could (and probably would) be some minor problems integrating it into the buildsystem. (Export what is in EMCApplication@machinekit/master into patch applicable against LinuxCNC@master.)
I know it was not question for me, but I think that both HAL implementation will probably remain independent. It would be great to define some public API to standardize the cooperation, though. |
@petterreinholdtsen is currently orchestrating the use of po4a for the internationalization of the LinuxCNC documentation. This requires changes to the build infrastructure and may be an opportunity for a functionally non-critical assessment of whatever plans there are emerging for the modularization. An early contact to @rene-dev is already established from what I have followed on IRC. |
I PRed in the change to CMake based build-system into Machinekit-HAL. SO now is probably as good as any time to update the EMCApplication on current upstream master. The buildsystem change created few problems which will need to be solved (read I will need to solve) on the side of EMCApplication:
As next task I will have to get familiar enough with these recent changes in upstream LinuxCNC. |
Changing the supported version of Python from 2 to 3 in Machinekit-HAL dependency (in machinekit/machinekit-hal#303) caused that EMCApplication Debian packages are installable, but the software is actuall unusable.
This is because EMCApplication has Machinekit-HAL as a dependency, but is comfortable with anything >0.4. In hindsight this is naïve as the development of Machinekit-HAL (and other dependencies) can go at paces different from EMCApplication, so (minimally when creating binary packages) the dependencies should be locked at known version.
In case with Machinekit-HAL, the version with which the EMCApplication was build with.
The text was updated successfully, but these errors were encountered: