genodelabs / genode-world

Collection of community-maintained components for Genode
Other
44 stars 46 forks source link

[udp_log] does not build #343

Closed ttcoder closed 8 months ago

ttcoder commented 9 months ago

Seems the LOG session API changed a while back and this component needs adapting, since the logging write() now has "void" return type? :

  Program proxy/udp_log/udp_log
/GenCharlie/dev_ge/ge23_05/genode/repos/world/src/proxy/udp_log/main.cc:77:10: error: conflicting return type specified for ‘virtual Genode::size_t Udp_log::Session_component::write(const String&)’
   77 |   size_t write(String const &string) override
      |          ^~~~~
In file included from /GenCharlie/dev_ge/ge23_05/genode/repos/world/src/proxy/udp_log/main.cc:23:
/GenCharlie/dev_ge/ge23_05/genode/repos/base/include/log_session/log_session.h:55:15: note: overridden function is ‘virtual void Genode::Log_session::write(const String&)’
   55 |  virtual void write(String const &string) = 0;
      |               ^~~~~
(..)
/GenCharlie/dev_ge/ge23_05/genode/repos/world/src/proxy/udp_log/logger.h:169:39: error: conversion from ‘Genode::size_t’ {aka ‘long unsigned int’} to ‘Genode::uint16_t’ {aka ‘short unsigned int’} may change value [-Werror=conversion]
  169 |     udp.length(size_guard.head_size() - udp_off);

With a couple changes I got it to build and run (at least in qemu), will test its actual networking traffic on bare metal later on.

I'm still in 23.05 so it might be that this was fixed already and I'm just behind the curve.

ttcoder commented 9 months ago

Ok with the build "fixed" with a couple changed lines, I tried on metal to see if I could listen to the LOG from another computer : I configured to send the UDP packets to another laptop on the same LAN (they can ping each other), but no joy...

The "listener" laptop is running

nc -l -p 9

I'm probably doing something wrong, since my net-fu is quite weak :-)

ttcoder commented 9 months ago

Silly me, nc obviously works on TCP by default, it needs the -u flag to listen to UDP traffic:

nc -l -u -p 9

And then it works great (I seem to get "dropped packets" on the Tx side after a while, but not a problem for me since I'm after boot-up diagnostic only)

Anywyay I'm good on this ticket :-) (I can apply the build "fixes" on my own etc)

chelmuth commented 8 months ago

Good to hear that it works after fixing the obvious build fixes. @jschlatow may we add a recipe for this component, so that it's build regularly?

jschlatow commented 8 months ago

@chelmuth I added recipes for udp_log and log_udp in commit d066bac and fixed the build errors with commit 2de95f6.

chelmuth commented 8 months ago

Merged to staging incl. Fixes marker.