<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>242730</bug_id>
          
          <creation_ts>2022-07-13 17:41:08 -0700</creation_ts>
          <short_desc>Xcode 14 beta: `error: An empty identity is not valid when signing a binary for the product type &apos;Command-line Tool&apos;.`</short_desc>
          <delta_ts>2023-01-13 18:37:18 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=243934</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>244043</dependson>
          <blocked>242429</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Elliott Williams">emw</reporter>
          <assigned_to name="Elliott Williams">emw</assigned_to>
          <cc>ap</cc>
    
    <cc>fred.wang</cc>
    
    <cc>jbedard</cc>
    
    <cc>rackler</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1883506</commentid>
    <comment_count>0</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2022-07-13 17:41:08 -0700</bug_when>
    <thetext>I noticed while working on the open-source Ventura bringup that TestWebKitAPI and WebKitTestRunner have different signing setting than any other project, resulting in them using a &quot;default&quot; code-signing identity when building with the public SDK. This results in build failures like:

    error: An empty identity is not valid when signing a binary for the product type &apos;Command-line Tool&apos;. (in target &apos;WebKitTestRunner&apos; from project &apos;WebKitTestRunner&apos;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883508</commentid>
    <comment_count>1</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2022-07-13 17:45:11 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/2396</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1885512</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-20 17:42:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/97350087&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890994</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-08-12 14:29:58 -0700</bug_when>
    <thetext>Committed 253391@main (3a3ad5eba5c5): &lt;https://commits.webkit.org/253391@main&gt;

Reviewed commits have been landed. Closing PR #2396 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891351</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Rackler">rackler</who>
    <bug_when>2022-08-15 09:33:57 -0700</bug_when>
    <thetext>This reverts commit 3a3ad5e.

Unreviewed revert
This reverts because causing 121 api test failures.

Canonical link: https://commits.webkit.org/253426@main</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891511</commentid>
    <comment_count>5</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2022-08-15 18:04:53 -0700</bug_when>
    <thetext>Re-opening for pull request https://github.com/WebKit/WebKit/pull/3334</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891726</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-08-16 12:11:03 -0700</bug_when>
    <thetext>Committed 253474@main (d245aed03e29): &lt;https://commits.webkit.org/253474@main&gt;

Reviewed commits have been landed. Closing PR #3334 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891988</commentid>
    <comment_count>7</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2022-08-17 11:36:56 -0700</bug_when>
    <thetext>Reverted by https://github.com/WebKit/WebKit/pull/3414</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891989</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-08-17 11:39:26 -0700</bug_when>
    <thetext>Committed 253527@main (808d943f6997): &lt;https://commits.webkit.org/253527@main&gt;

Reviewed commits have been landed. Closing PR #3414 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891991</commentid>
    <comment_count>9</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2022-08-17 11:40:48 -0700</bug_when>
    <thetext>Reverted in https://commits.webkit.org/253527@main</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892053</commentid>
    <comment_count>10</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2022-08-17 14:19:49 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/3428</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895835</commentid>
    <comment_count>11</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2022-09-02 12:32:38 -0700</bug_when>
    <thetext>Since this has gone on for awhile, I should summarize the problem.

First, Xcode 14 now defaults to requiring Mac executables to be signed. Other projects have had to adapt to this change by defaulting to ad-hoc signing where they could previously opt out. (e.g. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7350)

I&apos;ve been trying to use ad-hoc signing for open-source builds of TestWebKitAPI and WebKitTestRunner, but that has caused trusted execution problems. Here&apos;s my best understanding as to why.

- When EWS builds for Mac: On Intel, we DO NOT sign these TestWebKitAPI and WebKitTestRunner. On Apple Silicon, we &quot;linker sign&quot; them, which is a minimal signing technique that doesn&apos;t call `codesign` and ignores entitlements.

- When EWS builds for iOS (and other embedded Apple platforms): We ad-hoc sign. This is Xcode&apos;s default, as far as I am aware, because the simulators have stricter enforcement of signed binaries.

- When Apple engineers build TestWebKitAPI and WebKitTestRunner internally, they sign with the WK_ENGINEERING_CODE_SIGN_IDENTITY. When Apple builds these projects in production, they are ad-hoc signed. Both methods use `codesign` and embed entitlements.

- TestWebKitAPI and WebKitTestRunner both have entitlements which require their binaries to have a valid signature, notably NOT an ad-hoc signature. But, since open-source builds are not formally signed, these entitlements are never present on EWS.

I have tried to fix the build issue two separate ways:

- Disable code signing altogether: When I tried this, iOS test runs started breaking, because of the simulator&apos;s signature enforcement.

- Use ad-hoc signing for Mac WKTR and TestWebKitAPI: Doing this embeds the sensitive entitlements, which prevent execution on testers. Notably, it&apos;s not machine-dependent. I can re-sign these binaries on the test machines with the same entitlement plist, and they will still fail to launch. The kernel logs this message:

    2022-09-02 10:58:36.789 Df kernel.development[0:1d5aaf] mac_vnode_check_signature: /Users/emw/Downloads/Release/TestWebKitAPI: code signature validation failed fatally: When validating /Users/emw/Downloads/Release/TestWebKitAPI:
      Code has restricted entitlements, but the validation of its code signature failed.
    Unsatisfied Entitlements:

--

With this in mind, the next thing I want to try to do is turning off these entitlements for open-source builds. Hopefully that can produce ad-hoc-signed executables that will pass the signature check.

Alternatively, we could try disabling code signing again, but this time only for Mac builds.

Ultimately, it seems like a liability that we do not have a real signing identity for EWS. We should consider creating one and installing it on all EWS builders and testers so that we can do more advanced signing with our open-source build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896527</commentid>
    <comment_count>12</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-09-06 11:58:45 -0700</bug_when>
    <thetext>Committed 254192@main (e347e3e762ae): &lt;https://commits.webkit.org/254192@main&gt;

Reviewed commits have been landed. Closing PR #3428 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925458</commentid>
    <comment_count>13</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2023-01-13 15:14:10 -0800</bug_when>
    <thetext>Re-opening for pull request https://github.com/apple/WebKit/pull/288</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925523</commentid>
    <comment_count>14</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-13 18:37:15 -0800</bug_when>
    <thetext>Committed 252432.1028@safari-7614-branch (aa02d3f68425): &lt;https://commits.webkit.org/252432.1028@safari-7614-branch&gt;

Reviewed commits have been landed. Closing PR #288 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>