<?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>225476</bug_id>
          
          <creation_ts>2021-05-06 12:13:21 -0700</creation_ts>
          <short_desc>Add API test for FileSystem::fileExists() on a broken symbolic link</short_desc>
          <delta_ts>2021-05-06 16:14:26 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</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=225491</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Dumez">cdumez</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>achristensen</cc>
    
    <cc>darin</cc>
    
    <cc>ggaren</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1757565</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 12:13:21 -0700</bug_when>
    <thetext>Add API test for FileSystem::fileExists() on a broken symbolic link.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757568</commentid>
    <comment_count>1</comment_count>
      <attachid>427918</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 12:17:57 -0700</bug_when>
    <thetext>Created attachment 427918
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757586</commentid>
    <comment_count>2</comment_count>
      <attachid>427918</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-05-06 13:09:34 -0700</bug_when>
    <thetext>Comment on attachment 427918
Patch

Should also add one for a non-broken symlink *to* a broken symlink</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757588</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 13:11:10 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #2)
&gt; Comment on attachment 427918 [details]
&gt; Patch
&gt; 
&gt; Should also add one for a non-broken symlink *to* a broken symlink

For what it&apos;s worth FileSystem::exists() for a symlink to a *non-broken* symlink seems to return false. I have noticed this today. I will try and figure out why but the good? news is that it seems this is not new behavior from porting to std::filesystem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757597</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-05-06 13:26:34 -0700</bug_when>
    <thetext>I suppose all these test cases show why we’d rather *not* have our own file system layer. But the convenience of using WTF::String directly is so tempting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757599</commentid>
    <comment_count>5</comment_count>
      <attachid>427918</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 13:27:07 -0700</bug_when>
    <thetext>Comment on attachment 427918
Patch

Clearing flags on attachment: 427918

Committed r277113 (237411@main): &lt;https://commits.webkit.org/237411@main&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757600</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 13:27:10 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757602</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-05-06 13:28:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/77622567&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757606</commentid>
    <comment_count>8</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 13:32:51 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #4)
&gt; I suppose all these test cases show why we’d rather *not* have our own file
&gt; system layer. But the convenience of using WTF::String directly is so
&gt; tempting.

I personally don&apos;t mind having our own FileSystem layer with WTF::String convenience and some other small niceties, as long as we keep the WTF::FileSystem layer cross-platform &amp; small (by leveraging std::filesystem) and with a good set of tests.

The issue in my opinion was that we had 3 separate implementations with slightly different behaviors and almost no tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757678</commentid>
    <comment_count>9</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 15:55:58 -0700</bug_when>
    <thetext>(In reply to Chris Dumez from comment #3)
&gt; (In reply to Darin Adler from comment #2)
&gt; &gt; Comment on attachment 427918 [details]
&gt; &gt; Patch
&gt; &gt; 
&gt; &gt; Should also add one for a non-broken symlink *to* a broken symlink
&gt; 
&gt; For what it&apos;s worth FileSystem::exists() for a symlink to a *non-broken*
&gt; symlink seems to return false. I have noticed this today. I will try and
&gt; figure out why but the good? news is that it seems this is not new behavior
&gt; from porting to std::filesystem.

access() on a symlink to a valid symlink returns -1 and errno is 2, which is:
[ENOENT]           The named file does not exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757688</commentid>
    <comment_count>10</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-05-06 16:06:58 -0700</bug_when>
    <thetext>(In reply to Chris Dumez from comment #9)
&gt; (In reply to Chris Dumez from comment #3)
&gt; &gt; (In reply to Darin Adler from comment #2)
&gt; &gt; &gt; Comment on attachment 427918 [details]
&gt; &gt; &gt; Patch
&gt; &gt; &gt; 
&gt; &gt; &gt; Should also add one for a non-broken symlink *to* a broken symlink
&gt; &gt; 
&gt; &gt; For what it&apos;s worth FileSystem::exists() for a symlink to a *non-broken*
&gt; &gt; symlink seems to return false. I have noticed this today. I will try and
&gt; &gt; figure out why but the good? news is that it seems this is not new behavior
&gt; &gt; from porting to std::filesystem.
&gt; 
&gt; access() on a symlink to a valid symlink returns -1 and errno is 2, which is:
&gt; [ENOENT]           The named file does not exist.

Oh, it was an issue with the way FileSystemTest::SetUp() was constructing the symlink. I&apos;ll fix that and add more tests shortly.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>427918</attachid>
            <date>2021-05-06 12:17:57 -0700</date>
            <delta_ts>2021-05-06 13:27:07 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-225476-20210506121756.patch</filename>
            <type>text/plain</type>
            <size>2430</size>
            <attacher name="Chris Dumez">cdumez</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjc3MTAxCmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggMzhjNTk1ODQzOWU5NmUyYzRjNDQ0MzM1YmZkNTA4YjE3
ZGQxYzZhYi4uZjgyN2FlYWE1M2Y3MDkxZTE5ZWJlNzFmZmJjMjFmZTY4ZTIyN2JmZCAxMDA2NDQK
LS0tIGEvVG9vbHMvQ2hhbmdlTG9nCisrKyBiL1Rvb2xzL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE4
IEBACisyMDIxLTA1LTA2ICBDaHJpcyBEdW1leiAgPGNkdW1lekBhcHBsZS5jb20+CisKKyAgICAg
ICAgQWRkIEFQSSB0ZXN0IGZvciBGaWxlU3lzdGVtOjpmaWxlRXhpc3RzKCkgb24gYSBicm9rZW4g
c3ltYm9saWMgbGluaworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5j
Z2k/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