 +    config = ctx.attr.sigstruct[SGXSigstructInfo].config
 +    unsigned = ctx.attr.sigstruct[SGXSigstructInfo].unsigned
 +    unsigned_file = unsigned.files.to_list()[0]
-+    ctx.actions.run(
++    ctx.actions.run_shell(
 +        inputs = [
 +            config,
 +            ctx.file.public_key,

+
+def _sgx_debug_enclave_impl(ctx):
+    """Implementation of an automated signing process of an unsigned enclave."""
+    ctx.actions.run(
+        inputs = [
+            ctx.file.unsigned,
+            ctx.file._key,
+            ctx.file.config,
+        ],
+        executable = ctx.executable._sign_tool,
+        outputs = [ctx.outputs.executable],
+        progress_message = "Signing for debug: //{pkg}:{name}".format(
+            pkg = ctx.attr.unsigned.label.package,
+            name = ctx.attr.unsigned.label.name,
+        ),
+        arguments = [
+            "sign",
+            "-enclave",

+)
--- /dev/null
+++ sgx_sdk.bzl
@@ -0,0 +1,590 @@
+"""Build tools for supporting Intel's SDK."""
+
+load("@com_google_asylo_backend_provider//:enclave_info.bzl", "EnclaveInfo")
