Add cpp hello world example

Change-Id: I0eb292c281ee4fd4ab0d38445f45e62a74a289c8
Reviewed-on: https://fuchsia-review.googlesource.com/c/workstation/+/669696
Fuchsia-Auto-Submit: Chase Latta <chaselatta@google.com>
Reviewed-by: Darren Chan <chandarren@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
diff --git a/.bazelrc b/.bazelrc
index 828f771..a0178f0 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,3 +1,6 @@
+build --strategy=FuchsiaPmPublish=local
+build --flag_alias=publish_to=@rules_fuchsia//fuchsia:package_repo
+
 build:fuchsia_x64 --crosstool_top=@fuchsia_clang//:toolchain
 build:fuchsia_x64 --cpu=x86_64
 build:fuchsia_x64 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
diff --git a/.bazelversion b/.bazelversion
deleted file mode 100644
index 0569b66..0000000
--- a/.bazelversion
+++ /dev/null
@@ -1 +0,0 @@
-5.0.0rc1
diff --git a/sdk-integration b/sdk-integration
index 1eea3ac..126e18c 160000
--- a/sdk-integration
+++ b/sdk-integration
@@ -1 +1 @@
-Subproject commit 1eea3ac74319329766ddfc037dd24c30134729fc
+Subproject commit 126e18c59e8fc15759ae4583e33d622956c3314e
diff --git a/src/examples/hello_workstation/BUILD.bazel b/src/examples/hello_workstation/BUILD.bazel
index 71a12ae..d1b7af2 100644
--- a/src/examples/hello_workstation/BUILD.bazel
+++ b/src/examples/hello_workstation/BUILD.bazel
@@ -15,6 +15,7 @@
     deps = [
         ":hello_dart_routing",
         ":hello_flutter_routing",
+        "//src/examples/hello_workstation/cpp:component",
         "//src/examples/hello_workstation/dart",
         "//src/examples/hello_workstation/flutter",
     ],
diff --git a/src/examples/hello_workstation/cpp/BUILD.bazel b/src/examples/hello_workstation/cpp/BUILD.bazel
new file mode 100644
index 0000000..4502ca8
--- /dev/null
+++ b/src/examples/hello_workstation/cpp/BUILD.bazel
@@ -0,0 +1,36 @@
+# Copyright 2022 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+load(
+    "@rules_fuchsia//fuchsia:defs.bzl",
+    "fuchsia_cc_binary",
+    "fuchsia_component",
+    "fuchsia_component_manifest",
+)
+
+fuchsia_cc_binary(
+    name = "hello_world",
+    srcs = [
+        "hello_world.cc",
+    ],
+    deps = [
+        "@fuchsia_sdk//pkg/fdio",
+        "@fuchsia_sdk//pkg/syslog",
+    ],
+)
+
+fuchsia_component_manifest(
+    name = "manifest",
+    src = "meta/hello_world.cml",
+    includes = ["@fuchsia_sdk//pkg/syslog:client"],
+)
+
+fuchsia_component(
+    name = "component",
+    manifest = ":manifest",
+    visibility = [
+        "//src/examples/hello_workstation:__pkg__",
+    ],
+    deps = [":hello_world"],
+)
diff --git a/src/examples/hello_workstation/cpp/hello_world.cc b/src/examples/hello_workstation/cpp/hello_world.cc
new file mode 100644
index 0000000..9c813a0
--- /dev/null
+++ b/src/examples/hello_workstation/cpp/hello_world.cc
@@ -0,0 +1,12 @@
+// Copyright 2022 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <iostream>
+
+int main() {
+  abort();
+  std::cout << "Hello, World!\n";
+
+  return 0;
+}
diff --git a/src/examples/hello_workstation/cpp/meta/hello_world.cml b/src/examples/hello_workstation/cpp/meta/hello_world.cml
new file mode 100644
index 0000000..f9492f3
--- /dev/null
+++ b/src/examples/hello_workstation/cpp/meta/hello_world.cml
@@ -0,0 +1,10 @@
+{
+    include: [ "syslog/client.shard.cml" ],
+
+    program: {
+        runner: "elf",
+        binary: "bin/hello_world",
+        forward_stderr_to: "log",
+        forward_stdout_to: "log"
+    },
+}
diff --git a/src/flutter_embedder/BUILD.bazel b/src/flutter_embedder/BUILD.bazel
index 47a0c28..8632ea3 100644
--- a/src/flutter_embedder/BUILD.bazel
+++ b/src/flutter_embedder/BUILD.bazel
@@ -22,8 +22,8 @@
         "libflutter_engine.so",
     ],
     deps = [
-        "@fuchsia_sdk//pkg/async-loop-default",
         "@fuchsia_sdk//pkg/async-loop-cpp",
+        "@fuchsia_sdk//pkg/async-loop-default",
         "@fuchsia_sdk//pkg/syslog",
     ],
 )
