Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

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

8 views
Skip to first unread message

Mitchell Kember

unread,
Sep 1, 2022, 1:59:29 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


Reply all
Reply to author
Forward
0 new messages