<?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>212026</bug_id>
          
          <creation_ts>2020-05-18 07:58:40 -0700</creation_ts>
          <short_desc>[GTK] Allow gtk-doc and introspection in cross builds</short_desc>
          <delta_ts>2020-05-18 13:38:07 -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>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>annulen</cc>
    
    <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>ryuan.choi</cc>
    
    <cc>sergio</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1653608</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-05-18 07:58:40 -0700</bug_when>
    <thetext>See https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/76

OptionsGTK.cmake contains:

# Override the cached variables, gtk-doc and gobject-introspection do not really work when cross-building.
if (CMAKE_CROSSCOMPILING)
    set(ENABLE_GTKDOC OFF)
    set(ENABLE_INTROSPECTION OFF)
endif ()

But in fact, if we remove these lines, cross building works perfectly fine. We&apos;ve been patching out these lines when building the GNOME runtimes because we cross-build i386 and armv7 packages and obviously need introspection to work.

These lines were added way back in r186259, so I can only presume something has changed somewhere such that it&apos;s no longer a problem, because both work perfectly fine. We have very simple CMake toolchain files that just set CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR, which is minimum required when cross building with CMake, so if it works for us I assume it should work for anyone....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1653609</commentid>
    <comment_count>1</comment_count>
      <attachid>399647</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-05-18 08:00:12 -0700</bug_when>
    <thetext>Created attachment 399647
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1653630</commentid>
    <comment_count>2</comment_count>
      <attachid>399647</attachid>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2020-05-18 09:14:30 -0700</bug_when>
    <thetext>Comment on attachment 399647
Patch

I think this is from before the times packagers figured out that they
could run gtk-doc and/or g-ir-scanner/g-ir-generate using qemu userspace
emulation to allow running code for the target platform when doing a
cross-compiled build. While that&apos;s a terrible hack and ideally GTK-Doc
and GI should support cross-compilation better, it&apos;s true that it is
no longer needed to forcibly disable these two options 🤔️

Let&apos;s land this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1653634</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-05-18 09:20:13 -0700</bug_when>
    <thetext>Committed r261814: &lt;https://trac.webkit.org/changeset/261814&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399647.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1653644</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-05-18 10:00:48 -0700</bug_when>
    <thetext>I&apos;m pretty sure we&apos;re not using qemu or anything special? *shrug*</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1653735</commentid>
    <comment_count>5</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2020-05-18 13:22:13 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #4)
&gt; I&apos;m pretty sure we&apos;re not using qemu or anything special? *shrug*

In case you feel like doing some oddball build tooling archeology...

I have no idea how Fedora (which I suppose is the “we” there) wrangles
this, but I am sure that&apos;s how Yocto and Buildroot do it:

  https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/gobject-introspection.bbclass#n28
  https://git.busybox.net/buildroot/tree/package/gobject-introspection/gobject-introspection.mk#n96

As for Flatpak, if you do a cross-build the whole build sandbox runs
inside the qemu userspace emulator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1653746</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-05-18 13:36:55 -0700</bug_when>
    <thetext>(In reply to Adrian Perez from comment #5)
&gt; I have no idea how Fedora (which I suppose is the “we” there) wrangles
&gt; this, but I am sure that&apos;s how Yocto and Buildroot do it:

No, Fedora never cross builds anything, we do native builds only. Maybe armv7 builds are done in a VM or something, dunno. Here &quot;we&quot; is GNOME, I&apos;m trying to upstream this GNOME patch.

&gt; As for Flatpak, if you do a cross-build the whole build sandbox runs
&gt; inside the qemu userspace emulator.

Probably that explains why it works for GNOME.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1653749</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-05-18 13:38:07 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #6)
&gt; No, Fedora never cross builds anything, we do native builds only. Maybe
&gt; armv7 builds are done in a VM or something, dunno. Here &quot;we&quot; is GNOME, I&apos;m
&gt; trying to upstream this GNOME patch.

Ugh, sorry. There &quot;we&quot; in the first sentence meant Fedora, and in the third second meant GNOME. I can probably change my &quot;we&quot; multiple times in the same sentence if not careful. So many hats....</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>399647</attachid>
            <date>2020-05-18 08:00:12 -0700</date>
            <delta_ts>2020-05-18 09:20:14 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-212026-20200518100010.patch</filename>
            <type>text/plain</type>
            <size>1309</size>
            <attacher name="Michael Catanzaro">mcatanzaro</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjYxNzQ5CmRpZmYgLS1naXQgYS9Tb3VyY2UvY21ha2UvT3B0
aW9uc0dUSy5jbWFrZSBiL1NvdXJjZS9jbWFrZS9PcHRpb25zR1RLLmNtYWtlCmluZGV4IGIxYWMy
NjYwNDk2ZTBlMjUwYTU4MDYzYmU1Zjk3MGNmMzhjN2VhN2EuLjU3ZjIwN2RjYzY0ODEyMmNiMmU2
NzE4ZTlmNDhlYjYwZjlhNGFkN2QgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9jbWFrZS9PcHRpb25zR1RL
LmNtYWtlCisrKyBiL1NvdXJjZS9jbWFrZS9PcHRpb25zR1RLLmNtYWtlCkBAIC00MjUsMTIgKzQy
NSw2IEBAIGlmIChFTkFCTEVEX0NPTVBJTEVSX1NBTklUSVpFUlMpCiAgICAgc2V0KEVOQUJMRV9J
TlRST1NQRUNUSU9OIE9GRikKIGVuZGlmICgpCiAKLSMgT3ZlcnJpZGUgdGhlIGNhY2hlZCB2YXJp
YWJsZXMsIGd0ay1kb2MgYW5kIGdvYmplY3QtaW50cm9zcGVjdGlvbiBkbyBub3QgcmVhbGx5IHdv
cmsgd2hlbiBjcm9zcy1idWlsZGluZy4KLWlmIChDTUFLRV9DUk9TU0NPTVBJTElORykKLSAgICBz
ZXQoRU5BQkxFX0dUS0RPQyBPRkYpCi0gICAgc2V0KEVOQUJMRV9JTlRST1NQRUNUSU9OIE9GRikK
LWVuZGlmICgpCi0KICMg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