<?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>257516</bug_id>
          
          <creation_ts>2023-05-30 17:31:15 -0700</creation_ts>
          <short_desc>[GLIB] GResources being re-regenerated due to bad dependency file</short_desc>
          <delta_ts>2024-04-04 09:32:50 -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>CMake</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=258478</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Lauro Moura">lmoura</reporter>
          <assigned_to name="Alicia Boya García">aboya</assigned_to>
          <cc>aboya</cc>
    
    <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>philn</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1958917</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2023-05-30 17:31:15 -0700</bug_when>
    <thetext>Currently, the &quot;.deps&quot; files used to track the GResourceBundle dependencies are making ninja re-generate the bundle source even though there was nothing changed on the file. While these are quite minor files, it&apos;s triggering the relink of the main webkit library, which usually makes my laptop to become unusable.

Running ninja with &quot;-d explain&quot;, it shows messages like these:

ninja explain: expected depfile &apos;/app/webkit/WebKitBuild/Release/WebKitGTK/DerivedSources/PdfJSGResourceBundle.deps&apos; to mention &apos;WebKitGTK/DerivedSources/PdfJSGResourceBundle.c&apos;, got &apos;/app/webkit/WebKitBuild/Release/WebKitGTK/DerivedSources/PdfJSGResourceBundle.xml&apos;
ninja explain: depfile &apos;/app/webkit/WebKitBuild/Release/WebKitGTK/DerivedSources/PdfJSGResourceBundleExtras.deps&apos; is missing
ninja explain: expected depfile &apos;/app/webkit/WebKitBuild/Release/WebKitGTK/DerivedSources/WebKitResourcesGResourceBundle.deps&apos; to mention &apos;WebKitGTK/DerivedSources/WebKitResourcesGResourceBundle.c&apos;, got &apos;/app/webkit/WebKitBuild/Release/WebKitGTK/DerivedSources/WebKitResourcesGResourceBundle.xml&apos; 

This led me to https://gitlab.gnome.org/GNOME/glib/-/issues/2829

glib-compile-resources is generating the depfile like this:

bundle.xml: dep1 dep2

instead of

bundle.c: bundle.xml dep1 dep2

Another issue seems to be related to ninja, which seems expect the target name in the deps file to be a relative path (maybe because it&apos;s the target name?) while the generated deps has an absolute path.

Tentative patch incoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1958952</commentid>
    <comment_count>1</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2023-05-30 21:40:02 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/14523</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1959125</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-05-31 12:58:54 -0700</bug_when>
    <thetext>I submitted a fix for the first issue in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3460

(In reply to Lauro Moura from comment #0) 
&gt; Another issue seems to be related to ninja, which seems expect the target
&gt; name in the deps file to be a relative path (maybe because it&apos;s the target
&gt; name?) while the generated deps has an absolute path.

Hm, tricky. Perhaps can fix this by passing relative paths to glib-compile-resources? That&apos;s quite a footgun though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1964848</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-07-03 12:26:22 -0700</bug_when>
    <thetext>Current status:

 * glib-compile-resources is fixed in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3460
 * Other misc issues fixed via bug #258478
 * The problem with relative vs. absolute paths is not fixed

Ninja bug report:

https://github.com/ninja-build/ninja/issues/1251

CMake workarounds:

https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6143
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6148

Sadly, the CMake changes don&apos;t seem to be sufficient for me. We might need to change the paths that we pass to glib-compile-resources. Rewriting the dependency file works too, but that seems extreme.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023515</commentid>
    <comment_count>4</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2024-03-24 03:14:09 -0700</bug_when>
    <thetext>I&apos;ve checked here, that making the target name in the deps file refer to relative paths fixes the issue, incremental build time went from ~20 seconds to 1 second...

Could this be another glib-compile-resources bug? Do we know why it uses the absolute path instead of relative path?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023548</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-03-24 12:38:40 -0700</bug_when>
    <thetext>It&apos;s a ninja bug (see previous comment)

(In reply to Philippe Normand from comment #4)
&gt; Do we know why it uses the absolute path instead of relative path?

I think it just uses whatever we pass to it, and we pass absolute paths.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025338</commentid>
    <comment_count>6</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2024-04-02 02:30:41 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #5)
&gt; It&apos;s a ninja bug (see previous comment)
&gt; 
&gt; (In reply to Philippe Normand from comment #4)
&gt; &gt; Do we know why it uses the absolute path instead of relative path?
&gt; 
&gt; I think it just uses whatever we pass to it, and we pass absolute paths.

Can confirm this. I&apos;m working on a patch to make it use relative paths, and also refactor all those `add_custom_command()` into a custom cmake function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025349</commentid>
    <comment_count>7</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2024-04-02 04:08:43 -0700</bug_when>
    <thetext>(In reply to Alicia Boya García from comment #6)
&gt; (In reply to Michael Catanzaro from comment #5)
&gt; &gt; It&apos;s a ninja bug (see previous comment)
&gt; &gt; 
&gt; &gt; (In reply to Philippe Normand from comment #4)
&gt; &gt; &gt; Do we know why it uses the absolute path instead of relative path?
&gt; &gt; 
&gt; &gt; I think it just uses whatever we pass to it, and we pass absolute paths.
&gt; 
&gt; Can confirm this. I&apos;m working on a patch to make it use relative paths, and
&gt; also refactor all those `add_custom_command()` into a custom cmake function.

Nice, thanks! I had this in my list of things to do when having spare cycles
to improve the build; feel free to chat with me if you want some help with
the CMake build system 👍</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025669</commentid>
    <comment_count>8</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2024-04-03 06:33:18 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/26786</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025955</commentid>
    <comment_count>9</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2024-04-04 05:22:32 -0700</bug_when>
    <thetext>*** Bug 272090 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025998</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-04-04 09:32:47 -0700</bug_when>
    <thetext>Committed 277059@main (18c724980da2): &lt;https://commits.webkit.org/277059@main&gt;

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

    </bug>

</bugzilla>