From 704be04f97f24b72f6db651abc6137e18b7d511a Mon Sep 17 00:00:00 2001 From: "riseproject-dev[bot]" <330740410+riseproject-dev[bot]@users.noreply.github.com> Date: Thu, 24 Sep 2026 07:17:55 +0000 Subject: [PATCH 1/4] c2pa-python: Add version 0.37.12 Signed-off-by: riseproject-dev[bot] <330740410+riseproject-dev[bot]@users.noreply.github.com> --- docs/packages/c2pa-python.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/packages/c2pa-python.yaml b/docs/packages/c2pa-python.yaml index 8834e5f985f..d07ddad24d9 100644 --- a/docs/packages/c2pa-python.yaml +++ b/docs/packages/c2pa-python.yaml @@ -9,3 +9,4 @@ versions: - filename: c2pa_python-0.37.10-py3-none-manylinux_2_39_riscv64.whl sha256: 862ee7d92f163865741657b0bb53fbc998a3ca3339d580e6be713959d735c8cd requires-python: '>=3.10' +- version: 0.37.12 From f0bb1d3ff6159cd4719dcac678f0209ef12eb800 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 24 Sep 2026 11:09:35 +0000 Subject: [PATCH 2/4] c2pa-python: carry forward 0.37.10 patches to 0.37.12 The nightly-upgrade bot bumped docs/packages/c2pa-python.yaml to 0.37.12 but did not copy patches/c2pa-python/0.37.10/ forward, so build-c2pa-python.yml's git apply failed with "No such file or directory" before the build could start. setup.py, src/c2pa/lib.py and pyproject.toml are unchanged between v0.37.10 and v0.37.12 (the only upstream diff in that range is the c2pa-rs pin bump in c2pa-native-version.txt), and both patches still apply cleanly against the v0.37.12 tag (verified with git apply --check), so copy them unchanged to patches/c2pa-python/0.37.12/. --- ...64-to-the-platform-identifier-tables.patch | 81 +++++++++++++++++++ ...-s-own-LICENSE-MIT-and-LICENSE-APACH.patch | 29 +++++++ 2 files changed, 110 insertions(+) create mode 100644 patches/c2pa-python/0.37.12/0001-add-riscv64-to-the-platform-identifier-tables.patch create mode 100644 patches/c2pa-python/0.37.12/0002-ship-the-project-s-own-LICENSE-MIT-and-LICENSE-APACH.patch diff --git a/patches/c2pa-python/0.37.12/0001-add-riscv64-to-the-platform-identifier-tables.patch b/patches/c2pa-python/0.37.12/0001-add-riscv64-to-the-platform-identifier-tables.patch new file mode 100644 index 00000000000..d943f9aa899 --- /dev/null +++ b/patches/c2pa-python/0.37.12/0001-add-riscv64-to-the-platform-identifier-tables.patch @@ -0,0 +1,81 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Sat, 12 Sep 2026 11:16:12 +0200 +Subject: [PATCH 1/2] add riscv64 to the platform-identifier tables + +Upstream-Status: To upstream [not yet submitted; python-wheels does not open issues/PRs on third-party repos] + +get_platform_identifier() (setup.py, used by bdist_wheel to pick the +artifacts/ subfolder to copy into the wheel) and its runtime counterpart +in src/c2pa/lib.py both fall through to the x86_64-unknown-linux-gnu +branch on a native riscv64 host, since neither platform.machine() check +recognises 'riscv64'. Add a riscv64gc-unknown-linux-gnu branch to each, +plus the corresponding PLATFORM_EXTENSIONS/PLATFORM_FOLDERS entries and +get_current_platform()'s linux_riscv64 case, matching the existing +aarch64 handling. + +Signed-off-by: Ludovic Henry +--- + setup.py | 6 ++++++ + src/c2pa/lib.py | 3 +++ + 2 files changed, 9 insertions(+) + +diff --git a/setup.py b/setup.py +index ddf6e98..8c66a90 100644 +--- a/setup.py ++++ b/setup.py +@@ -33,6 +33,7 @@ PLATFORM_EXTENSIONS = { + 'apple-darwin': 'dylib', # universal + 'linux_x86_64': 'so', + 'linux_aarch64': 'so', ++ 'linux_riscv64': 'so', + } + + # Based on what c2pa-rs repo publishes +@@ -44,6 +45,7 @@ PLATFORM_FOLDERS = { + 'aarch64-pc-windows-msvc': 'dll', + 'x86_64-unknown-linux-gnu': 'so', + 'aarch64-unknown-linux-gnu': 'so', ++ 'riscv64gc-unknown-linux-gnu': 'so', + } + + # Directory structure +@@ -86,6 +88,8 @@ def get_platform_identifier(target_arch=None) -> str: + elif system == "linux": + if target_arch == "aarch64" or platform.machine() == "aarch64": + return "aarch64-unknown-linux-gnu" ++ elif target_arch == "riscv64" or platform.machine() == "riscv64": ++ return "riscv64gc-unknown-linux-gnu" + else: + return "x86_64-unknown-linux-gnu" + else: +@@ -115,6 +119,8 @@ def get_current_platform(): + else: # Linux + if platform.machine() == "aarch64": + return "linux_aarch64" ++ elif platform.machine() == "riscv64": ++ return "linux_riscv64" + return "linux_x86_64" + + def copy_platform_libraries(platform_name, clean_first=False): +diff --git a/src/c2pa/lib.py b/src/c2pa/lib.py +index be6353f..17ecbff 100644 +--- a/src/c2pa/lib.py ++++ b/src/c2pa/lib.py +@@ -27,6 +27,7 @@ class CPUArchitecture(Enum): + AARCH64 = "aarch64" + X86_64 = "x86_64" + ARM64 = "arm64" ++ RISCV64 = "riscv64" + + + def get_platform_identifier() -> str: +@@ -61,6 +62,8 @@ def get_platform_identifier() -> str: + elif system == "linux": + if _get_architecture() in [CPUArchitecture.ARM64.value, CPUArchitecture.AARCH64.value]: + return "aarch64-unknown-linux-gnu" ++ elif _get_architecture() == CPUArchitecture.RISCV64.value: ++ return "riscv64gc-unknown-linux-gnu" + return "x86_64-unknown-linux-gnu" + else: + raise ValueError(f"Unsupported operating system: {system}") diff --git a/patches/c2pa-python/0.37.12/0002-ship-the-project-s-own-LICENSE-MIT-and-LICENSE-APACH.patch b/patches/c2pa-python/0.37.12/0002-ship-the-project-s-own-LICENSE-MIT-and-LICENSE-APACH.patch new file mode 100644 index 00000000000..c2750448aa3 --- /dev/null +++ b/patches/c2pa-python/0.37.12/0002-ship-the-project-s-own-LICENSE-MIT-and-LICENSE-APACH.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Sat, 12 Sep 2026 11:16:20 +0200 +Subject: [PATCH 2/2] ship the project's own LICENSE-MIT and LICENSE-APACHE in + the wheel + +Upstream-Status: To upstream [not yet submitted; python-wheels does not open issues/PRs on third-party repos] + +[tool.setuptools] overrides license-files to an empty list, so every +published wheel (all platforms, not just riscv64) carries no licence +text at all despite the project being dual MIT/Apache-2.0 licensed. +Point the list at the two licence files already at the project root +instead of disabling it outright. + +Signed-off-by: Ludovic Henry +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 7620ff9..00602da 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -32,4 +32,4 @@ download-artifacts = "c2pa.build:download_artifacts" + + # Workaround to prevent setuptools from automatically including invalid metadata + [tool.setuptools] +-license-files = [] ++license-files = ["LICENSE-MIT", "LICENSE-APACHE"] From a9dbdb5169ee422e43018e5ce8d9cd171b5c7395 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 24 Sep 2026 12:15:30 +0000 Subject: [PATCH 3/4] c2pa-python: drop --locked from the c2pa-rs cargo build (upstream stopped tracking Cargo.lock) --- .github/workflows/build-c2pa-python.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-c2pa-python.yml b/.github/workflows/build-c2pa-python.yml index 4761a57a69a..7b35ac1d129 100644 --- a/.github/workflows/build-c2pa-python.yml +++ b/.github/workflows/build-c2pa-python.yml @@ -93,7 +93,10 @@ jobs: curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y git clone --depth 1 --branch "$C2PA_NATIVE_TAG" https://github.com/contentauth/c2pa-rs /tmp/c2pa-rs cd /tmp/c2pa-rs - "$HOME/.cargo/bin/cargo" build --release --locked -p c2pa-c-ffi --no-default-features --features "rust_native_crypto,add_thumbnails,http,file_io" + # c2pa-rs stopped tracking Cargo.lock as of the c2pa-v0.91.0 tag (upstream + # commit 40d0218b); --locked has nothing to lock against and just errors. + # Matches c2pa_c_ffi/Makefile's own CARGO_BUILD_FLAGS, which never had it. + "$HOME/.cargo/bin/cargo" build --release -p c2pa-c-ffi --no-default-features --features "rust_native_crypto,add_thumbnails,http,file_io" cp target/release/libc2pa_c.so /io/artifacts/riscv64gc-unknown-linux-gnu/ cd /io /opt/python/cp312-cp312/bin/pip install -q toml==0.10.2 setuptools==68.0.0 wheel==0.46.2 From b3cbc6f69fc2d51290d57df0c13a0358bf9cc714 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 24 Sep 2026 16:38:49 +0000 Subject: [PATCH 4/4] c2pa-python: fix apostrophe breaking the docker bash -c single-quoted script The "Makefile's own" comment's raw apostrophe closed the single-quoted `bash -c '...'` string early, right there in the shell's eyes. Everything after it in that line, plus the intended cargo build command on the next line, was left as unquoted text/arguments to the outer `run:` script - which meant `cd /tmp/c2pa-rs` never affected anything past that point, and the `cargo build -p c2pa-c-ffi ...` line actually executed on the raw runner host (outside the container, in the checkout directory) instead of inside the container against the cloned c2pa-rs tree. That's exactly why every attempt failed identically with "could not find Cargo.toml" at the runner's own workspace path rather than /tmp/c2pa-rs. Reworded the comment to drop the apostrophe instead of trying to escape a literal ' inside a single-quoted bash string (the '\''-style escape works but is easy to get wrong and harder to read here). --- .github/workflows/build-c2pa-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-c2pa-python.yml b/.github/workflows/build-c2pa-python.yml index 7b35ac1d129..8503ef419bd 100644 --- a/.github/workflows/build-c2pa-python.yml +++ b/.github/workflows/build-c2pa-python.yml @@ -95,7 +95,7 @@ jobs: cd /tmp/c2pa-rs # c2pa-rs stopped tracking Cargo.lock as of the c2pa-v0.91.0 tag (upstream # commit 40d0218b); --locked has nothing to lock against and just errors. - # Matches c2pa_c_ffi/Makefile's own CARGO_BUILD_FLAGS, which never had it. + # Matches the CARGO_BUILD_FLAGS in c2pa_c_ffi/Makefile, which never had it. "$HOME/.cargo/bin/cargo" build --release -p c2pa-c-ffi --no-default-features --features "rust_native_crypto,add_thumbnails,http,file_io" cp target/release/libc2pa_c.so /io/artifacts/riscv64gc-unknown-linux-gnu/ cd /io