PSA: FIDL "_hlcpp" suffix will be required in GN

26 views
Skip to first unread message

Mitchell Kember

unread,
Sep 1, 2022, 1:58:18 PM9/1/22
to fidl-dev
You can stop reading if you don’t use FIDL HLCPP bindings in the Fuchsia GN build.

In the past, depending on a FIDL target gave you HLCPP bindings by default. Soon, you will be required to explicitly choose the bindings flavor using the “_hlcpp” or “_cpp” suffix. For example:

executable("foo") {

  # ...


  deps = [

    # DEPRECATED: Implicitly choose HLCPP.

    "//sdk/fidl/fuchsia.component",


    # Explicitly choose HLCPP with "_hlcpp".

    "//sdk/fidl/fuchsia.component:fuchsia.component_hlcpp",


    # Explicitly choose the new C++ bindings with "_cpp".

    "//sdk/fidl/fuchsia.component:fuchsia.component_cpp",

  ]

}


See Comparing C, new C++, and high-level C++ language bindings for help deciding which C++ bindings you should use.


This is tracked by fxbug.dev/108354, and enforcement starts with an allowlist in fxrev.dev/718410. I will migrate all existing build targets in the coming days. After the migration, if you try using the old way, you’ll get a GN error like this:


ERROR at //build/config/BUILDCONFIG.gn:2006:3: Dependency not allowed.

  target(target_type, target_name) {

  ^---------------------------------

The item //examples/fidl/hlcpp/unittests:example-cpp-host-test_executable

can not depend on //examples/fidl/fuchsia.examples:fuchsia.examples

because it is not in //examples/fidl/fuchsia.examples:fuchsia.examples's visibility list: [

  //sdk/*

  //src/*

  //third_party/*

  //tools/*

  //vendor/*

  //zircon/*

]


Please reach out if you have any questions.



Mitchell


Fabrice de Gans

unread,
Sep 1, 2022, 2:02:01 PM9/1/22
to Mitchell Kember, fidl-dev
Will this be applied to the GN SDK or is it only in-tree?

Thank you,
Fabrice

--
All posts must follow the Fuchsia Code of Conduct https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
---
You received this message because you are subscribed to the Google Groups "fidl-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fidl-dev+u...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/fidl-dev/CAF4EkWW_6o6RB-%2Bc%3D%2B6_T8MYbQ_HCh0O5d6LeiJvPOTToR62Og%40mail.gmail.com.

Mitchell Kember

unread,
Sep 1, 2022, 3:30:56 PM9/1/22
to Fabrice de Gans, fidl-dev
On Thu, Sep 1, 2022 at 11:01 AM Fabrice de Gans <fde...@google.com> wrote:
Will this be applied to the GN SDK or is it only in-tree?

No changes to the GN SDK, which only supports HLCPP right now. This change only applies to repos that use fuchsia.git's //build/fidl.gni.
Reply all
Reply to author
Forward
0 new messages