@@ -44,13 +44,12 @@
 filegroup(
     name = "flutter_embedder_libs",
     srcs = [
-        "@fuchsia_sdk//:arch/x64/sysroot/dist/lib/ld.so.1",
         "@fuchsia_sdk//:arch/x64/lib/libasync-default.so",
         "@fuchsia_sdk//:arch/x64/lib/libfdio.so",
         "@fuchsia_sdk//:arch/x64/lib/libsyslog.so",
         "@fuchsia_sdk//:arch/x64/lib/libtrace-engine.so",
+        "@fuchsia_sdk//:arch/x64/sysroot/dist/lib/ld.so.1",
     ],
-
 )
 
 # To rebuild the Flutter app with new changes:
@@ -91,8 +90,8 @@
     name = "flutter_sample_app_package",
     package_name = "flutter_sample_app",
     deps = [
-        ":flutter_sample_app_component",
         ":flutter_engine",
+        ":flutter_sample_app_component",
     ],
 )
 
diff --git a/src/product/BUILD.bazel b/src/product/BUILD.bazel
index 2f3f0da..31801be 100644
--- a/src/product/BUILD.bazel
+++ b/src/product/BUILD.bazel
@@ -9,9 +9,9 @@
     "fuchsia_image_configuration",
     "fuchsia_image_paver",
     "fuchsia_package",
+    "fuchsia_product_bundle",
     "fuchsia_product_image",
     "fuchsia_product_release",
-    "fuchsia_product_bundle"
 )
 
 fuchsia_image_configuration(
@@ -26,11 +26,11 @@
 
 fuchsia_product_image(
     name = "workstation_x64",
-    image = ":x64_image_configuration",
+    aib = "@workstation_external_packages//:assembly_bundle",
     board_name = "x64",
+    image = ":x64_image_configuration",
     partition_template = "partitions_template.json",
     product_config = "product_config.json",
-    aib = "@workstation_external_packages//:assembly_bundle"
 )
 
 fuchsia_image_paver(
@@ -40,17 +40,17 @@
 
 fuchsia_product_release(
     name = "workstation_x64_release",
+    aib = "@workstation_external_packages//:assembly_bundle",
     lock_file = "@//:artifact_lock.json",
     product_image = ":workstation_x64",
-    aib = "@workstation_external_packages//:assembly_bundle",
 )
 
 fuchsia_product_bundle(
     name = "workstation_x64_pbm",
     build_info_template = ":build-info_template.json",
-    virtual_device_template = ":virtual_device_template.json",
-    multiboot_bin = "@workstation_external_packages//:multiboot.bin",
     device_name = "qemu-x64",
-    product_name = "workstation-oot",
+    multiboot_bin = "@workstation_external_packages//:multiboot.bin",
     pbm_configs = ":workstation_x64_release",
-)
\ No newline at end of file
+    product_name = "workstation-oot",
+    virtual_device_template = ":virtual_device_template.json",
+)