Skip to content

Port to meson and cargo-c (try 2)

Amyspark requested to merge amyspark/librsvg:mesonify-2 into main

Hey all,

This is an update to clean up, finish, and merge the earlier work by @federico in !657 (closed).

Features in this PR

  • Meson + cargo-c support
  • @federico implemented some bits to turn C-style arrays into UTF-8 strings (I preserved and linted it)
  • Fixed a broken dead_code in Rust nightly causing the CI to fail: https://github.com/rust-lang/rust/issues/120770
    • This is necessary because the image rebuild will pull Rust 1.87 nightly which is broken at present.
  • Removed a couple unused includes in the C test suite.
  • Documented (by Federico, I updated it with the final state of the PR) the port effort to Meson

Current status

  • Build and install library
  • Build and install rsvg-convert
  • Hook to Rust tests
  • Generate rsvg-version.h
  • Install header files
  • Install .pc file
  • Hook to C API tests
  • GIR - GObject Introspection and typelib
  • Build vala VAPI - see libgweather/libgweather/meson.build (depends on GIR)
  • Build docs with gi-docgen (depends on GIR)
  • Build and install rsvg-convert man page
  • gdk-pixbuf loader - see if !722 (merged) makes this easier
  • Change the CI to include meson and cargo-c in the images
  • Fix the msys2 job in the CI - fixed in !728 (merged)
  • Whenever we do meson test, pass --print-errorlogs to avoid having to look at the testlog.txt.
  • Update ci/build-with-coverage.sh and fix the coverage job to work with Meson.
  • Update ci/utils.py to pull the main version number from meson.build instead of configure.ac
  • Do we need a distcheck job in the CI? (or does meson dist always produce working tarballs?)
  • Fix the reference and pages jobs in the CI (depends on GIR)
  • Notify the release team and gnome-build-meta
  • Notify downstreams; let them find packaging problems

Problems, to solve later (From Federico)

  • Too much rebuilding? The library gets built three times: cargo cbuild for the C library, "cargo build" for rsvg-convert, and cargo test for the tests.
    • I'll (@amyspark) probably do the single cargo run and extract the targets, but after everything is working. This is because Meson enforces each target building the whole library into its own internal folder.
    • I got it down to a minimum of two -- one for cbuild and another for the rest (rsvg, rsvg-convert etc.)
  • My meson code is messy, clean it up plz.
    • (amyspark) Just finished sorting it out, if it's necessary I'll give it a coat of muon for styling.

Fixes #552 (closed)

Closes !657 (closed)

Edited by Amyspark

Merge request reports