Major overhaul/rewrite of linuxcncrsh#3815
Open
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the many deficiencies and races in linuxcncrsh. Some of them have been discussed in #3734 and additional fixes have been added in previous PRs (#3809, #3803, #3800, #3791).
The entire linuxcncrsh program is now single-threaded and uses a poll loop to handle input/output. Multiple clients may be connected at the same time and all can be in the ENABLED state and issue SET commands. The limitation is that only one command can be in transit via NML for all clients (i.e. only one SET command can be processed at any given time). There are three exceptions; any enabled client can issue 'SET ABORT', 'SET MACHINE OFF' and 'SET ESTOP ON'. Any client can always issue GET commands.
Fixes and additions:
-dcommand-line option). The default is$HOME/nc_files. You can pass your own ':' separated list to the-doptionSeveral GET/SET commands were removed or deprecated:
The man-page has been updated to reflect all changes, removals and additions.
There are probably some more details that I forgot to mention here... Well, c'est la vie.
The diff of the source may be inadequate to look at because essentially every line got changed (and that is not because of whitespace changes). See the entire file: https://github.com/BsAtHome/linuxcnc/blob/fix_linuxcncrsh/src/emc/usr_intf/emcrsh.cc for review.
The new version also uses
fmt::format()to do string formatting, as discussed in #3814, because gcc-12 in Debian 12 (bookworm) does not support std::format (need gcc-14 or newer for that). A configure test and package dependency is added.