New issue
Advanced search Search tips

Issue 821633 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Allow chromeos-dbus-bindings to produce both old and new FD bindings

Project Member Reported by ejcaruso@chromium.org, Mar 14 2018

Issue description

The last major step in moving to new libchrome is getting everyone on the new D-Bus bindings. A fair number of these bindings are produced by chromeos-dbus-bindings.

Currently both the old and new bindings are available in libchrome and libbrillo. In order to avoid having to make a large, atomic batch of invasive changes to D-Bus daemons, we can pass an option to chromeos-dbus-bindings to target either the old or new bindings, defaulting to the old bindings, and then move projects separately. After all daemons are moved we can default to the new bindings and then eventually remove the option altogether.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/715ae8e303ae97d5a27efa8d422c42c4e73a352b

commit 715ae8e303ae97d5a27efa8d422c42c4e73a352b
Author: Eric Caruso <ejcaruso@chromium.org>
Date: Sat Mar 17 01:31:23 2018

chromeos-dbus-bindings: refactor D-Bus signature parsing

This introduces an intermediate representation for D-Bus type
signatures. This is useful because it allows us to do some extra
inspection of types without having to parse strings that we've
just generated. It also simplifies the parsing code since we can
create the intermediate representation during parsing and leave
the creation of the actual string type until later.

This makes it easier to change the way types are represented as
strings. This will be helpful when we implement generating
different sets of bindings for FDs, and easy separation between
type signatures used to extract arguments from messages and push
arguments into them will be useful for that as well.

BUG= chromium:821633 
TEST=unit tests

Change-Id: I42a7b8c345e9df98b8e74b9889bcd1e0d439ea32
Reviewed-on: https://chromium-review.googlesource.com/961720
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/715ae8e303ae97d5a27efa8d422c42c4e73a352b/chromeos-dbus-bindings/dbus_signature.h
[modify] https://crrev.com/715ae8e303ae97d5a27efa8d422c42c4e73a352b/chromeos-dbus-bindings/dbus_signature_unittest.cc
[modify] https://crrev.com/715ae8e303ae97d5a27efa8d422c42c4e73a352b/chromeos-dbus-bindings/dbus_signature.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Mar 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/58bc76c99c909a3de708c6f358eeff51a2d0af89

commit 58bc76c99c909a3de708c6f358eeff51a2d0af89
Author: Eric Caruso <ejcaruso@chromium.org>
Date: Tue Mar 20 02:21:33 2018

chromeos-dbus-bindings: use new DBusSignature::Parse

This uses the DBusType API rather than directly manipulating
strings.

BUG= chromium:821633 
TEST=unit tests

Change-Id: Id8b9a4af3cf32311651ee69a60703aa7a60c7da8
Reviewed-on: https://chromium-review.googlesource.com/969608
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/58bc76c99c909a3de708c6f358eeff51a2d0af89/chromeos-dbus-bindings/adaptor_generator.cc
[modify] https://crrev.com/58bc76c99c909a3de708c6f358eeff51a2d0af89/chromeos-dbus-bindings/proxy_generator.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/aosp/platform/external/libbrillo/+/2b61f16f86b773f88ba69a7a15b6a33e132c3a58

commit 2b61f16f86b773f88ba69a7a15b6a33e132c3a58
Author: Eric Caruso <ejcaruso@chromium.org>
Date: Fri Mar 23 03:53:33 2018

libbrillo: add default constructor for FileDescriptor

This allows us to default-construct the struct so a pointer to
one can be passed to D-Bus callers as an out-argument.

BUG= chromium:821633 
TEST=compile new bindings with permission_broker

Change-Id: I1c94d66c24d493a8e35c23724c316cb17bd22fa2
Reviewed-on: https://chromium-review.googlesource.com/976870
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/2b61f16f86b773f88ba69a7a15b6a33e132c3a58/brillo/dbus/file_descriptor.h

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/58684d4909d3fa12b957c33caed70c32c94f2764

commit 58684d4909d3fa12b957c33caed70c32c94f2764
Author: Eric Caruso <ejcaruso@chromium.org>
Date: Mon Mar 26 21:41:21 2018

chromeos-dbus-bindings: add D-Bus type for new-style FD bindings

This allows us to emit both the old and new types for file
descriptors, both of which work in libbrillo at the moment. When
we uprev libchrome and the old bindings go away, we can take this
extra complexity back out.

BUG= chromium:821633 
TEST=new unit tests, emit bindings and verify

Change-Id: I27843005e105c6542bc8e8d457125c457718fd46
Reviewed-on: https://chromium-review.googlesource.com/974511
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/58684d4909d3fa12b957c33caed70c32c94f2764/chromeos-dbus-bindings/adaptor_generator.cc
[modify] https://crrev.com/58684d4909d3fa12b957c33caed70c32c94f2764/chromeos-dbus-bindings/dbus_signature_unittest.cc
[modify] https://crrev.com/58684d4909d3fa12b957c33caed70c32c94f2764/chromeos-dbus-bindings/dbus_signature.cc
[modify] https://crrev.com/58684d4909d3fa12b957c33caed70c32c94f2764/chromeos-dbus-bindings/proxy_generator.cc
[modify] https://crrev.com/58684d4909d3fa12b957c33caed70c32c94f2764/chromeos-dbus-bindings/dbus_signature.h

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e

commit 9771ca33c7ff7601929b87ca8c992e1d0e3cde9e
Author: Eric Caruso <ejcaruso@chromium.org>
Date: Mon Mar 26 21:41:22 2018

chromeos-dbus-bindings: plumb through new-style FD support

Take a command-line argument, --new-fd-bindings, which will cause
chromeos-dbus-bindings to emit the new-style FD bindings that use
brillo::dbus_utils::FileDescriptor and base::ScopedFD instead of
the deprecated dbus::FileDescriptor when it encounters a FD type
in a D-Bus method or signal.

BUG= chromium:821633 
TEST=unit tests, generate permission_broker bindings

Change-Id: Ida9a879edeb3e868323e9193ddcb6f767fe823a9
Reviewed-on: https://chromium-review.googlesource.com/978474
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/proxy_generator_unittest.cc
[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/generate_chromeos_dbus_bindings.cc
[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/proxy_generator.h
[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/adaptor_generator_unittest.cc
[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/adaptor_generator.cc
[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/adaptor_generator.h
[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
[modify] https://crrev.com/9771ca33c7ff7601929b87ca8c992e1d0e3cde9e/chromeos-dbus-bindings/proxy_generator.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/906d6e2dfad8717e6f60bd5e0d40c5f44fc03a5a

commit 906d6e2dfad8717e6f60bd5e0d40c5f44fc03a5a
Author: Eric Caruso <ejcaruso@chromium.org>
Date: Thu Mar 29 02:34:23 2018

common-mk: allow specification of FD binding type

This adds support for the new FD binding types to the gypi files
that invoke chromeos-dbus-bindings.

BUG= chromium:821633 
TEST=generate bindings for e.g. permission_broker

Change-Id: I5c788c5d9a9a64ced25a498600db3c7e4e757a4c
Reviewed-on: https://chromium-review.googlesource.com/978475
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/906d6e2dfad8717e6f60bd5e0d40c5f44fc03a5a/common-mk/generate-dbus-proxies.gypi
[modify] https://crrev.com/906d6e2dfad8717e6f60bd5e0d40c5f44fc03a5a/common-mk/generate-dbus-adaptors.gypi

Status: Fixed (was: Started)

Sign in to add a comment