Fix Ubuntu OpenJPEG provisioning (#113)
Some checks failed
Native code generation / deterministic (push) Successful in 14m51s
Imaging and meshing gate / native (push) Failing after 2m1s
JPEG 2000 feature / linux (push) Successful in 2m42s
Native Rust workspace compile / compile (push) Has been cancelled

This commit is contained in:
2026-08-10 11:57:42 +00:00
parent ed516a1a5d
commit b64020d45b
5 changed files with 87 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ on:
- "codegen/**"
- "tools/codegen/**"
- "tools/generate_*.py"
- "tools/install_openjpeg_2_5_4.sh"
- "tools/check_api_coverage.py"
- "tools/check_codegen_gate.py"
- "tools/check_milestone_08.py"
@@ -51,6 +52,7 @@ on:
- "codegen/**"
- "tools/codegen/**"
- "tools/generate_*.py"
- "tools/install_openjpeg_2_5_4.sh"
- "tools/check_api_coverage.py"
- "tools/check_codegen_gate.py"
- "tools/check_milestone_08.py"
@@ -88,11 +90,20 @@ on:
jobs:
deterministic:
runs-on: ubuntu-latest
env:
OPENJPEG_PREFIX: /tmp/metacrate-openjpeg-${{ github.run_id }}
PKG_CONFIG_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib/pkgconfig
LD_LIBRARY_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Install audited OpenJPEG 2.5.4
run: |
sudo apt-get update
sudo apt-get install --yes build-essential cmake pkg-config
tools/install_openjpeg_2_5_4.sh "$OPENJPEG_PREFIX"
- name: Test diagnostics and byte-identical generation
run: cargo test -p libremetaverse-codegen
- name: Verify vendored hashes and checked-in output

View File

@@ -21,6 +21,7 @@ on:
- "tests/compat/tests/imaging_meshing_semantics.rs"
- "tests/upstream-tests.json"
- "tools/check_milestone_06.py"
- "tools/install_openjpeg_2_5_4.sh"
pull_request:
paths:
- ".gitea/workflows/imaging-meshing.yml"
@@ -41,6 +42,7 @@ on:
- "tests/compat/tests/imaging_meshing_semantics.rs"
- "tests/upstream-tests.json"
- "tools/check_milestone_06.py"
- "tools/install_openjpeg_2_5_4.sh"
workflow_dispatch:
jobs:
@@ -48,6 +50,9 @@ jobs:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
OPENJPEG_PREFIX: /tmp/metacrate-openjpeg-${{ github.run_id }}
PKG_CONFIG_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib/pkgconfig
LD_LIBRARY_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
@@ -56,6 +61,11 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Install audited OpenJPEG 2.5.4
run: |
sudo apt-get update
sudo apt-get install --yes build-essential cmake pkg-config
tools/install_openjpeg_2_5_4.sh "$OPENJPEG_PREFIX"
- name: Audit milestone ownership and feature isolation
run: python tools/check_milestone_06.py
- name: Test native imaging and meshing crates

View File

@@ -10,6 +10,7 @@ on:
- "crates/libremetaverse-types/**"
- "crates/libremetaverse-imaging/**"
- "crates/libremetaverse-openjpeg/**"
- "tools/install_openjpeg_2_5_4.sh"
pull_request:
paths:
- ".gitea/workflows/jpeg2000.yml"
@@ -19,16 +20,18 @@ on:
- "crates/libremetaverse-types/**"
- "crates/libremetaverse-imaging/**"
- "crates/libremetaverse-openjpeg/**"
- "tools/install_openjpeg_2_5_4.sh"
workflow_dispatch:
jobs:
linux:
runs-on: ubuntu-latest
env:
# Ubuntu 24.04 also ships an older libopenjp2.so.7. Ensure both
# pkg-config and the runtime loader select the audited 2.5.4 install.
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
LD_LIBRARY_PATH: /usr/local/lib
# Ubuntu also ships an older libopenjp2.so.7. Ensure both pkg-config and
# the runtime loader select this run's isolated, audited 2.5.4 install.
OPENJPEG_PREFIX: /tmp/metacrate-openjpeg-${{ github.run_id }}
PKG_CONFIG_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib/pkgconfig
LD_LIBRARY_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
@@ -36,12 +39,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --yes build-essential cmake pkg-config
git clone --branch v2.5.4 --depth 1 https://github.com/uclouvain/openjpeg.git /tmp/openjpeg-2.5.4
cmake -S /tmp/openjpeg-2.5.4 -B /tmp/openjpeg-build -DBUILD_CODEC=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
cmake --build /tmp/openjpeg-build --parallel
sudo cmake --install /tmp/openjpeg-build
sudo ldconfig
test "$(pkg-config --modversion libopenjp2)" = "2.5.4"
tools/install_openjpeg_2_5_4.sh "$OPENJPEG_PREFIX"
- name: Build and test optional feature
run: |
cargo test -p libremetaverse-imaging --features jpeg2000

View File

@@ -4,12 +4,14 @@ on:
push:
paths:
- ".gitea/workflows/rust-workspace.yml"
- "tools/install_openjpeg_2_5_4.sh"
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
pull_request:
paths:
- ".gitea/workflows/rust-workspace.yml"
- "tools/install_openjpeg_2_5_4.sh"
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
@@ -18,11 +20,20 @@ on:
jobs:
compile:
runs-on: ubuntu-latest
env:
OPENJPEG_PREFIX: /tmp/metacrate-openjpeg-${{ github.run_id }}
PKG_CONFIG_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib/pkgconfig
LD_LIBRARY_PATH: /tmp/metacrate-openjpeg-${{ github.run_id }}/lib
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Install audited OpenJPEG 2.5.4
run: |
sudo apt-get update
sudo apt-get install --yes build-essential cmake pkg-config
tools/install_openjpeg_2_5_4.sh "$OPENJPEG_PREFIX"
- name: Check formatting
run: cargo fmt --all -- --check
- name: Audit native milestone 09 boundaries

47
tools/install_openjpeg_2_5_4.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/sh
set -eu
OPENJPEG_VERSION=2.5.4
OPENJPEG_COMMIT=6c4a29b00211eb0430fa0e5e890f1ce5c80f409f
if [ "$#" -ne 1 ] || [ -z "$1" ]; then
echo "usage: $0 INSTALL_PREFIX" >&2
exit 2
fi
install_prefix=$1
pkg_config_path="$install_prefix/lib/pkgconfig"
if [ -f "$pkg_config_path/libopenjp2.pc" ] &&
PKG_CONFIG_PATH="$pkg_config_path" pkg-config --exact-version "$OPENJPEG_VERSION" libopenjp2
then
exit 0
fi
work_dir=$(mktemp -d "${TMPDIR:-/tmp}/metacrate-openjpeg.XXXXXX")
trap 'rm -rf "$work_dir"' EXIT HUP INT TERM
source_dir="$work_dir/source"
build_dir="$work_dir/build"
git clone --branch "v$OPENJPEG_VERSION" --depth 1 \
https://github.com/uclouvain/openjpeg.git "$source_dir"
actual_commit=$(git -C "$source_dir" rev-parse HEAD)
if [ "$actual_commit" != "$OPENJPEG_COMMIT" ]; then
echo "OpenJPEG v$OPENJPEG_VERSION resolved to unexpected commit $actual_commit" >&2
exit 1
fi
cmake -S "$source_dir" -B "$build_dir" \
-DBUILD_CODEC=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX="$install_prefix"
cmake --build "$build_dir" --parallel
cmake --install "$build_dir"
PKG_CONFIG_PATH="$pkg_config_path" pkg-config --exact-version "$OPENJPEG_VERSION" libopenjp2