<?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>249148</bug_id>
          
          <creation_ts>2022-12-12 07:59:46 -0800</creation_ts>
          <short_desc>import-w3c-tests should work even with broken symlinks in WPT repo</short_desc>
          <delta_ts>2023-08-02 09:36:56 -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>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P5</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>237724</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Nguyen (:ntim)">ntim</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>gsnedders</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1918492</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-12-12 07:59:46 -0800</bug_when>
    <thetext>Reverting https://github.com/web-platform-tests/wpt/commit/ef70ce9623f50e9e7a89bb713920588cfb1259cf fixed it, but we should investigate why this caused breakage on the script.

Downloading W3C test repositories
Fetching https://github.com/web-platform-tests/wpt.git...
Checking out revision origin/master
Traceback (most recent call last):
  File &quot;/Volumes/Data/Code/Safari/OpenSource/Tools/Scripts/import-w3c-tests&quot;, line 35, in &lt;module&gt;
    sys.exit(test_importer.main(sys.argv[1:], sys.stdout, sys.stderr))
  File &quot;/Volumes/Data/Code/Safari/OpenSource/Tools/Scripts/webkitpy/w3c/test_importer.py&quot;, line 98, in main
    test_importer.do_import()
  File &quot;/Volumes/Data/Code/Safari/OpenSource/Tools/Scripts/webkitpy/w3c/test_importer.py&quot;, line 208, in do_import
    self.test_downloader().download_tests(self.source_directory, self.test_paths, self.options.use_tip_of_tree)
  File &quot;/Volumes/Data/Code/Safari/OpenSource/Tools/Scripts/webkitpy/w3c/test_downloader.py&quot;, line 228, in download_tests
    self.copy_tests(destination_directory, test_paths)
  File &quot;/Volumes/Data/Code/Safari/OpenSource/Tools/Scripts/webkitpy/w3c/test_downloader.py&quot;, line 181, in copy_tests
    self._filesystem.copyfile(source_path, destination_path)
  File &quot;/Volumes/Data/Code/Safari/OpenSource/Tools/Scripts/webkitpy/common/system/filesystem.py&quot;, line 83, in copyfile
    return shutil.copyfile(source, destination)
  File &quot;/AppleInternal/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/shutil.py&quot;, line 264, in copyfile
    with open(src, &apos;rb&apos;) as fsrc, open(dst, &apos;wb&apos;) as fdst:
FileNotFoundError: [Errno 2] No such file or directory: &apos;/Volumes/Data/Code/Safari/OpenSource/WebKitBuild/w3c-tests/web-platform-tests/tools/third_party/funcsigs/docs/index.rst&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1919109</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-12-14 04:10:43 -0800</bug_when>
    <thetext>This is frankly bizarre/worrying, as I don&apos;t see why we&apos;d be trying to copy a file that doesn&apos;t exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1920474</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-12-19 08:00:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/103516141&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1969280</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-08-02 09:35:38 -0700</bug_when>
    <thetext>As I commented in the upstream PR of the revert (https://github.com/web-platform-tests/wpt/pull/37442):

&gt; [ef70ce9](https://github.com/web-platform-tests/wpt/commit/ef70ce9623f50e9e7a89bb713920588cfb1259cf) left `tools/third_party/funcsigs/docs/index.rst` as a symlink to the (non-existent, removed) `tools/third_party/funcsigs/docs/README.rst`, which I believe is the origin of all the problems here.

Given WPT _shouldn&apos;t_ have any broken symlinks, this is very low priority, and we&apos;re better off fixing this in the near-term by just reverting any change to WPT that introduces and broken symlinks.

The importer bug here would be easy to fix with the Python 3.3+ follow_symlinks argument on `shutil.copyfile(src, dst, *, follow_symlinks=True)`, as we just need to pass `follow_symlinks=False` in copy_tests in test_downloader.py (and pass it though webkitpy.common.system.filesystem), but as long as we support Python 2 this is more effort than is probably justified.

For the record, https://github.com/web-platform-tests/wpt/pull/41292 re-lands the funcsigs drop _with_ the symlink actually removed this time.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>