Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-11240

gnome-base/librsvg doesn't build with rust >=1.69.0

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical (System) Critical (System)
    • None
    • None
    • Install Rust 1.69.0 and emerge gnome-base/librsvg
    • This breaks librsvg build/rebuild after rust upgrades.

      During the testing of FL-11236 I discovered that our version of gnome-base/librsvg-2.48.8 fails compilation rust 1.69.0 with this error:

       

      error[E0793]: reference to packed field is unaligned
         --> /var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/vendor/tendril/src/tendril.rs:241:20
          |
      241 |                 if (*header).refcount.decrement() == 1 {
          |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          |
          = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
          = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
      error[E0793]: reference to packed field is unaligned
         --> /var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/vendor/tendril/src/tendril.rs:958:9
          |
      958 |         (*self.header()).refcount.increment();
          |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          |
          = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
          = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
      For more information about this error, try `rustc --explain E0793`.
      error: could not compile `tendril` due to 2 previous errors
      Caused by:
        process didn't exit successfully: `rustc --crate-name tendril /var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/vendor/tendril/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -C metadata=f10ed1f7b483afae -C extra-filename=-f10ed1f7b483afae --out-dir /var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/target/release/deps -L dependency=/var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/target/release/deps --extern futf=/var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/target/release/deps/libfutf-c864e61969ff71a7.rmeta --extern mac=/var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/target/release/deps/libmac-df366171fcd5f44f.rmeta --extern utf8=/var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/target/release/deps/libutf8-243083e99d680509.rmeta --cap-lints allow -C target-cpu=znver3` (exit status: 1)
      warning: build failed, waiting for other jobs to finish...
      make[2]: *** [Makefile:1768: librsvg_c_api.la] Error 101
      make[2]: Leaving directory '/var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8'
      make[1]: *** [Makefile:1274: all-recursive] Error 1
      make[1]: Leaving directory '/var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8'
      make: *** [Makefile:821: all] Error 2
       * ERROR: gnome-base/librsvg-2.48.8::gnome-kit failed (compile phase):
       *   emake failed
      

      My ego profile:

       

       ego profile
      === Enabled Profiles: ===
              arch: x86-64bit
             build: next
           subarch: amd64-zen3
            flavor: core
           mix-ins: X
           mix-ins: gfxcard-amdgpu
      
      === Python kit: ===
            branch: next
      === All inherited flavor from core flavor: ===
                               minimal (from core flavor)
      === All inherited mix-ins from gfxcard-amdgpu mix-ins: ===
            core-gl-kit:gfxcard-amdgpu (from gfxcard-amdgpu mix-in)
      

      I did a cross verification of https://github.com/servo/tendril and https://gitlab.gnome.org/GNOME/librsvg/-/blob/main/Cargo.lock and it looks like the latest version of librsvg uses the tendril Rust Crate v0.4.3, which has a code fix.

      It appears the solution would be increasing the version of gnome-base/librsvg in gnome-kit to it latest release here: https://gitlab.gnome.org/GNOME/librsvg/-/releases , but will need someone from staff or someone with more gnome- dependency expertise to evaluate the ramifications of such a version upgrade.

            drobbins drobbins
            siris siris
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: