plan44 / vdcd

vdcd - home automation device controller for Digital Strom and (via p44mbrd) matter
https://plan44.ch/automation
Other
22 stars 7 forks source link

serialcomm.hpp:107:21: error: field 'mOldTermIO' has incomplete type 'p44::termios2' #15

Closed splattner closed 1 month ago

splattner commented 1 month ago

I'm getting this error:

serialcomm.hpp:107:21: error: field 'mOldTermIO' has incomplete type 'p44::termios2'

when trying to compile? Any Idea how to solve it?

plan44 commented 1 month ago

Hi @splattner, is this inside your docker container? What is the build target exactly?

There were some changes in serialcomm to allow non-standard baud rates and custom break duration (for generating DMX512 signal on standard UART). But it seems the new #ifdefs fail for the target you are building, in that despite TCGETS2 defined, struct termios2 is not defined and thus assumes there must be a p44::termios2. But termios2should be defined by <termios.h> via including fdcomm.hpp. Can't see right now how this can fail…

splattner commented 1 month ago

yeah, I'm using the Dockerfile to build. :thinking: any missing libraries there? but termios.h is there:

#9 [builder 4/5] RUN whereis termios.h
#9 0.202 termios: /usr/include/termios.h
#9 DONE 0.2s

Probably not related, but I had to modify it a bit because the git submodule update resulted in:

0.370 Cloning into '/vdcd/src/p44features'...
1.019 Cloning into '/vdcd/src/p44lrgraphics'...
1.805 Cloning into '/vdcd/src/p44utils'...
2.786 Cloning into '/vdcd/src/p44vdc'...
5.495 fatal: remote error: upload-pack: not our ref badd4fe03a0b25f8f1373a25d848522a07b892d8
5.495 fatal: The remote end hung up unexpectedly
5.503 Fetched in submodule path 'src/p44features', but it did not contain badd4fe03a0b25f8f1373a25d848522a07b892d8. Direct fetching of that commit failed.
------
Dockerfile:30
--------------------
  29 |     
  30 | >>> RUN cd ${DSROOR}/vdcd && \
  31 | >>>     git checkout ${BRANCH} && \
  32 | >>>     git submodule init && \
  33 | >>>     git submodule update
  34 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c cd ${DSROOR}/vdcd &&     git checkout ${BRANCH} &&     git submodule init &&     git submodule update" did not complete successfully: exit code: 1

I also couldn't do the git submodule init && git submodule update on a freshly cloned vdcd repo outside of my docker container (same error).

So I just cloned the repos manually (with git clone) into the subdirectory without using submodules and then did a COPY . ${DSROOR}/vdcd in the Dockerfile.

splattner commented 1 month ago

btw, first, thx for your fast answer :heart_eyes:

and 2nd, I have the same issue when compiling it outside of docker. my system is an ubunutu (23.10)

plan44 commented 1 month ago

Ok, I now have set up a debian 12 build which reproduces the problem.

There seems to be profound uglyness around using termios2, when even people who really seem to know serial need to resort to copy headers 🙄

The problem does not surface in my openwrt 22.05 builds for MT7688 and RPi, probably because these are using musl and not glibc.

I'm trying to find a workaround...

plan44 commented 1 month ago

Should be fixed on main now. Turns out that apparently using termios2 is not possible/advisable from standard glibc userland at this time. It works with OpenWrt/musl, so I just restricted trying to use it to that build environment.

splattner commented 1 month ago

I'll give it a try later. Thanks a lot!