Coder Social home page Coder Social logo

obus's People

Contributors

chambart avatar craigfe avatar dbuenzli avatar djs55 avatar jeremiedimino avatar kit-ty-kate avatar meadofpoetry avatar nathanreb avatar pitag-ha avatar pmetzger avatar squiddev avatar talex5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

obus's Issues

Build error

Recently tried to install obus 1.1.6 on the 4.03.0+flambda opam switch, and got the following error:

#=== ERROR while installing obus.1.1.6 ========================================#
# opam-version 1.2.2
# os           linux
# command      ocaml setup.ml -build
# path         /home/guigui/.opam/4.03.0+flambda/build/obus.1.1.6
# compiler     4.03.0+flambda
# exit-code    1
# env-file     /home/guigui/.opam/4.03.0+flambda/build/obus.1.1.6/obus-21851-d2c37b.env
# stdout-file  /home/guigui/.opam/4.03.0+flambda/build/obus.1.1.6/obus-21851-d2c37b.out
# stderr-file  /home/guigui/.opam/4.03.0+flambda/build/obus.1.1.6/obus-21851-d2c37b.err
### stdout ###
# [...]
# Error: Multiple definition of the extension constructor name Service_unknown.
#        Names must be unique in a given structure or signature.
# Command exited with code 2.
# + /home/guigui/.opam/4.03.0+flambda/bin/ocamlopt.opt unix.cmxa -I /home/guigui/.opam/4.03.0+flambda/lib/ocamlbuild /home/guigui/.opam/4.03.0+flambda/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /home/guigui/.opam/4.03.0+flambda/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# File "myocamlbuild.ml", line 492, characters 43-62:
# Warning 3: deprecated: Ocamlbuild_plugin.String.uncapitalize
# Use String.uncapitalize_ascii instead.
# File "myocamlbuild.ml", line 505, characters 51-70:
# Warning 3: deprecated: Ocamlbuild_plugin.String.uncapitalize
# Use String.uncapitalize_ascii instead.
### stderr ###
# [...]
# W: Cannot find source file matching module 'UPower_interfaces' in library obus-upower
# W: Cannot find source file matching module 'Nm_interfaces' in library obus-network-manager
# W: Cannot find source file matching module 'Nm_interfaces' in library obus-network-manager
# W: Cannot find source file matching module 'Notification_interfaces' in library obus-notification
# W: Cannot find source file matching module 'Notification_interfaces' in library obus-notification
# W: Cannot find source file matching module 'Hal_interfaces' in library obus-hal
# W: Cannot find source file matching module 'Hal_interfaces' in library obus-hal
# W: Cannot find source file matching module 'OBus_interfaces' in library obus
# W: Cannot find source file matching module 'OBus_interfaces' in library obus
# E: Failure("Command ''/home/guigui/.opam/4.03.0+flambda/bin/ocamlbuild' src/obus.cma src/obus.cmxa src/obus.a src/obus.cmxs src/obus-idl.cma src/obus-idl.cmxa src/obus-idl.a src/obus-idl.cmxs syntax/obus-syntax.cma bindings/hal/obus-hal.cma bindings/hal/obus-hal.cmxa bindings/hal/obus-hal.a bindings/hal/obus-hal.cmxs bindings/notification/obus-notification.cma bindings/notification/obus-notification.cmxa bindings/notification/obus-notification.a bindings/notification/obus-notification.cmxs bindings/network-manager/obus-network-manager.cma bindings/network-manager/obus-network-manager.cmxa bindings/network-manager/obus-network-manager.a bindings/network-manager/obus-network-manager.cmxs bindings/upower/obus-upower.cma bindings/upower/obus-upower.cmxa bindings/upower/obus-upower.a bindings/upower/obus-upower.cmxs bindings/udisks/obus-udisks.cma bindings/udisks/obus-udisks.cmxa bindings/udisks/obus-udisks.a bindings/udisks/obus-udisks.cmxs bindings/policykit/obus-policykit.cma bindings/policykit/obus-policykit.cmxa bindings/policykit/obus-policykit.a bindings/policykit/obus-policykit.cmxs tools/obus_gen_interface.native tools/obus_dump.native tools/obus_gen_client.native tools/obus_gen_server.native tools/obus_xml2idl.native tools/obus_idl2xml.native tools/obus_introspect.native examples/bus_functions.native examples/eject.native examples/hello.native examples/list_services.native examples/monitor.native examples/notify.native examples/ping.native examples/pong.native examples/signals.native examples/network_manager.native examples/battery_monitoring.native -tag debug' terminated with error code 10")

Towards 2.0 release

So after a brief conversation it seems we are more or less agree on obus' future. Since it's a community project, and the goal is to provide a simple and robust interface to standard D-Bus IPC facilities, obus needs some simplifications.

