Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 22 additions & 36 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ on: [push, pull_request]

name: CI Linux

# Least privilege: this workflow only reads the repo and runs tests.
permissions:
contents: read

jobs:
test-amd64:
name: rust-libxml amd64 CI
Expand All @@ -11,41 +15,29 @@ jobs:
with_default_bindings: [false, true]
steps:
- name: install dependencies
uses: ryankurte/action-apt@v0.2.0
with:
packages: "libxml2-dev"
run: |
sudo apt-get update
sudo apt-get install -y libxml2-dev
- name: Set up LIBXML2 env var if compiling with the default bindings
run: echo "LIBXML2=$(pkg-config libxml-2.0 --variable=libdir)/libxml2.so" >> "$GITHUB_ENV"
if: ${{ matrix.with_default_bindings }}
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: run tests
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test

test-arm64:
name: rust-libxml arm64 CI
runs-on: ubuntu-24.04-arm
steps:
- name: install dependencies
uses: ryankurte/action-apt@v0.2.0
with:
packages: "libxml2-dev"
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
run: |
sudo apt-get update
sudo apt-get install -y libxml2-dev
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: run tests
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test

test-newer-libxml2:
strategy:
Expand All @@ -55,10 +47,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: install dependencies
uses: ryankurte/action-apt@v0.2.0
with:
packages: "libpython3-dev"
- uses: actions/checkout@v2
run: |
sudo apt-get update
sudo apt-get install -y libpython3-dev
- uses: actions/checkout@v6
- name: Install libxml ${{ matrix.libxml_version }} by hand
run: |
wget https://download.gnome.org/sources/libxml2/$(echo ${{ matrix.libxml_version }} | sed -e 's/\.[0-9]*$//')/libxml2-${{ matrix.libxml_version }}.tar.xz
Expand All @@ -67,14 +59,8 @@ jobs:
./configure
make
sudo make install
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- name: run tests
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test
env:
LD_LIBRARY_PATH: /usr/local/lib
24 changes: 11 additions & 13 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@ on:
- master

name: Publish Docs

# Deploy step pushes the rendered docs to the gh-pages branch.
permissions:
contents: write

jobs:
publish_docs:
if: github.repository == 'KWARC/rust-libxml'
name: Publish Docs
runs-on: ubuntu-latest
steps:
- name: install dependencies
uses: ryankurte/action-apt@v0.2.0
with:
packages: "libxml2-dev"
run: |
sudo apt-get update
sudo apt-get install -y libxml2-dev
- name: Set up LIBXML2 env var if compiling with the default bindings
run: echo "LIBXML2=$(pkg-config libxml-2.0 --variable=libdir)/libxml2.so" >> "$GITHUB_ENV"
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Build Documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps
run: cargo doc --all --no-deps

- name: Deploy Documentation
env:
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ on: [push, pull_request]

name: CI Windows

# Least privilege: this workflow only reads the repo and runs tests.
permissions:
contents: read

jobs:
test-default-windows:
name: Windows vcpkg (default)
runs-on: windows-latest
env:
env:
VCPKGRS_DYNAMIC: 1
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_ROOT: C:\vcpkg
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup vcpkg libxml2 Cache
uses: actions/cache@v4
id: vcpkg-cache
Expand All @@ -23,9 +27,7 @@ jobs:
vcpkg install libxml2:x64-windows
vcpkg integrate install
- name: run tests
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test

test-mingw64-windows:
name: Windows (mingw64)
Expand All @@ -34,7 +36,7 @@ jobs:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: msys2/setup-msys2@v2
with:
path-type: minimal
Expand All @@ -45,14 +47,18 @@ jobs:
mingw64/mingw-w64-x86_64-pkg-config
mingw64/mingw-w64-x86_64-libxml2
- name: Install stable windows-gnu Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable-x86_64-pc-windows-gnu
target: x86_64-pc-windows-gnu
override: true
targets: x86_64-pc-windows-gnu
- name: Ensure mingw64 pkg-config is in path
run: echo "C:\msys64\mingw64\bin" >> "$GITHUB_PATH"
# Run cargo in the default Windows shell, not the job's msys2 shell:
# rustup installs cargo to the Windows user profile, which
# `path-type: minimal` strips from the msys2 PATH (exit 127). The old
# actions-rs/cargo step ran in the runner's Windows context too, never
# msys2. mingw64/bin is on PATH via the step above, so pkg-config, gcc,
# and the libxml2 DLLs still resolve for the windows-gnu build.
- name: run tests
uses: actions-rs/cargo@v1
with:
command: test
shell: pwsh
run: cargo test
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Change Log

## [0.3.12] (in development)
## [0.3.13] (in development)

## [0.3.12] (2026-05-23)

### Added

* New `io` module: `io::register_input_callback(match_url, open)` is
a safe wrapper around `xmlRegisterInputCallbacks`. Accepts two
closures (`&str -> bool`, `&str -> Option<Vec<u8>>`) and installs
them as a custom URL-scheme handler. The intended use is bundling
XSLT stylesheets / RNG schemas via `include_bytes!` and serving
them through a synthetic scheme (e.g. `embed:///foo.xsl`), so
libxslt's `xsl:import` resolution can reach the embedded bytes
without touching the disk. Closures may run on any thread libxml2
calls them from (`Send + Sync + 'static`).

## [0.3.11] (2026-05-18)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libxml"
version = "0.3.11"
version = "0.3.12"
edition = "2024"
authors = ["Andreas Franzén <andreas@devil.se>", "Deyan Ginev <deyan.ginev@gmail.com>","Jan Frederik Schaefer <j.schaefer@jacobs-university.de>"]
description = "A Rust wrapper for libxml2 - the XML C parser and toolkit developed for the Gnome project"
Expand Down
Loading
Loading