In particular, it would be prudent to remove fancy yet unnecessary features, like IDL proxy language and PPX syntax extensions, and disentangle internal libraries and bindings.

Since these changes are quite invasive, they should go to 2.0 release. This issue is to track the progress.

  • Remove PPX support
  • Remove IDL and fix modules depending on IDL. Replace .obus files with D-Bus' native XML.
  • Remove custom annotations and supplementary code
  • Split obus and bindings (obus-notifications, obus-network-manager etc) into separate libraries.
  • Move all the documentation to mli, making obus odoc/odig friendly

Build failure

compiling obus fails for me:

./setup-dev.exe -build 
W: Field XMETAType is set but matching plugin is not enabled.
W: No exported module defined for library obus-syntax
W: Field XMETAType is set but matching plugin is not enabled.
W: No exported module defined for library obus-syntax
W: Cannot find source file matching module 'Policy_kit_interfaces' in library obus-policykit
W: Cannot find source file matching module 'Policy_kit_interfaces' in library obus-policykit
W: Cannot find source file matching module 'UDisks_interfaces' in library obus-udisks
W: Cannot find source file matching module 'UDisks_interfaces' in library obus-udisks
W: Cannot find source file matching module 'UPower_interfaces' in library obus-upower
W: Cannot find source file matching module 'UPower_interfaces' in library obus-upower
W: Cannot find source file matching module 'Nm_interfaces' in library obus-network-manager
W: Cannot find source file matching module 'Nm_interfaces' in library obus-network-manager
W: Cannot find source file matching module 'Notification_interfaces' in library obus-notification
W: Cannot find source file matching module 'Notification_interfaces' in library obus-notification
W: Cannot find source file matching module 'Hal_interfaces' in library obus-hal
W: Cannot find source file matching module 'Hal_interfaces' in library obus-hal
W: Cannot find source file matching module 'OBus_interfaces' in library obus
W: Cannot find source file matching module 'OBus_interfaces' in library obus
/opt/godi/bin/ocamlopt.opt -I /opt/godi/lib/ocaml/std-lib/ocamlbuild unix.cmxa /opt/godi/lib/ocaml/std-lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /opt/godi/lib/ocaml/std-lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
ocamlfind ocamldep -package xmlm -package type_conv -package lwt.unix -package lwt.syntax.log -package lwt.syntax -package lwt.react -package camlp4.quotations.o -package camlp4.lib -package camlp4.extend -modules src/oBus_address.mli > src/oBus_address.mli.depends
ocamlfind ocamldep -package xmlm -package type_conv -package lwt.unix -package lwt.syntax.log -package lwt.syntax -package lwt.react -package camlp4.quotations.o -package camlp4.lib -package camlp4.extend -modules src/oBus_uuid.mli > src/oBus_uuid.mli.depends
ocamlfind ocamlc -c -g -I src -package xmlm -package type_conv -package lwt.unix -package lwt.syntax.log -package lwt.syntax -package lwt.react -package camlp4.quotations.o -package camlp4.lib -package camlp4.extend -I src -o src/oBus_uuid.cmi src/oBus_uuid.mli
ocamlfind ocamlc -c -g -I src -package xmlm -package type_conv -package lwt.unix -package lwt.syntax.log -package lwt.syntax -package lwt.react -package camlp4.quotations.o -package camlp4.lib -package camlp4.extend -I src -o src/oBus_address.cmi src/oBus_address.mli
ocamlfind ocamldep -package type_conv -package camlp4.quotations.o -package camlp4 -syntax camlp4o -modules syntax/pa_obus.ml > syntax/pa_obus.ml.depends
ocamlfind ocamlc -c -g -package type_conv -package camlp4.quotations.o -package camlp4 -syntax camlp4o -I syntax -o syntax/pa_obus.cmo syntax/pa_obus.ml
+ ocamlfind ocamlc -c -g -package type_conv -package camlp4.quotations.o -package camlp4 -syntax camlp4o -I syntax -o syntax/pa_obus.cmo syntax/pa_obus.ml
File "syntax/pa_obus.ml", line 16, characters 9-1049:
Error: This function expects too many arguments, it should have type
Camlp4.PreCast.Syntax.Ast.expr option ->
Camlp4.PreCast.Ast.ctyp -> Camlp4.PreCast.Ast.str_item
Command exited with code 2.
E: Failure("Command '/opt/godi/bin/ocamlbuild src/obus.cma src/obus.cmxs src/obus.cmxa src/obus.a src/obus-idl.cma src/obus-idl.cmxs src/obus-idl.cmxa src/obus-idl.a syntax/obus-syntax.cma bindings/hal/obus-hal.cma bindings/hal/obus-hal.cmxs bindings/hal/obus-hal.cmxa bindings/hal/obus-hal.a bindings/notification/obus-notification.cma bindings/notification/obus-notification.cmxs bindings/notification/obus-notification.cmxa bindings/notification/obus-notification.a bindings/network-manager/obus-network-manager.cma bindings/network-manager/obus-network-manager.cmxs bindings/network-manager/obus-network-manager.cmxa bindings/network-manager/obus-network-manager.a bindings/upower/obus-upower.cma bindings/upower/obus-upower.cmxs bindings/upower/obus-upower.cmxa bindings/upower/obus-upower.a bindings/udisks/obus-udisks.cma bindings/udisks/obus-udisks.cmxs bindings/udisks/obus-udisks.cmxa bindings/udisks/obus-udisks.a bindings/policykit/obus-policykit.cma bindings/policykit/obus-policykit.cmxs bindings/policykit/obus-policykit.cmxa bindings/policykit/obus-policykit.a tools/obus_gen_interface.native tools/obus_dump.native tools/obus_gen_client.native tools/obus_gen_server.native tools/obus_xml2idl.native tools/obus_idl2xml.native tools/obus_introspect.native examples/bus_functions.native examples/eject.native examples/hello.native examples/list_services.native examples/monitor.native examples/notify.native examples/ping.native examples/pong.native examples/signals.native examples/network_manager.native examples/battery_monitoring.native -tag debug' terminated with error code 10")
make: *** [build] Fehler 1

ocaml 3.12.1, oasis 0.3.0.

Don't run dbus-launch if XDG_RUNTIME_DIR/bus is available

This is a wishlist forwarded from https://bugs.debian.org/836118 :

The major D-Bus implementations (libdbus, GDBus, sd-bus) now have a fallback code path, before trying X11 autolaunch, when DBUS_SESSION_BUS_ADDRESS is unset: if XDG_RUNTIME_DIR
is set, and XDG_RUNTIME_DIR/bus exists, is a socket and is owned by the process's uid, then they will use it. In particular, dbus-user-session sets up that situation.

It would be nice if obus implemented this fallback as well.

File descriptor in a signal message containing destination is closed

If a D-Bus server sends a signal message containing destination and file descriptor,
OBus closes the file descriptor in the message.

https://github.com/ocaml-community/obus/blob/master/src/protocol/oBus_connection.ml#L459

match apply_filters "incoming" message active.incoming_filters with
   | None -> ...
   | Some message ->
       (* The internal dispatcher accepts only messages destined to
          the current connection: *)
       if active.name = "" || OBus_message.destination message = active.name then ignore (
         (try%lwt
           dispatch_message active message
         with exn ->
           Lwt_log.error ~section ~exn "message dispatching failed with")
         [%lwt.finally
           OBus_value.V.sequence_close (OBus_message.body message)]
       );

If a signal message doesn't contain destination, " OBus_value.V.sequence_close" is not called.
But If a signal message contains destination, " OBus_value.V.sequence_close" is called, file descriptor is closed.

GPLed program using OBus

I want to implement D-Bus service (daemon) using OBus but my manager demands code to be GPLv2+ licensed and OBus is MIT-licensed. Is it possible to write GPLed software using OBus?

P. S.: It would be nice if you point me to example of service implementation.

Bytestrings (ay)

Hi,

I'm the creator of pydbus, DBus bindings for Python. I've stumbled upon the case of bytestrings - ay - which are commonly used to send non-Unicode data over DBus.

Because of the GDBus's API, apps commonly require these strings to be '\0'-terminated. And that's completely unintuitive for high-level languages, and something that requires the user to read API docs.

I'm thinking about solving the problem automatically, and I see two solutions:

  1. Auto-append and auto-strip the last character of "ay"s; [EDIT: impossible, some APIs use not-terminated strings]
  2. Decree (how?) that GDBus API is wrong, and strings sent over the wire should not be \0-terminated.
  3. [EDIT:] Create a new DBus annotation meaning "All "ay"s in the arguments of this method/signal are \0-terminated bytestrings" - and auto-append/auto-strip \0 if it's present.

Whatever we choose, the solution should be agreed upon by authors of bindings for all languages. That's why I'm here.

Do you have any experience with "ay"-encoded bytestrings?

Relevant discussion: LEW21/pydbus#27 (please reply there, I've opened similar issues in 8 different projects to get attention of bindings authors)

Invalid identifiers with auto-generated code

I came across this problem after invoking obus-introspect -system -rec org.bluez /org/bluez and then obus-gen-client. The generated code required some manual tweaking for two different reasons:

  1. It produced a function named class (reserved word in OCaml).
  2. It produced a value named UUID (yep, uppercase).

Nothing major. Nevertheless, it would be nice if the auto-generated code would be free from such issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.